/etc/init.d/apache2 doesn't do "chown www-data /var/lock/apache2" after directory creation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apache2 (Debian) |
Fix Released
|
Unknown
|
|||
apache2 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: apache2.2-common
It looks like /etc/init.d/apache2 has a one-liner to fix missing /var/lock/apache2 directory. This is useful for example when /var/lock is on tmpfs. However, the init script doesn't change the ownership of newly created /var/lock/apache2 directory.
Here's a snippet from /var/lib/
# Make sure /var/lock/apache2 has the correct permissions
if [ -d /var/lock/apache2 ]; then
chown www-data /var/lock/apache2
fi
But the /etc/init.d/apache2 does only the directory creation:
[ -d /var/lock/apache2 ] || mkdir -p /var/lock/apache2
I think copying (or even moving) the "if [ -d ..." block from the postinst script to init.d script would be the correct fix.
For example dav_fs tries to create a lock file, but fails:
[Mon Apr 23 14:53:27 2007] [error] [client 127.0.0.1] The locks could not be queried for verification against a possible "If:" header. [500, #0]
[Mon Apr 23 14:53:27 2007] [error] [client 127.0.0.1] Could not open the lock database. [500, #400]
[Mon Apr 23 14:53:27 2007] [error] [client 127.0.0.1] (13)Permission denied: Could not open property database. [500, #1]
I'm currently running a fresh AMD64 Kubuntu Feisty installation.
Changed in apache2: | |
status: | Unknown → Fix Committed |
Changed in apache2: | |
status: | Fix Committed → Fix Released |
I confirm this bug. Moreover, in the package apache2-common for edgy, the line is present:
------- -----/etc/ init.d/ apache2- ------- from package apache2- common_ 2.0.55- 4ubuntu4_ i386.deb (edgy)
case $1 in httpd.conf ] || touch /etc/apache2/ httpd.conf apache2/ ssl_scache ] && rm -f /var/run/ apache2/ *ssl_scache*
start)
[ -f /etc/apache2/
# ssl_scache shouldn't be here if we're just starting up.
[ -f /var/run/
# /var/run and /var/lock could be on a tmpfs
[ ! -d /var/run/apache2 ] && mkdir /var/run/apache2
[ ! -d /var/lock/apache2 ] && mkdir /var/lock/apache2
# Make sure /var/lock/apache2 has the correct permissions
chown www-data /var/lock/apache2
log_begin_msg "Starting apache 2.0 web server..."
log_ end_msg 0
else
log_ end_msg 1
if $APACHE2CTL startssl; then
fi
;;
------- -----/etc/ init.d/ apache2- ------- from package apache2. 2-common_ 2.2.3-3. 2build1_ i386.deb (feisty)
case $1 in httpd.conf ] || touch /etc/apache2/ httpd.conf apache2/ ssl_scache ] && rm -f /var/run/ apache2/ *ssl_scache*
log_ end_msg 0
else
log_ end_msg 1
start)
[ -f /etc/apache2/
[ -d /var/run/apache2 ] || mkdir -p /var/run/apache2
[ -d /var/lock/apache2 ] || mkdir -p /var/lock/apache2
#ssl_scache shouldn't be here if we're just starting up.
[ -f /var/run/
log_begin_msg "Starting web server (apache2)..."
if $APACHE2CTL start; then
fi
;;
Not yet solved in gutsy: -----/etc/ init.d/ apache2- ------- from package apache2. 2-common_ 2.2.3-4_ i386.deb (gutsy)
-------
case $1 in httpd.conf ] || touch /etc/apache2/ httpd.conf apache2/ ssl_scache ] && rm -f /var/run/ apache2/ *ssl_scache*
log_ end_msg 0
else
log_ end_msg 1
start)
[ -f /etc/apache2/
[ -d /var/run/apache2 ] || mkdir -p /var/run/apache2
[ -d /var/lock/apache2 ] || mkdir -p /var/lock/apache2
#ssl_scache shouldn't be here if we're just starting up.
[ -f /var/run/
log_begin_msg "Starting web server (apache2)..."
if $APACHE2CTL start; then
fi
;;