[Nut-upsdev] problem with NOTIFYCMD
Charles Lepple
clepple at gmail.com
Mon Sep 21 23:03:09 UTC 2015
On Sep 21, 2015, at 5:23 PM, John Hart <jsamcr at gmail.com> wrote:
>
> After some testing, I notice that my NOTIFYCMD script seems to work if I call it as user 'john' (that's me) but if I call it as 'root' it does not work. So is there a permissions issue ? I have permission on the file set to 755. I see there is a variable in upsmon.conf called RUN_AS_USER. I do not have this defined. Does this variable need to be defined ? I presume that if it is not defined then upsmon is running as root. I saw something about 'user' and 'group' in the documentation but am a bit lost as to what I should do. If this is the problem then explicit instructions would be helpful.
# By default, upsmon splits into two processes. One stays as root and
# waits to run the SHUTDOWNCMD. The other one switches to another userid
# and does everything else.
#
# The default nonprivileged user is set at compile-time with
# 'configure --with-user=...'.
#
Additional discussion is in the upsmon.conf man page, or here: http://www.networkupstools.org/docs/man/upsmon.conf.html <http://www.networkupstools.org/docs/man/upsmon.conf.html>
For Debian, the other userid is "nut".
I don't know the exact security implications of setting RUN_AS_USER to root, nor have I tried "upsmon -p" (see "man 8 upsmon" for details on that). Bear in mind that this code listens to the network, so if you do set it to run as root, I would recommend adjusting your firewall accordingly.
--
Charles Lepple
clepple at gmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150921/e13bae0c/attachment.html>
More information about the Nut-upsdev
mailing list