<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=big5" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.23562">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2><FONT size=3>Good Day Roger Price<BR><BR>AA. Hi, Normally one 
would expect the UPS to disconnect it's power outlets<BR>after the default 
ups.delay.shutdown = 20 seconds.<BR><BR>==> I got it. I tried to command 
"upsdrvctl shutdown" on both line-mode and <BR>battery-mode<BR><BR>==> But 
ups do not disconnect its outlets 
power<BR><BR><BR>-----------------------------------------------------------------------------------<BR>BB. 
Could you show us the output of command "upsc pcmups"?<BR><BR>==> Yes. Below 
2 mode were the outputs of command "upsc pcmups"<BR><BR>B1. Battery 
Mode<BR>dinow-All-Series:/etc/nut$ upsc pcmups<BR>Init SSL without certificate 
database<BR>battery.charge: 100<BR>battery.charge.low: 
10<BR>battery.charge.warning: 30<BR>battery.date: 2010/12/20<BR>battery.runtime: 
784<BR>battery.type: PbAc<BR>device.mfr: POWERCOM Co.,LTD<BR>device.model: HID 
UPS Battery<BR>device.serial: 004-0D9F-000<BR>device.type: ups<BR>driver.name: 
usbhid-ups<BR>driver.parameter.pollfreq: 30<BR>driver.parameter.pollinterval: 
2<BR>driver.parameter.port: auto<BR>driver.version: 
2.7.1<BR>driver.version.data: PowerCOM HID 0.4<BR>driver.version.internal: 
0.38<BR>input.frequency: 0.0<BR>input.voltage: 0.0<BR>input.voltage.nominal: 
120<BR>output.frequency: 0.0<BR>output.voltage: 120.0<BR>output.voltage.nominal: 
120<BR>ups.date: 2010/12/20<BR>ups.delay.shutdown: 20<BR>ups.delay.start: 
60<BR>ups.load: 4<BR>ups.mfr: POWERCOM Co.,LTD<BR>ups.model: HID UPS 
Battery<BR>ups.productid: 0004<BR>ups.serial: 004-0D9F-000<BR>ups.status: OB 
DISCHRG<BR>ups.test.result: Done and passed<BR>ups.timer.shutdown: 
120<BR>ups.timer.start: 740160<BR>ups.vendorid: 0d9f<BR><BR><BR>B2. Nomal 
Mode<BR>dinow-All-Series:/etc/nut$ upsc pcmups<BR>Init SSL without certificate 
database<BR>battery.charge: 100<BR>battery.charge.low: 
100<BR>battery.charge.warning: 30<BR>battery.date: 
2010/12/20<BR>battery.runtime: 800<BR>battery.type: PbAc<BR>device.mfr: POWERCOM 
Co.,LTD<BR>device.model: HID UPS Battery<BR>device.serial: 
004-0D9F-000<BR>device.type: ups<BR>driver.name: 
usbhid-ups<BR>driver.parameter.pollfreq: 30<BR>driver.parameter.pollinterval: 
2<BR>driver.parameter.port: auto<BR>driver.version: 
2.7.1<BR>driver.version.data: PowerCOM HID 0.4<BR>driver.version.internal: 
0.38<BR>input.frequency: 59.0<BR>input.voltage: 111.0<BR>input.voltage.nominal: 
120<BR>output.frequency: 59.0<BR>output.voltage: 
120.0<BR>output.voltage.nominal: 120<BR>ups.date: 
2010/12/20<BR>ups.delay.shutdown: 20<BR>ups.delay.start: 60<BR>ups.load: 
5<BR>ups.mfr: POWERCOM Co.,LTD<BR>ups.model: HID UPS Battery<BR>ups.productid: 
0004<BR>ups.serial: 004-0D9F-000<BR>ups.status: OL<BR>ups.test.result: Done and 
passed<BR>ups.timer.shutdown: 0<BR>ups.timer.start: 755760<BR>ups.vendorid: 
0d9f<BR><BR><BR><BR>-----------------------------------------------------------------------------------<BR>CC. 
Once the command "upsdrvctl shutdown" works, you will need to 
<BR>incorporate<BR>it in your shutdown process.<BR><BR>==> I got 
it<BR><BR><BR>NUT 2.7.4 includes file .../scripts/systemd/nutshutdown . Does 
Ubunti <BR>install this?<BR><BR>==> Yes. Ubuntu haved installed this as below 
contents<BR><BR>dinow-All-Series:/lib/systemd/system-shutdown$ cat 
nutshutdown<BR>#!/bin/sh<BR>/sbin/upsmon -K >/dev/null 2>&1 && 
/sbin/upsdrvctl 
shutdown<BR><BR><BR>-----------------------------------------------------------------------------------<BR>DD. 
Does wall successfully notify the users on an Ubuntu system?   If you 
<BR>type<BR><BR>    echo "Hello from wall" | wall<BR><BR>do the 
users of Gnome, KDE, LXDE, LightDM etc see the message?<BR><BR>==> Yes. I 
used the putty and got below 3 messages<BR>(Battery Power / Power Resotre / and 
type commands directly)<BR><BR><BR>D1. Broadcast Message from 
dinow-Al<BR>        (somewhere) at 10:59 
...<BR><BR>UPS </FONT><A href=""><FONT size=3>pcmups@localhost</FONT></A><FONT 
size=3> on battery<BR><BR><BR>D2. Broadcast Message from 
dinow-Al<BR>        (somewhere) at 11:00 
...<BR><BR>UPS </FONT><A href=""><FONT size=3>pcmups@localhost</FONT></A><FONT 
size=3> on line power<BR><BR><BR>D3. Broadcast Message from 
dinow-Al<BR>        (/dev/pts/0) at 11:02 
...<BR><BR>Hello from 
wall<BR><BR><BR>-----------------------------------------------------------------------------------<BR><BR>EE. 
Perhaps the BSD syntax doesn't work on Debian, ps -elf | grep 
-E<BR>"nut|upsd|upsmon" would have been better.<BR><BR>==> 
dinow-All-Series:/etc/nut$ ps -elf|grep -E "nut|upsd|upsmon"<BR><BR>1 S 
root      1010     1  0  
80   0 -  9421 -      11:09 
?        00:00:00 <BR>/sbin/upsmon<BR>5 S 
nut       1012  1010  0  
80   0 - 11335 -      11:09 
?        00:00:00 <BR>/sbin/upsmon<BR>1 S 
nut       1065     1  
0  80   0 -  4324 -      11:09 
?        00:00:00 <BR>/lib nut/usbhid-ups -a 
pcmups<BR>1 S nut       
1067     1  0  80   0 -  9424 
-      11:09 
?        00:00:00 <BR>/sbin/upsd<BR>4 S 
root      2199     1  0  
80   0 - 19215 -      11:10 
?        00:00:00 <BR>/usr/sbin/cupsd -f<BR>0 
S dinow     2447  2395  0  80   0 
-  3989 pipe_w 11:11 pts/2    00:00:00 <BR>grep --color=auto 
-E 
nut|upsd|upsmon<BR><BR><BR>-----------------------------------------------------------------------------------<BR>FF. 
I will make a note for next time.<BR><BR>==> Deep Appreciation for your 
reply<BR><BR><BR><BR>If you have any questions, please don't hesitate to inform 
us.<BR>Sincerely yours, May. 16th<BR>Dinow Hsieh<BR>----- Original Message ----- 
<BR>From: "Roger Price" <</FONT><A href=""><FONT 
size=3>roger@rogerprice.org</FONT></A><FONT size=3>><BR>To: "nut-upsuser 
Mailing List" <</FONT><A href=""><FONT 
size=3>nut-upsuser@lists.alioth.debian.org</FONT></A><FONT size=3>><BR>Sent: 
Monday, May 15, 2017 6:06 PM<BR>Subject: Re: [Nut-upsuser] Fw: [Nut-upsdev] 
POWERCOM-UPS-USB : UPS Shutdown<BR><BR><BR>> On Mon, 15 May 2017, Dinow Hsieh 
wrote:<BR>><BR>>> ==> I have tried this command "upsdrvctl shutdown" 
as below results <BR>>> (However the UPS still sustain the 
power)<BR>>><BR>>> Network UPS Tools - UPS driver controller 
2.7.1<BR>>> Network UPS Tools - Generic HID driver 0.38 
(2.7.1)<BR>>> USB communication driver 0.32<BR>>> Using subdriver : 
PowerCOM HID 0.4<BR>>> Initiating UPS shutdown<BR>><BR>> Hi, 
Normally one would expect the UPS to disconnect it's power outlets<BR>> after 
the default ups.delay.shutdown = 20 seconds.  Could you show us the<BR>> 
output of command "upsc pcmups"?<BR>><BR>>> CC. Do you have a script in 
a systemd system-shutdown directory which <BR>>> calls<BR>>> 
"upsdrvctl shutdown" ?<BR>>><BR>>> ==> No<BR>><BR>> Once 
the command "upsdrvctl shutdown" works, you will need to incorporate<BR>> it 
in your shutdown process.  NUT 2.7.4 includes file<BR>> 
.../scripts/systemd/nutshutdown . Does Ubunti install 
this?<BR>><BR>>  >   5. File = notifycmd<BR>>  
>   #!/bin/bash<BR>>  >   #<BR>>  
>   # NUT NOTIFYCMD script<BR>>  >   
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin<BR>>  
>   trap "exit 0" SIGTERM<BR>>  >   if [ 
"$NOTIFYTYPE" = "ONLINE" ]<BR>>  >   then<BR>>  
>       echo $0: power restored | 
wall<BR>><BR>> Does wall successfully notify the users on an Ubuntu 
system?   If you type<BR>><BR>>    echo "Hello 
from wall" | wall<BR>><BR>> do the users of Gnome, KDE, LXDE, LightDM etc 
see the message?<BR>><BR>>> fi 6. File =upssched.conf<BR>>> 
CMDSCRIPT /bin/upssched-cmd<BR>>> PIPEFN 
/var/run/nut/upssched/upssched.pipe<BR>>> LOCKFN 
/var/run/nut/upssched/upssched.lock<BR>><BR>> It doesn't look as if 
upssched will be called, since your NOTIFYCMD is<BR>> pointing to your script 
and not upssched.  So upssched.conf will not be<BR>> 
used.<BR>><BR>>> BB. What does command "ps aux | grep ups" 
report?<BR>>><BR>>> ==> Yes. Below is the concise 
result<BR>>> ...<BR>>> nut /lib/nut/usbhid-ups -a pcmups<BR>>> 
nut upsd<BR>>> root upsmon<BR>>> nut upsmon<BR>><BR>> Perhaps 
the BSD syntax doesn't work on Debian, ps -elf | grep -E<BR>> 
"nut|upsd|upsmon" would have been better.  I will make a note for 
next<BR>> time.<BR>><BR>> 
Roger<BR><BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>> 
_______________________________________________<BR>> Nut-upsuser mailing 
list<BR>> </FONT><A href=""><FONT 
size=3>Nut-upsuser@lists.alioth.debian.org</FONT></A><BR><FONT size=3>> 
</FONT><A href=""><FONT 
size=3>http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser</FONT></A><FONT 
size=3> </FONT><BR></FONT></DIV></BODY></HTML>