Bug 2407 - daemon() should check running processes against the given base
Summary: daemon() should check running processes against the given base
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: initscripts (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Dmitry V. Levin
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-23 01:58 MSK by imz
Modified: 2003-08-25 15:18 MSD (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 \"$gotbase\" ] || base=\"${1##*/}\"
 
        # See if it\'s already running.
-       local pidlist=`pidofproc \"$1\"`
+       local pidlist=`pidofproc \"$base\"`
 
        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