Bug 245766 - Function killproc doesn't work the way it does in RHEL4
Function killproc doesn't work the way it does in RHEL4
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: initscripts (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: initscripts Maintenance Team
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2007-06-26 11:21 EDT by Dirk
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-26 11:37:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dirk 2007-06-26 11:21:54 EDT
Description of problem:


I have a big Problem with a chrooted Version of the included Apache, the Problem
is that i can't restart the service via service httpd restart when it is chrooted.

This occurs because redhat changes the behaviour of the FIND PID Part in
/etc/init.d/functions from:
 if [ -z "$pid" ]; then
                pid=`pidof -o $$ -o $PPID -o %PPID -x $1 || \
                        pidof -o $$ -o $PPID -o %PPID -x $base`

__pids_pidof() {
      pidof -c -o $$ -o $PPID -o %PPID -x "$1" || \
              pidof -c -o $$ -o $PPID -o %PPID -x "${1##*/}"


The Problematical Part seems to be the -c option because this causes not
regognicing my chrooted Apache

Version-Release number of selected component (if applicable):

Apache Version 2.2.3-6.el5
ModSecurity 2.1-1.4 ( I know this is not supported by redhat but i think the
problem is more genereal as described before)

How reproducible:

Everytime via service httpd restart

Expected results:

Comment 1 Dirk 2007-06-26 11:24:41 EDT
Can I just remove the -c Option or does this destroy other import functionality,
and when not can you "correct" this in a future release ? Kind Regards Dirk 
Comment 2 Bill Nottingham 2007-06-26 11:37:34 EDT
This is an intentional change, dating back to 2005; the idea is to avoid
unintentionally killing processes in a different chroot. The simple workaround
is to run the command in the chroot.

Reverting this would break requested behavior.
Comment 3 Dirk 2007-06-27 03:59:21 EDT

This may bye right, but my problem ist, that if i completely want to run this
comand in chroot environment i have to build a completely chroot which i normaly
not need for mod_security as i not need librarys and sh for example because
mod_security is so clever to chrooting just after loading libraries. 

So wouldn't it be possible to establish an switch in the init script wheater it
uses the old or the new behavior.

Kind regards
Comment 4 Bill Nottingham 2007-06-27 09:32:25 EDT
At that point, I'm not sure what you gain over running just 'killall <process>',
esepcially if you're going to have to edit config files for each script.

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