[Nut-upsuser] Unable run command on notify events

GATINEAU, ANTOINE (ANTOINE) antoine.gatineau at alcatel-lucent.com
Mon Apr 11 08:05:34 UTC 2011


You're right.
I'll do it like that.

Thanks 
Antoine 

-----Message d'origine-----
De : nut-upsuser-bounces+antoine.gatineau=alcatel-lucent.com at lists.alioth.debian.org [mailto:nut-upsuser-bounces+antoine.gatineau=alcatel-lucent.com at lists.alioth.debian.org] De la part de Arjen de Korte
Envoyé : vendredi 8 avril 2011 16:05
À : nut-upsuser at lists.alioth.debian.org
Objet : Re: [Nut-upsuser] Unable run command on notify events

Citeren "GATINEAU, ANTOINE (ANTOINE)" <antoine.gatineau at alcatel-lucent.com>:

> I got it working. Aparently, the script is launched as the specified 
> user but without the environment variables.
> To make it work, i have defined NOTIFYCMD as following :
> NOTIFYCMD "/bin/bah -c 'source /etc/profile ; /path/to/script/scriptname"
>
> Is there a better way or is this the best way?

Scripts must be self-contained. It is grievous mistake to assume anything about the environment. So it is best to follow Arnaud's advice and use absolute paths to other scripts/binaries that you need.  
If that's not possible, it is probably better to source /etc/profile from within the script you're running.

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


_______________________________________________
Nut-upsuser mailing list
Nut-upsuser at lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser



More information about the Nut-upsuser mailing list