Bug 2385 - The /etc/rc.d/functions daemon function used in rc files kills by process name, this causes problems
Summary: The /etc/rc.d/functions daemon function used in rc files kills by process nam...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 5.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-04-27 17:27 UTC by bapper
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-07-06 19:10:50 UTC
Embargoed:


Attachments (Terms of Use)

Description bapper 1999-04-27 17:27:13 UTC
The daemon function should not kill processes based on the
name of the process.  The problem with this is that when
starting a daemon with the same name but different
parameters (in my case httpd), it does not function
properly.  The daemon function will kill the first process
it finds of that name, which may or may not be the right
one.  Instead of killing by process name, it would be better
to use pids or even the whole command line, not just the
process name.

Comment 1 Bill Nottingham 1999-04-27 18:02:59 UTC
- first of all, I'm assuming you mean killproc(). daemon() doesn't
kill anything.
- killproc() uses pidofproc, which first checks pid files,
and then ps, etc.

What are you trying to do that you need to specify some
but not all processes?- first of all, I'm assuming you mean killproc(). daemon() doesn't
kill anything.
- killproc() uses pidofproc, which first checks pid files,
and then ps, etc.

What are you trying to do that you need to specify some
but not all processes?

Comment 2 bapper 1999-04-27 20:12:59 UTC
Okay, I filled it out without rechecking what was going on.  The
problem I'm running into is with daemon not starting a process of the
same name.  I'm doing a project with 2 web server configurations and
if I use daemon, it returns imediately without launching the second
web server.  I save the pid of the second webserver to a different
file name (ie. httpd.internal.pid).  So the pidofproc() function will
eventually use ps to get the pid of the first webserver and daemon
will not launch the second.  The way debian does their
start-stop-daemon script is they allow you to specify a pidfile for
the daemon you are going to be starting.  This isn't a huge deal for
us because we can just start httpd however we want.  We just wanted to
do things the way Redhat does them because we are creating an add-on
to Redhat.  The ability to specify a pidfile would be a nice feature.


Note You need to log in before you can comment on or make changes to this bug.