[Nut-upsdev] Environment Variables

Keven L. Ates atescomp at gmail.com
Fri May 27 23:33:59 UTC 2011


On Fri, May 27, 2011 at 4:33 PM, Stuart D. Gathman <stuart at bmsi.com> wrote:

> On Fri, 27 May 2011, Arjen de Korte wrote:
>
>  Just a quick question, do you have a clue what PID files are used for?
>>
>
>
Ditto on what Stuart said.

They let various service managers "know" which PID is associated with which
daemon so that it may successfully execute the start/stop/restart/status/...
commands.
Ex:
   sudo service nut status
   Checking status of Network UPS Tools
    * upsd is running
    * upsmon is running

I suggested the change because I was replacing the Ubuntu dist of NUT with
the development version and found that starting and stopping the service was
not working properly.  The NUT service "upsmon" was creating the PID file in
one directory, but the service script was looking for it in another
directory.  I was able to set the environment variable for "statepath" and
therefore "altpidpath" (but not perfectly, which led to a bug), but not for
"pidpath".  The other NUT service "upsd" was working just fine (but I'm not
sure why..didn't trace that code).  This just seemed a bit odd to me.
Pursuing the configure.txt and common.c files, it looked like the related
functions could use an overhaul for more than just my little issue.

Keven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20110527/cd74f31d/attachment.html>


More information about the Nut-upsdev mailing list