Your message dated Mon, 11 Feb 2013 21:18:18 +0000
with message-id <e1u50lw-0005v5...@franck.debian.org>
and subject line Bug#698137: fixed in icinga 1.7.1-6
has caused the Debian Bug report #698137,
regarding destroys icinga.cfg on postinst when it's a symlink
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
698137: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698137
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: icinga-common
Version: 1.7.1-4
Severity: serious
Tags: patch

icinga-common's postinst has the following construct:

| cp -a -f "$conffile" "$conffile".tmp
| sed -e ... < "$conffile" > "$conffile.tmp"

In my case, $conffile is a symlink:
} lrwxrwxrwx 1 root root 26 Nov  1 15:11 /etc/icinga/icinga.cfg -> 
from-git/static/icinga.cfg

so the postinst does effectively sed < $file > $file, and we all know
that this doesn't work and results in $file being empty at the end.

I propose to use sed's -i instead:

(untested)
--- ./icinga-common.postinst    2012-10-01 06:20:10.000000000 +0000
+++ /root/icinga-common.postinst        2013-01-14 10:57:43.751049610 +0000
@@ -65,25 +65,20 @@
 
                false)
                        check_external_commands=0
                        ;;
        esac
 
-       cp -a -f "$conffile" "$conffile".tmp
-
        # If the admin deleted or commented some variables but then set
        # them via debconf, (re-)add them to the config file.
 
        test -z "$check_external_commands" || \
        grep -Eq '^ *check_external_commands=' "$conffile" || \
        echo "check_external_commands=" >> "$conffile"
 
-       sed -e "s|^ 
*check_external_commands=.*|check_external_commands=$check_external_commands|" \
-       < "$conffile" > "$conffile.tmp"
-
-       mv -f "$conffile".tmp "$conffile"
+       sed -i -e "s|^ 
*check_external_commands=.*|check_external_commands=$check_external_commands|" 
"$conffile"
 
        # Stop a not already stopped icinga instance,
        # debhelper will start it again automatically at the bottom
        status="$(/etc/init.d/icinga status >/dev/null 2>&1; echo $?)"
 
        if [ "$status" -ne 3 ]; then

Cheers,
weasel

--- End Message ---
--- Begin Message ---
Source: icinga
Source-Version: 1.7.1-6

We believe that the bug you reported is fixed in the latest version of
icinga, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 698...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Alexander Wirt <formo...@debian.org> (supplier of updated icinga package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 11 Feb 2013 22:03:15 +0100
Source: icinga
Binary: icinga-common icinga-cgi icinga-idoutils icinga icinga-core icinga-doc 
icinga-dbg
Architecture: source amd64 all
Version: 1.7.1-6
Distribution: unstable
Urgency: medium
Maintainer: Debian Nagios Maintainer Group 
<pkg-nagios-de...@lists.alioth.debian.org>
Changed-By: Alexander Wirt <formo...@debian.org>
Description: 
 icinga     - host and network monitoring system - metapackage
 icinga-cgi - host and network monitoring system - CGI scripts
 icinga-common - host and network monitoring system - support files
 icinga-core - host and network monitoring system - core files
 icinga-dbg - host and network monitoring system - debug files
 icinga-doc - host and network monitoring system - documentation
 icinga-idoutils - host and network monitoring system - icinga-dataobjects 
support
Closes: 698137
Changes: 
 icinga (1.7.1-6) unstable; urgency=medium
 .
   * Don't destroy symlinked icinga configs with sed
     (Closes: #698137)
Checksums-Sha1: 
 a2ad6f9ec39b95e953264e14e94f0f585497ae6e 1674 icinga_1.7.1-6.dsc
 1cf05c86ac08b307d56341d8f4bd049a5463de73 50539 icinga_1.7.1-6.diff.gz
 19283e224a60daa9c113625c04dd609de9bea7be 2090598 icinga-cgi_1.7.1-6_amd64.deb
 49094c3e592da4e601955a1926db4e6b85a08cd8 265244 
icinga-idoutils_1.7.1-6_amd64.deb
 c13cb6b8307cf2b1c776670fd0ae16e5e3729675 1310 icinga_1.7.1-6_amd64.deb
 4a041c4f022a58357c854e623c5383666b28ba06 293216 icinga-core_1.7.1-6_amd64.deb
 9136a9597a3f9ff7ce81ad8756d0100e6f9b9c5f 5527996 icinga-dbg_1.7.1-6_amd64.deb
 ce3c25c9c6cffd59f245344bec53c5bf78781a52 110608 icinga-common_1.7.1-6_all.deb
 4a91ed95abc36e57a1ecd8abcd22ee4e5a7c95ca 5345568 icinga-doc_1.7.1-6_all.deb
Checksums-Sha256: 
 decd25279423c2e9dd1ffc512d1865a0233a02cd3ed714bf5775dc81ee12d158 1674 
icinga_1.7.1-6.dsc
 bd983c98b084d5046231aaf9c9332edae241a8381ad2dcca9bf365ccc8b7115c 50539 
icinga_1.7.1-6.diff.gz
 312556c812dbeb31d3c96ff65966baf956b1768c82750b76a3ed09dce96de103 2090598 
icinga-cgi_1.7.1-6_amd64.deb
 971f86578e2569e6ea24a8ae0a205f46fa671a6b156195132f119d7dba19e690 265244 
icinga-idoutils_1.7.1-6_amd64.deb
 7ed1bab5f98b969f41ad7725de8a02e136f1af8e5a6996bda89b9eb1c69ca996 1310 
icinga_1.7.1-6_amd64.deb
 3f7649f70735b9bf2b6ad05914e2db1be602a44c7675b456e36ad76c3e25f365 293216 
icinga-core_1.7.1-6_amd64.deb
 f5a07f8393d61531f88f89ed50b9e7148a465b6498ed7b9259d4cc94d256eae2 5527996 
icinga-dbg_1.7.1-6_amd64.deb
 8c1a5d2f9a1180f4040d911389c2e8cf207e61ed35334045989a9969cc286850 110608 
icinga-common_1.7.1-6_all.deb
 44017045bfe22a1dc748300c4e23e8332f88b3fd5df5cde3b84f1d5128af955c 5345568 
icinga-doc_1.7.1-6_all.deb
Files: 
 57e24c79dfa5b5fbd3f052144afd85f9 1674 net optional icinga_1.7.1-6.dsc
 641f96760b105e871f0ac898db2bfc4f 50539 net optional icinga_1.7.1-6.diff.gz
 25b9e2969d88e4a962aac1dfd6bf3068 2090598 net optional 
icinga-cgi_1.7.1-6_amd64.deb
 593eaf61774d3196998a81641e8508c3 265244 net optional 
icinga-idoutils_1.7.1-6_amd64.deb
 168660fbdb87f62e12185e880689fd38 1310 net optional icinga_1.7.1-6_amd64.deb
 90db1e1f99d76f80f4efb8d60e729aa0 293216 net optional 
icinga-core_1.7.1-6_amd64.deb
 a362d835ac923f392e95d95e377a7dec 5527996 debug extra 
icinga-dbg_1.7.1-6_amd64.deb
 647aff0225660f89e87b09deb6020e0b 110608 net optional 
icinga-common_1.7.1-6_all.deb
 bd5a9a4509fb8a0b1dac8275f748aea8 5345568 doc optional 
icinga-doc_1.7.1-6_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlEZXcIACgkQ01u8mbx9AgpT6gCcD01M2wUsaeID9kZ6zxMj+45w
VwAAnRHN2pKJNMX0oZEP3L1uJjcnZPvs
=eWLv
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to