Bug#235976: apache: Apache overwrites local configuration
Package: apache
Version: 1.3.29.0.1-5
Severity: important
Hello All,
Whenever apache gets installed, reinstalled, upgraded or reconfigured, it overwrites my configuration in /etc/apache.
Perhaps my setup is a bit exotic, so I will explain the situation:
I have several Apache servers that have mostly identical configurations. To reduce redundancy, we placed the configuration
files on an NFS share. The local directory /etc/apache/ now contains a local.conf that contains any configuration directives
that should remain local and a symlink from /etc/shared/apache/httpd.conf to /etc/apache/httpd.conf. The shared
configuration file includes the local.conf file and all is well.
That is, all is well until the apache postinst scripts get called.
Through some magic, the symlink in /etc/apache gets removed and replaced by a new httpd.conf plaintext file that contains
the exact content as my /etc/shared/apache/httpd.conf. Needless to say: this is bad news for me. Changes made in the central
httpd.conf are no longer propagated to all servers.
One example of code, possibly responsible for removing the symbolic link, is from postinst.common:
if [ ! "`grep "^PidFile /var/run/$pkg.pid" /etc/$pkg/httpd.conf`" ] ; then
cat /etc/$pkg/httpd.conf | perl -pe \
"s,^PidFile.*,PidFile /var/run/$pkg.pid,;" > /etc/$pkg/httpd.conf.dpkg-inst.$$
mv /etc/$pkg/httpd.conf.dpkg-inst.$$ /etc/$pkg/httpd.conf
fi
This raises two questions:
a) Should the apache postinst scripts overwrite a configuration file
with a new file with identical content?
b) Should the apache postinst scripts remove a symlink and replace it
with a plaintext file?
I think that according to section 10.7.3 of the Debian Policy Manual, a) could be argued for but b) can not.
I'm looking forward to hearing your thoughts about this.
Sincerely,
Allard Hoeve
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.25
Locale: LANG=C, LC_CTYPE=C
Versions of packages apache depends on:
ii apache-common 1.3.29.0.1-5 Support files for all Apache webse
ii debconf 1.4.11 Debian configuration management sy
ii dpkg 1.10.18 Package maintenance system for Deb
ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an
ii libdb4.2 4.2.52-8 Berkeley v4.2 Database Libraries [
ii libexpat1 1.95.6-6 XML parsing C library - runtime li
ii libmagic1 4.07-2 File type determination library us
ii libpam0g 0.76-15 Pluggable Authentication Modules l
ii logrotate 3.6.5-2 Log rotation utility
ii mime-support 3.25-1 MIME files 'mime.types' & 'mailcap
ii perl [perl5] 5.8.3-2 Larry Wall's Practical Extraction
Reply to: