Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 412241 - www-servers/apache init script on lxc/openvz/vserver host
Summary: www-servers/apache init script on lxc/openvz/vserver host
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-16 17:55 UTC by Vadim Kuznetsov (RETIRED)
Modified: 2021-04-28 19:24 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim Kuznetsov (RETIRED) gentoo-dev 2012-04-16 17:55:14 UTC
It seems to me that start case of apache init script should include --pidfile option like so:
start-stop-daemon --start --pidfile "${PIDFILE}" ${APACHE2} -- ${APACHE2_OPTS} -k start

s-s-d will try to find out if service is already runnig and will try to stop it before it will attempt to start it.
If you don't supply --pidfile,  s-s-d will look for service in /proc by name.

It's all fine, unless you have lxc container that is running apache as well.
s-s-d will find container apache in /proc by name, then it will try to kill it (this is already not what we want.) and fail. 
And after that s-s-d will fail to start service on the host on the ground that is already running.
If you supply --pidfile s-s-d will search /proc by pid only and will not find service running in the lxc container.
Comment 1 LW 2012-06-21 17:59:39 UTC
The pidfile issue also affects running multiple apache instances:
    www-servers/apache-2.2.22-r1

Setting
    PIDFILE=/home/pmirror/run/apache2.pid
in
    /etc/conf.d/pmirror
has no affect.

The pidfile is still created as
    /var/run/apache2.pid
even though the rest of the conf variables are used,
such as STARTUPERRORLOG="/var/log/apache2/pmirror-startuperror.log"

A possibly related issue is that the startup is delayed for 5 seconds
or so.