|
Hello and thanks in advance for any help/tips. I am
still new to nut but thanks to help here, I have managed to get my
Ubuntu (chrooted on Android) to run both nut-server and nut-client
without obvious complaints. So now I am trying to move on to
getting the desired results when the UPS goes and stays on battery
for at least 20 seconds. After looking here
<https://networkupstools.org/docs/user-manual.chunked/ar01s07.html>
I am taking the simple approach - where my own script. Salient
lines from the upsmon.conf are: NOTIFYCMD? /home/android/nutShutdown.sh NOTIFYMSG? ONBATT? "USP %s on battery" NOTIFYFLAG? ONBATT? EXEC The script file is rwx for all. So I do not think this is a permission issue (but certainly could be wrong). When I pull the battery nothing at all seems to happen. From an ssh terminal into the nut machine I can see the status go from O: to OB using upsc. But the script does not seem to get run. If I stop the nut-client service and instead run: ? /sbin/upsmon -DD (just from my logged in, non-priv user) I see the following: Network UPS Tools upsmon 2.7.1 ?? 0.000000???? fopen /var/run/nut/upsmon.pid: Permission denied ?? 0.002205???? UPS: belkinusb@localhost (master) (power value 1) ?? 0.004246???? Using power down flag file /etc/killpower ?? 0.006807???? debug level is '2' ?? 0.011487???? writepid: fopen /var/run/nut/upsmon.pid: Permission denied ?? 0.000000???? Init SSL without certificate database ?? 0.020224???? Trying to connect to UPS [belkinusb@localhost] ?? 0.023170???? Logged into UPS belkinusb@localhost ?? 0.023848???? pollups: belkinusb@localhost ?? 0.024349???? parse_status: [OL] ?? 5.024659???? pollups: belkinusb@localhost ?? 5.026220???? parse_status: [OL] ? 10.026791???? pollups: belkinusb@localhost ? 10.028193???? parse_status: [OL] ? 15.028838???? pollups: belkinusb@localhost ? 15.030312???? parse_status: [OL] ? 20.030886???? pollups: belkinusb@localhost ? 20.032332???? parse_status: [OL] ? 25.032913???? pollups: belkinusb@localhost ? 25.034352???? parse_status: [OL] ? 30.034942???? pollups: belkinusb@localhost ? 30.036362???? parse_status: [OB] ? 30.036722???? do_notify: ntype 0x0001 (ONBATT) ? 35.038787???? pollups: belkinusb@localhost ? 35.040404???? parse_status: [OB] ? 40.040951???? pollups: belkinusb@localhost ? 40.042425???? parse_status: [OB] ? 45.042959???? pollups: belkinusb@localhost ? 45.044429???? parse_status: [OB] ? 50.044987???? pollups: belkinusb@localhost ? 50.046388???? parse_status: [OB] Init SSL without certificate database SSHDroid Use 'root' as username Default password is 'admin' Broadcasting: Intent { act=net.dinglisch.android.tasker.ACTION_TASK (has extras) } Broadcast completed: result=0 Host key verification failed. ? 55.046956???? pollups: belkinusb@localhost ? 55.048372???? parse_status: [OB] ? 60.049089???? pollups: belkinusb@localhost ? 60.050535???? parse_status: [OB] ? 65.051094???? pollups: belkinusb@localhost ? 65.052528???? parse_status: [OB] ? 70.053080???? pollups: belkinusb@localhost ? 70.054476???? parse_status: [OB] ? 75.055163???? pollups: belkinusb@localhost ? 75.056574???? parse_status: [OB] ? 80.057116???? pollups: belkinusb@localhost ? 80.058570???? parse_status: [OB] ? 85.059128???? pollups: belkinusb@localhost ? 85.060598???? parse_status: [OB] ? 90.061145???? pollups: belkinusb@localhost ? 90.062614???? parse_status: [OL] ? 90.063042???? do_notify: ntype 0x0000 (ONLINE) ? 90.063510???? UPS belkinusb@localhost on line power Broadcast Message from android@loca ??????? (/dev/pts/3) at 12:40 ... UPS belkinusb@localhost on line power ? 95.065644???? pollups: belkinusb@localhost ? 95.067137???? parse_status: [OL] ?100.067768???? pollups: belkinusb@localhost ?100.069213???? parse_status: [OL] ?105.069749???? pollups: belkinusb@localhost ?105.071212???? parse_status: [OL] ?110.071787???? pollups: belkinusb@localhost ?110.073226???? parse_status: [OL] ?115.073777???? pollups: belkinusb@localhost ?115.075471???? parse_status: [OL] ?120.076043???? pollups: belkinusb@localhost ?120.077450???? parse_status: [OL] ?125.078037???? pollups: belkinusb@localhost ?125.079492???? parse_status: [OL] After line 50.046388?I am seeing output from my script. So at least in this scenario, things appear to be working. Yet with service nut-client start'ed this doesn't seem to happen. Using: ??? ps -ef | grep nut I see entries for the blazer_usb driver, /sbin/upsd, and sbin/upsmon. They are all running as user: ? nut So I immediately thought to check permissions on the script file and, as said above, they are rwx all. So I doubt this is the problem. Any thoughts/comments? Cheers |
_______________________________________________ Nut-upsuser mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser
