<div class="gmail_quote"><div class="im"><div class="gmail_quote">On Fri, May 27, 2011 at 4:33 PM, Stuart D. Gathman <span dir="ltr"><<a href="mailto:stuart@bmsi.com" target="_blank">stuart@bmsi.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Fri, 27 May 2011, Arjen de Korte wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Just a quick question, do you have a clue what PID files are used for?<br>
</blockquote>
<br></div></blockquote><div> </div></div></div>Ditto on what Stuart said.<br><br>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.<br>

Ex:<br>   sudo service nut status<br>   Checking status of Network UPS Tools<br>    * upsd is running<br>    * upsmon is running<br><br>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.<br>
<font color="#888888">
<br>Keven<br>
</font></div><br>