You're right. I'll do it like that. Thanks Antoine
-----Message d'origine----- De : nut-upsuser-bounces+antoine.gatineau=alcatel-lucent....@lists.alioth.debian.org [mailto:nut-upsuser-bounces+antoine.gatineau=alcatel-lucent....@lists.alioth.debian.org] De la part de Arjen de Korte Envoyé : vendredi 8 avril 2011 16:05 À : [email protected] Objet : Re: [Nut-upsuser] Unable run command on notify events Citeren "GATINEAU, ANTOINE (ANTOINE)" <[email protected]>: > 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 [email protected] http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser _______________________________________________ Nut-upsuser mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

