note proceng <blockquote>Are you aware that this still has a race condition? You run a lot of tests in step 1, most of those tests involve system calls. Step 2 has two system calls. Each and every system call may cause a task switch to a malicious program that -- with a little bit of luck and good timing -- can change what you checked for in step 1, causing the following steps to fail rather unexpectedly. And each and every system call may cause a task switch to a second instance fighting for the PID file.</blockquote> Alexander:<br> Yes, I am <em>quite</em> aware that there may be a race condition (but also that the condition <em>may be rare</em>). Since many of the steps, by their nature, <em>can not be atomic</em>, that is a chance that is taken. I would rather know <em>before</em> attempting to connect to a database (for example) that it <em>could be in an inconsistent state</em> due to an abnormal termination. While everything may work right, simply knowing <strong>about the problem</strong> can go a long way to preventing it from happening in the future.<p> Many of the options (like the daemontools that you note), do <em>the same things that I describe</em> (just masking them from the programmer).<br> While you are correct that <strike>many</strike>some daemons do not need certain functions, that <em>does not mean</em> that they do not have their place. Add to that the fact that packages such as daemontools have their own built in set of limitations: <blockquote>System requirements<br> daemontools works <strong>only</strong> under UNIX.</blockquote> and that they require <em>an extra installation step</em> to accomplish <em>the same goal</em>, and you can see that it is useful to know <strong>what is being done and why</strong>.<p> In my opinion, when you <em>have to adjust</em> to another's decisions (and add complexity at the same time), it is not necessarily a good thing. 841112 841182