Univention Bugzilla – Bug 35078
apache config broken between unpacking and installation of univention-nagios-server
Last modified: 2014-09-11 10:06:15 CEST
univention-nagios-server creates a symlink /etc/apache2/conf.d/nagios3.conf during unpacking (debian/univention-nagios-server.links), but the actual source /etc/nagios3/apache2.conf is not present until installation of univention-nagios-server (it is a ucr template). So between unpacking and installation of univention-nagios-server we have a broken symlink in /etc/apache2/conf.d apache wont restart/start. This can be a problem for other packages (see ticket 2014051621006435). We should create the symlink /etc/apache2/conf.d/nagios3.conf in the postinst, after the config template was committed and remove the symlink in the prerm.
I would suggest the following workaround for now: diff --git a/debian/icinga-cgi.postinst b/debian/icinga-cgi.postinst index 95b91fb..c3c5e4a 100644 --- a/debian/icinga-cgi.postinst +++ b/debian/icinga-cgi.postinst @@ -47,6 +47,14 @@ case "$1" in COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) + # UNIVENTION WORKAROUND + # see https://forge.univention.org/bugzilla/show_bug.cgi?id=35078 + if [ -L /etc/apache2/conf.d/nagios3.conf ]; then + if [ ! -f /etc/nagios3/apache2.conf ]; then + touch /etc/nagios3/apache2.conf + fi + fi + # NEW method for Apache >= 2.4 if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then . /usr/share/apache2/apache2-maintscript-helper
Created attachment 6025 [details] add symlink to postint and prerm As Felix has suggested, I - removed the symlink from u*-n*-server.links - added it to u*-n*-server.postint and u*-n*-server.prerm
patch assigned pls let me know if i should prepare it for erratum ;)
(In reply to Alexander Kramer from comment #3) > patch assigned pls let me know if i should prepare it for erratum ;) Patch looks good, please apply it.
For ucs 3.2-3: - Added patch to svn r53255 - Adapted YAML file r53258 - Packages has been build: Source: univention-nagios Version: 7.0.6-5 Distribution: unstable Urgency: low Maintainer: Alexander Kramer <kramer@univention.de> Date: Tue, 02 Sep 2014 15:04:31 +0200 Changes: univention-nagios (7.0.6-5) unstable; urgency=low . * FIX broken apache config (Bug #35078) ----- For ucs 4.0: - Added patch to svn r53260 - Packages has been build: Source: univention-nagios Version: 8.0.0-2 Distribution: unstable Urgency: low Maintainer: Alexander Kramer <kramer@univention.de> Date: Tue, 02 Sep 2014 15:43:07 +0200 Changes: univention-nagios (8.0.0-2) unstable; urgency=low . * FIX broken apache config (Bug #35078)
After updating to the latest pre erratum (see update.log): root@master321:~# /etc/init.d/apache2 restart apache2: Syntax error on line 227 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/nagios3.conf: No such file or directory Action 'configtest' failed. The Apache error log may have more information. failed! root@master321:~# See jenkins test result: http://jenkins.knut.univention.de:8080/job/UCS-3.2/job/UCS-3.2-3/job/Autotest%20MultiEnv/15/testReport/
Created attachment 6085 [details] update.log
btw: why saving it under /etc/apache2/conf.d/nagios3.conf? It would be easier to put it into /etc/apache2/site-available/ and use the apache tool "a2ensite" and "a2dissite".
Found the error. I have forgotten a / in the symlink: old: ln -s etc/nagios3/apache2.conf /etc/apache2/conf.d/nagios3.conf new: ln -s /etc/nagios3/apache2.conf /etc/apache2/conf.d/nagios3.conf r53293 r53294 Package: univention-nagios Version: 7.0.6-6.269.201409031311 Scope: errata3.2-3 Package: univention-nagios Version: 8.0.0-3.270.201409031311 Branch: ucs_4.0-0 Tested it with a locally build on ucs3.2-3 and ucs4.0-0 the error disappeared. If you prefer the suggestion from Florain please let me know and i will change it.
(In reply to Alexander Kramer from comment #9) > Found the error. I have forgotten a / in the symlink: > old: ln -s etc/nagios3/apache2.conf /etc/apache2/conf.d/nagios3.conf > new: ln -s /etc/nagios3/apache2.conf /etc/apache2/conf.d/nagios3.conf > > r53293 r53294 > > > Package: univention-nagios > Version: 7.0.6-6.269.201409031311 > Scope: errata3.2-3 > > Package: univention-nagios > Version: 8.0.0-3.270.201409031311 > Branch: ucs_4.0-0 > > Tested it with a locally build on ucs3.2-3 and ucs4.0-0 the error > disappeared. Changes look good to me. There was no broken link after unpacking and after the postinst scripts the link was working fine. The update was fine. I updated the package version in the YAML file. Changes have been merged to 4.0. → VERIFIED > If you prefer the suggestion from Florain please let me know and i will > change it. Good hint from Florian, but let us leave it in the form it is right now. I am not sure whether this would have any other implications.
http://errata.univention.de/ucs/3.2/198.html