[Nut-upsdev] UPS shutdown
Jim Klimov
jim at cos.ru
Tue Aug 30 12:48:05 UTC 2016
30 августа 2016 г. 12:52:58 CEST, Neetish Bhat <neetishbhat at gmail.com> пишет:
>Hi All,
>
>I'm trying to shutdown my UPS using NUT driver version
>upsdrvctl -V
>Network UPS Tools - UPS driver controller* 1.01-906.*
>
>My UPS details are the following :
>
>battery.charge: 100
>battery.charge.low: 5
>battery.charge.warning: 50
>battery.runtime: 22980
>battery.runtime.low: 120
>battery.type: PbAc
>battery.voltage: 26.8
>battery.voltage.nominal: 24.0
>*device.mfr: American Power Conversion*
>*device.model: Smart-UPS 500*
>device.serial: J11443120206
>device.type: ups
>driver.flag.ignorelb: enabled
>driver.name: usbhid-ups
>driver.parameter.pollfreq: 30
>driver.parameter.pollinterval: 2
>driver.parameter.port: auto
>driver.version: 1.01-901
>driver.version.data: APC HID 0.95
>driver.version.internal: 0.37
>ups.beeper.status: enabled
>ups.delay.shutdown: 20
>*ups.firmware: UPS 08.8 / ID=18*
>ups.mfr: American Power Conversion
>ups.mfr.date: 2014/10/21
>ups.model: Smart-UPS 500
>ups.productid: 0003
>ups.serial: J11443120206
>ups.status: OB DISCHRG
>ups.timer.reboot: -1
>ups.timer.shutdown: -1
>ups.vendorid: 051d
>
>
>The problem is when I want to run this command
>
>*upsdrvctl -u root shutdown*
>
>
>this I suppose should shutdown the UPS which is not happening at all.
>
>When i run *dmesg*
>I get the following output usb 2-1: usbfs: process 4079 (usbhid-ups)
>did
>not claim interface 0 before use
>
>
>I also ran strace with the command to see the output.
>
>
>Following is the Strace Output
>
> strace upsdrvctl -u root shutdown
>execve("/usr/bin/upsdrvctl", ["upsdrvctl", "-u", "root", "shutdown"],
>[/* 8
>vars */]) = 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x76f87000
>stat("/etc/ld.so.cache", 0x7ee94ab0) = -1 ENOENT (No such file or
>directory)
>open("/lib/libm.so.0", O_RDONLY) = 3
>fstat(3, {st_mode=S_IFREG|0755, st_size=37860, ...}) = 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x76f86000
>read(3,
>"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\10\24\0\0004\0\0\0"...,
>4096) = 4096
>mmap2(NULL, 73728, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>0x76f69000
>mmap2(0x76f69000, 34352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3,
>0)
>= 0x76f69000
>mmap2(0x76f79000, 4176, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
>0x8) = 0x76f79000
>close(3) = 0
>munmap(0x76f86000, 4096) = 0
>open("/lib/libpthread.so.0", O_RDONLY) = 3
>fstat(3, {st_mode=S_IFREG|0755, st_size=71540, ...}) = 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x76f86000
>read(3,
>"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\20D\0\0004\0\0\0"...,
>4096)
>= 4096
>mmap2(NULL, 114688, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>0x76f4d000
>mmap2(0x76f4d000, 65968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3,
>0)
>= 0x76f4d000
>mmap2(0x76f65000, 4540, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
>0x10) = 0x76f65000
>mmap2(0x76f67000, 4732, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76f67000
>close(3) = 0
>munmap(0x76f86000, 4096) = 0
>open("/lib/libc.so.0", O_RDONLY) = 3
>fstat(3, {st_mode=S_IFREG|0755, st_size=614076, ...}) = 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x76f86000
>read(3,
>"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0000\265\0\0004\0\0\0"...,
>4096) = 4096
>mmap2(NULL, 667648, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>0x76eaa000
>mmap2(0x76eaa000, 607220, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
>3, 0)
>= 0x76eaa000
>mmap2(0x76f46000, 5340, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
>0x94) = 0x76f46000
>mmap2(0x76f48000, 19688, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76f48000
>close(3) = 0
>munmap(0x76f86000, 4096) = 0
>open("/lib/libc.so.0", O_RDONLY) = 3
>fstat(3, {st_mode=S_IFREG|0755, st_size=614076, ...}) = 0
>close(3) = 0
>open("/lib/libdl.so.0", O_RDONLY) = 3
>fstat(3, {st_mode=S_IFREG|0755, st_size=9308, ...}) = 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x76f86000
>read(3,
>"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`\n\0\0004\0\0\0"...,
>4096)
>= 4096
>mmap2(NULL, 45056, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
>0x76e9f000
>mmap2(0x76e9f000, 7280, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3,
>0) =
>0x76e9f000
>mmap2(0x76ea8000, 4240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
>0x1) = 0x76ea8000
>close(3) = 0
>munmap(0x76f86000, 4096) = 0
>open("/lib/libc.so.0", O_RDONLY) = 3
>fstat(3, {st_mode=S_IFREG|0755, st_size=614076, ...}) = 0
>close(3) = 0
>open("/lib/libc.so.0", O_RDONLY) = 3
>fstat(3, {st_mode=S_IFREG|0755, st_size=614076, ...}) = 0
>close(3) = 0
>stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=25412, ...})
>= 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
>MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x76f86000
>set_tls(0x76f86320, 0x76f869c0, 0x76f869c8, 0x76f86320, 0x76f88f7c) = 0
>mprotect(0x76f79000, 4096, PROT_READ) = 0
>mprotect(0x76f65000, 4096, PROT_READ) = 0
>mprotect(0x76f46000, 4096, PROT_READ) = 0
>mprotect(0x76ea8000, 4096, PROT_READ) = 0
>mprotect(0x76f88000, 4096, PROT_READ) = 0
>set_tid_address(0x76f86068) = 2936
>set_robust_list(0x76f86070, 0xc) = 0
>rt_sigaction(SIGRTMIN, {0x76f568e8, [], SA_SIGINFO|0x4000000}, NULL, 8)
>= 0
>rt_sigaction(SIGRT_1, {0x76f56794, [],
>SA_RESTART|SA_SIGINFO|0x4000000},
>NULL, 8) = 0
>rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
>getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) =
>0
>ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo
>...}) = 0
>ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo
>...}) = 0
>write(1, "Network UPS Tools - UPS driver c"..., 51Network UPS Tools -
>UPS
>driver controller 1.01-900
>) = 51
>brk(0) = 0x15000
>brk(0x16000) = 0x16000
>open("/usr/etc/ups.conf", O_RDONLY) = 3
>ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7ee9487c) = -1 ENOTTY
>(Inappropriate ioctl for device)
>brk(0x17000) = 0x17000
>read(3, "[ups_genric]\ndriver = usbhid-ups"..., 4096) = 86
>read(3, "", 4096) = 0
>close(3) = 0
>clone(child_stack=0,
>flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
>child_tidptr=0x76f86068) = 2937
>rt_sigaction(SIGALRM, {0x91b8, [], 0x4000000 /* SA_??? */}, NULL, 8) =
>0
>setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={45, 0}},
>{it_interval={0, 0}, it_value={0, 0}}) = 0
>wait4(2937, Network UPS Tools - Generic HID driver 0.37 (1.01-900)
>USB communication driver 0.32
>Using subdriver: APC HID 0.95
>Initiating UPS shutdown
>[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2937
>--- SIGCHLD (Child exited) @ 0 (0) ---
>setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={0, 0}},
>{it_interval={0, 0}, it_value={44, 129152}}) = 0
>exit_group(0) = ?
>
>
>
>
>
>Please help me to debug this.
The 'ups.timer.shutdown: -1' looks suspicious - maybe it means the commanded shutdown is not enabled on the device. Try to set it to a positive number (may be secs or minutes depending on device) with 'upsrw' and/or 'upscmd' first.
Hope this helps,
Jim
--
Typos courtesy of K-9 Mail on my Samsung Android
More information about the Nut-upsdev
mailing list