Hello Sabine, this seems as a problem with PATH env. variable; if you issue the command by hand, you do so in an environment with PATH set so that the binaries are found. I guess that the nut user doesn't have so nice PATH, being non-interactive. Try to add full paths to your binaries in the command and see what happens...
Regards, vasek -- Vaclav Krpec NUT developer ----------------------------- Eaton Elektrotechnika s.r.o. ~ S�dlo spolecnosti, jak je zaps�no v rejstr�ku: Kom�rovsk� 2406, Praha 9 - Horn� Pocernice, 193 00, Cesk� Republika ~ Jm�no, m�sto, kde byla spolecnost zaregistrov�na: Praha ~ Identifikacn� c�slo (ICO): 498 11 894 ----------------------------- -----Original Message----- From: nut-upsuser-bounces+vaclavkrpec=eaton....@lists.alioth.debian.org [mailto:nut-upsuser-bounces+vaclavkrpec=eaton....@lists.alioth.debian.org] On Behalf Of nut-upsuser-requ...@lists.alioth.debian.org Sent: Thursday, April 18, 2013 2:00 PM To: nut-upsuser@lists.alioth.debian.org Subject: Nut-upsuser Digest, Vol 94, Issue 18 Send Nut-upsuser mailing list submissions to nut-upsuser@lists.alioth.debian.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser or, via email, send a message with subject or body 'help' to nut-upsuser-requ...@lists.alioth.debian.org You can reach the person managing the list at nut-upsuser-ow...@lists.alioth.debian.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Nut-upsuser digest..." Today's Topics: 1. problem with a script via upssched-cmd (Sabine GOUDARD) ---------------------------------------------------------------------- Message: 1 Date: Thu, 18 Apr 2013 12:42:22 +0200 From: Sabine GOUDARD <sabine.goud...@st-etienne.archi.fr> To: nut <nut-upsuser@lists.alioth.debian.org> Subject: [Nut-upsuser] problem with a script via upssched-cmd Message-ID: <c6fe5e18191a991d7c44a90e91cec...@mail.st-etienne.archi.fr> Content-Type: text/plain; charset="utf-8" Hello I'm running a script via upssched on a onbatt event, I want to sent a email, shutdown a windows server and shutdown an ubuntu server When I run my script manually, all is ok but via upssched-cmd it return "exec_cmd returned 255" here is the script #!/bin/bash # send mail to admin echo "ECO" | mail -s "ARRET SERVEURS NON PRIORITAIRES" m...@domaine.fr net rpc shutdown -f -I ip_windows -U login%passwd ssh login@ip_ubuntu sudo shutdown -h now If I run only this cde net rpc shutdown -f -I ip_windows -U login%passwd it's ok if I run only this cde ssh login@ip_ubuntu sudo /sbin/shutdown -h now I have returned 255 Is someone can help me Thanks a lot -- Sabine Goudard Service Informatique et Multim?dia T?l : 04 77 42 37 20 Ecole Nationale Sup?rieure d?Architecture de Saint-?tienne 1, rue Buisson BP 94 42003 Saint-?tienne Cedex 1 Fax : 04 77 42 35 40 [http://www.st-etienne.archi.fr -> http://www.st-etienne.archi.fr] -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20130418/6c609ff1/attachment-0001.html> ------------------------------ _______________________________________________ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser End of Nut-upsuser Digest, Vol 94, Issue 18 ******************************************* _______________________________________________ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser