Bug 2407

Summary: daemon() should check running processes against the given base
Product: Sisyphus Reporter: imz <vanyaz>
Component: initscriptsAssignee: Dmitry V. Levin <ldv>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5    
Version: unstable   
Hardware: all   
OS: Linux   

Description imz 2003-03-23 01:58:10 MSK
/etc/init.d/functions:

daemon() has a \'--check\' option. The function checks whether a process for this kind of daemon is already running.

I think it\'d be better if it checked running process against the argument of --check rather than the real program name:

--- /etc/init.d/functions.orig  2003-03-23 01:51:54 +0300
+++ /etc/init.d/functions       2003-03-23 01:50:23 +0300
@@ -137,7 +137,7 @@
        [ -n \&quot;$gotbase\&quot; ] || base=\&quot;${1##*/}\&quot;
 
        # See if it\'s already running.
-       local pidlist=`pidofproc \&quot;$1\&quot;`
+       local pidlist=`pidofproc \&quot;$base\&quot;`
 
        local pid= p
        for p in $pidlist; do

For example, the old variant made it difficult to start several PPP daemons from intiscripts. The new variant checks individual PIDs for different kinds of PPP daemons (the services have different names).

---

---
initscripts-5.49-ipl52mdk
Comment 1 Dmitry V. Levin 2003-04-19 23:52:22 MSD
Better fix in 5.49-ipl54mdk
Comment 2 Dmitry V. Levin 2003-04-19 23:52:22 MSD
Better fix in 5.49-ipl54mdk