<?xml version="1.0" encoding="windows-1252"?>
<node id="799828" title="Re: Executing script in normal/daemon mode and adding start/stop capability" created="2009-10-07 18:23:33" updated="2009-10-07 18:23:33">
<type id="11">
note</type>
<author id="747201">
afoken</author>
<data>
<field name="doctext">
&lt;p&gt;I prefer daemontools for background processes, as explained in [id://794980]. No need to add a single line of code to your script, no race conditions when handling PID files (because daemontools do not need PID files), and a simple control mechanism. Just write a char to a pipe or let the svc utility do that for you.&lt;/p&gt;
&lt;p&gt;&lt;small&gt;(And yes, djb's behaviour regarding &lt;c&gt;errno&lt;/c&gt; is just silly and childish. Apply the patch from &lt;a href="http://thedjbway.org/daemontools/installation.html"&gt;thedjbway.org&lt;/a&gt; or complain loudly to djb that he does not want to accept the C standards. And by the way, also apply the other patch that adds support for &lt;c&gt;SIGQUIT&lt;/c&gt;, &lt;c&gt;SIGUSR1&lt;/c&gt;, and &lt;c&gt;SIGUSR2&lt;/c&gt;.)&lt;/small&gt;&lt;/p&gt;
&lt;p&gt;Alexander&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-747201"&gt;
--&lt;br&gt;
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
799688</field>
<field name="parent_node">
799688</field>
</data>
</node>
