<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Gents,<div><br></div><div>Thanks, yes definitely a permissions problem. Roger pointed me in the correct direction with the command to add logging for the script. I have the shutdown working now but need to tighten up the permissions. Not too sure where to start with assigning the correct permissions.</div><div><br></div><div>Cheers,</div><div><br></div><div>James<br><br><div>> Date: Mon, 27 Apr 2015 21:25:45 +0100<br>> From: neil@dana.org.uk<br>> To: nut-upsuser@lists.alioth.debian.org<br>> Subject: Re: [Nut-upsuser] upssched setup<br>> <br>> Hi,<br>> <br>> The exec is returning 126 - "Command invoked cannot execute. A <br>> permission or command not executable problem.".<br>> <br>> Are you sure that the script is executable by the user running NUT?  Do <br>> you have SELinux enabled?<br>> <br>> Regards,<br>> <br>> <br>> Neil.<br>> <br>> On 27/04/15 20:55, James Hammond wrote:<br>> > Hi Roger,<br>> ><br>> > I get:<br>> ><br>> > Apr 27 20:50:05 unifi upsmon[1022]: UPS ups on battery<br>> > Apr 27 20:50:05 unifi upssched[2688]: Timer daemon started<br>> > Apr 27 20:50:06 unifi upssched[2688]: New timer: onbatt (20 seconds)<br>> > Apr 27 20:50:26 unifi upssched[2688]: Event: onbatt<br>> > Apr 27 20:50:26 unifi upssched[2688]: exec_cmd(/sbin/upssched-cmd.sh<br>> > onbatt) returned 126<br>> > Apr 27 20:50:41 unifi upssched[2688]: Timer queue empty, exiting<br>> ><br>> ><br>> > /etc/nut/upssched.conf<br>> ><br>> > CMDSCRIPT /sbin/upssched-cmd.sh<br>> > PIPEFN /etc/nut/upssched/upssched.pipe<br>> > LOCKFN /etc/nut/upssched/upssched.lock<br>> > AT ONBATT * START-TIMER onbatt 20<br>> > AT ONLINE * CANCEL-TIMER onbatt<br>> ><br>> > /sbin/upssched-cmd.sh<br>> ><br>> > #!/bin/sh<br>> > # Debugging: Log all calls to this script<br>> > logger -t upssched-cmd.sh Calling upssched-cmd.sh $1<br>> >   case $1 in<br>> >     onbatt)<br>> >       /sbin/upsmon -c fsd;;<br>> >     *)<br>> >       echo "shutdown implemented";;<br>> >   esac<br>> ><br>> > Any help gratefully received as this has got me beat..... Most files<br>> > have been chmod to 777 with no difference.<br>> ><br>> > Cheers,<br>> ><br>> > James<br>> ><br>> >  > Date: Mon, 27 Apr 2015 16:04:34 +0200<br>> >  > From: roger@rogerprice.org<br>> >  > To: nut-upsuser@lists.alioth.debian.org<br>> >  > Subject: Re: [Nut-upsuser] upssched setup<br>> >  ><br>> >  > On Mon, 27 Apr 2015, James Hammond wrote:<br>> >  ><br>> >  > > Roger, I did and it didnt work.<br>> >  ><br>> >  > Aha!, what does your upssched.conf look like? If you add the lines:<br>> >  ><br>> >  > # Debugging: Log all calls to this script<br>> >  > logger -t upssched-cmd.sh Calling upssched-cmd.sh $1<br>> >  ><br>> >  > to your /sbin/upssched-cmd.sh , what is reported if anything when it<br>> >  > doesn't work? Cheers, Roger<br>> >  ><br>> >  > _______________________________________________<br>> >  > Nut-upsuser mailing list<br>> >  > Nut-upsuser@lists.alioth.debian.org<br>> >  > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser<br>> ><br>> ><br>> > _______________________________________________<br>> > Nut-upsuser mailing list<br>> > Nut-upsuser@lists.alioth.debian.org<br>> > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser<br>> ><br>> <br>> <br>> _______________________________________________<br>> Nut-upsuser mailing list<br>> Nut-upsuser@lists.alioth.debian.org<br>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser<br></div></div>                                          </div></body>
</html>