I used strace and the result is bus is busy: clock_gettime(CLOCK_MONOTONIC, {8158, 708518222}) = 0 timerfd_settime(11, TFD_TIMER_ABSTIME, {it_interval={0, 0}, it_value={8159, 708518000}}, NULL) = 0 ioctl(12, USBDEVFS_SUBMITURB, 0x40810) = 0 poll([{fd=7, events=POLLIN}, {fd=9, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLOUT}], 4, 60000) = 1 ([{fd=12, revents=POLLOUT}]) ioctl(12, USBDEVFS_REAPURBNDELAY, 0xbecf8f24) = 0 timerfd_settime(11, 0, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 ioctl(12, USBDEVFS_REAPURBNDELAY, 0xbecf8f24) = -1 EAGAIN (Resource temporarily unavailable) clock_gettime(CLOCK_MONOTONIC, {8158, 735783474}) = 0 timerfd_settime(11, TFD_TIMER_ABSTIME, {it_interval={0, 0}, it_value={8159, 735783000}}, NULL) = 0 ioctl(12, USBDEVFS_SUBMITURB, 0x40810) = 0 poll([{fd=7, events=POLLIN}, {fd=9, events=POLLIN}, {fd=11, events=POLLIN}, {fd=12, events=POLLOUT}], 4, 60000) = 1 ([{fd=12, revents=POLLOUT}]) ioctl(12, USBDEVFS_REAPURBNDELAY, 0xbecf8f24) = 0 timerfd_settime(11, 0, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 ioctl(12, USBDEVFS_REAPURBNDELAY, 0xbecf8f24) = -1 EAGAIN (Resource temporarily unavailable) ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource busy) ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource busy) ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource busy) ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource busy) ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 writev(2, [{"Can't claim USB device [0463:fff"..., 62}, {NULL, 0}], 2Can't claim USB device [0463:ffff]: No such file or directory ) = 62 exit_group(1) = ? +++ exited with 1 +++ Why? My ups is: [qnapups] driver = usbhid-ups port = auto desc = Eaton 5SC 500i vendorid = 0463* serial = G131F50027 synchronous = no pollonly pollfreq = 10 nolock -----Original Message----- From: icingaj at gmail.com <icingaj at gmail.com> Sent: Monday, July 2, 2018 8:40 AM To: 'nut-upsuser at alioth-lists.debian.net' <nut-upsuser at alioth-lists.debian.net> Cc: 'icingaj at gmail.com' <icingaj at gmail.com> Subject: No run cmd /usbhid-ups -k ! Sorry i forgot send info from: # /lib/nut/usbhid-ups -DD -x explore -a qnapups &> usbhid-ups.debug.log Thx Jan.
On Jul 2, 2018, at 9:02 AM, icingaj at gmail.com wrote:> > ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource busy) > ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 > writev(2, [{"Can't claim USB device [0463:fff"..., 62}, {NULL, 0}], 2Can't > claim USB device [0463:ffff]: No such file or directory > ) = 62 > exit_group(1) = ? > +++ exited with 1 +++ > > Why?did you see this reply? https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-July/011147.html if that does not change the strace output, how is your OS launching the NUT driver? Are the startup scripts in a repository somewhere? (if you aren't getting replies, you can check if you are subscribed here: https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser )
> -----Original Message----- > From: Charles Lepple <clepple at gmail.com> > Sent: Monday, July 2, 2018 3:16 PM > To: icingaj at gmail.com > Cc: nut-upsuser at alioth-lists.debian.net > Subject: Re: [Nut-upsuser] No run cmd /usbhid-ups -k ! > > On Jul 2, 2018, at 9:02 AM, icingaj at gmail.com wrote: > > > > ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource > > busy) ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 writev(2, [{"Can't > > claim USB device [0463:fff"..., 62}, {NULL, 0}], 2Can't claim USB > > device [0463:ffff]: No such file or directory > > ) = 62 > > exit_group(1) = ? > > +++ exited with 1 +++ > > > > Why? > > did you see this reply? > >https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-July/011147.html> > if that does not change the strace output, how is your OS launching theNUT> driver? Are the startup scripts in a repository somewhere? > > (if you aren't getting replies, you can check if you are subscribed here: > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser )I kill the previous usbhid-ups and run usbhid-ups -k -DD. The log is: 5.401723 Initiating UPS shutdown 5.401852 upsdrv_shutdown ... 5.401974 instcmd (shutdown.return, [NULL]) 5.402133 find_nut_info: unknown info type: shutdown.return 5.402290 setvar (ups.start.auto, yes) 5.431000 instcmd (load.on.delay, 30) 5.467001 instcmd (load.off.delay, 20) 5.503049 upsdrv_cleanup ... "usbhid-ups -k" does not have a network connection to UPS nothing happened.
> -----Original Message----- > From: Charles Lepple <clepple at gmail.com> > Sent: Monday, July 2, 2018 3:16 PM > To: icingaj at gmail.com > Cc: nut-upsuser at alioth-lists.debian.net > Subject: Re: [Nut-upsuser] No run cmd /usbhid-ups -k ! > > On Jul 2, 2018, at 9:02 AM, icingaj at gmail.com wrote: > > > > ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource > > busy) ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 writev(2, [{"Can't > > claim USB device [0463:fff"..., 62}, {NULL, 0}], 2Can't claim USB > > device [0463:ffff]: No such file or directory > > ) = 62 > > exit_group(1) = ? > > +++ exited with 1 +++ > > > > Why? > > did you see this reply? > >https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-July/011147.html> > if that does not change the strace output, how is your OS launching theNUT> driver? Are the startup scripts in a repository somewhere? > > (if you aren't getting replies, you can check if you are subscribed here: > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser )Thank you for advices all. I'm going to find out how to do with UPS. Please do not know how to write some parameters permanently to UPS? Thx.
> On Jul 2, 2018, at 9:02 AM, icingaj at gmail.com wrote: > > > > ioctl(12, USBDEVFS_CLAIMINTERFACE, 0xbecf910c) = -1 EBUSY (Resource > > busy) ioctl(12, USBDEVFS_GETDRIVER, 0xbecf9024) = 0 writev(2, [{"Can't > > claim USB device [0463:fff"..., 62}, {NULL, 0}], 2Can't claim USB > > device [0463:ffff]: No such file or directory > > ) = 62 > > exit_group(1) = ? > > +++ exited with 1 +++ > > > > Why? > > did you see this reply? > >https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-July/011147.html> > if that does not change the strace output, how is your OS launching theNUT> driver? Are the startup scripts in a repository somewhere? > > (if you aren't getting replies, you can check if you are subscribed here: > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser )I have UPS Eaton 5SC 500. I tested three solutions: 1. swap usbhid-ups -a qnapups with usbhid-ups -a qnapups -k Result: server shutdown UPS not. 2. run upsmon -c fsd Result: server shutdown UPS not. 3. run upscmd -u admin -p 123456 qnapups shutdown.return and next shutdown Result: server shutdown UPS shutdown. After starting the UPS, immediately the UPS is switched on. The UPS was supposed to wait ups.delay.start time and then turned on. I set in rc.local this parameters for UPS: Set with upsrw: ups.delay.shutdown=60 Set with upsrw: ups.delay.start=90 Set with upsrw: ups.start.auto=no Set with upsrw: ups.start.auto=no Set with upsrw: ups.start.battery=no Set with upsrw: ups.start.reboot=no Please do not know how to write some parameters permanently to UPS? Sorry but I'm not working with Mailing lists! Thx Jan.