[Nut-upsdev] "upsdrvctl shutdown" ignores "-u"
selinger at mathstat.dal.ca
Sat Jan 12 03:52:21 UTC 2008
it seems to me that "upsdrvctl shutdown" fails to pass the "-u" flag to
the driver. See drivers/upsdrvctl.c:shutdown_driver(), and compare to
start_driver() in the same file. This has been so since ancient
history (I checked back to 1.5.0), so there must be a reason, but I
can't think of any.
I have a good reason for passing "-u root": at the time the shutdown
script reaches power-off, most file systems, including the USB
filesystem, have been unmounted. One must remount the USB filesystem
to access the UPS. But at that point, hotplugging can't be relied
upon, and therefore I would like to run the driver as root.
The reason I didn't notice this problem before is that I always called
the driver directly, rather than upsdrvctl. But that would not be the
case in a standard installation.
Moreover, this problem is hard to debug without reading the source
code, because -DD prints out a made-up command line, rather than the
one actually used.
Any objections to fixing this?
More information about the Nut-upsdev