Bug #1700

rc.lighttpd.redhat does not work on rhel 5 with non-standard pid file location and chroot

Added by jrabbit over 11 years ago. Updated over 11 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Missing in 1.5.x:


In the following situation:

1. Centos/RHEL Version 5 (Tested on 5.1, assuming it affects 5.0 too, does not happen on 4.6)

2. is set in the configuration file to be somewhere other than /var/run/

3. Chroot is being used

The rc.lighttpd.redhat fails to detect a running copy of lighttpd as it cannot find the pid. This is because the __pids_pidof function in /etc/rc.d/init.d/functions has been changed between RHEL 4 and RHEL 5 to use "pidof -c" instead of just "pidof" which means it will only find processes running in the same root folder. When lighttpd runs with chroot, this is not the case, so unless the pid file is in /var/run/, it is not found.

It can be fixed by manually including the old version of the function in the script below the inclusion of /etc/rc.d/init.d/functions to override the version defined in that file.

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


Updated by jrabbit over 11 years ago

(note: there should be a double underscore on the front of the function name pids_pidof - trac took it as a formatting command)


Updated by stbuehler over 11 years ago

  • Status changed from New to Fixed
  • Resolution set to invalid

I don't see why that should be a bug in lighty - looks more like a bug in rhel.

And i don't think we should include this function.


Updated by stbuehler over 11 years ago

  • Status changed from Fixed to Invalid

Also available in: Atom