[Nut-upsuser] upsd.conf - run as user option

Charles Lepple clepple at gmail.com
Thu Jun 19 13:03:25 UTC 2014

On Jun 18, 2014, at 1:51 PM, Mike. <the.lists at mgm51.com> wrote:

> The upsmon.conf has the option of setting   RUN_AS_USER username 
> Might it be possible to add a similar option to the upsd.conf file?
> I see the -u command-line option for both upsmon and upsd, however,
> upsd doesn't seem to carry that to the configuration file, as upsmon
> does.

I'll admit this does seem arbitrary, but based on a quick look at the upsd source code, the userid is looked up before the configuration file is read, and there is a chroot() in between those statements. So this will require some more investigation to see what assumptions are being made about the userid when the configuration file is processed.

I hadn't noticed this until now, since most distributions tend to have a way to pass in options to their daemons (such as /etc/nut/nut.conf on Debian/Ubuntu). What we may want to do is add some comments to nut.conf for passing "-u user" in UPSD_OPTIONS. (It's in the man page for nut.conf, though.)

Charles Lepple
clepple at gmail

More information about the Nut-upsuser mailing list