Debian Bug report logs -
#698137
destroys icinga.cfg on postinst when it's a symlink
Reported by: Peter Palfrader <weasel@debian.org>
Date: Mon, 14 Jan 2013 11:06:01 UTC
Severity: serious
Tags: patch
Found in version icinga/1.7.1-4
Fixed in version icinga/1.7.1-6
Done: Alexander Wirt <formorer@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#698137; Package icinga-common.
(Mon, 14 Jan 2013 11:06:05 GMT) (full text, mbox, link).
Acknowledgement sent
to Peter Palfrader <weasel@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>.
(Mon, 14 Jan 2013 11:06:05 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
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
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#698137; Package icinga-common.
(Wed, 06 Feb 2013 19:00:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Michael Stapelberg <stapelberg@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>.
(Wed, 06 Feb 2013 19:00:02 GMT) (full text, mbox, link).
Message #10 received at 698137@bugs.debian.org (full text, mbox, reply):
On Mon, 14 Jan 2013 12:02:35 +0100
Peter Palfrader <weasel@debian.org> wrote:
> 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 can reproduce this issue.
Alexander, since you uploaded the last icinga packages, are you going to
upload a new version with a fix?
Alternatively, I could NMU this. Please express your preference, either
way is fine with me :-).
--
Best regards,
Michael
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#698137; Package icinga-common.
(Wed, 06 Feb 2013 22:06:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Alexander Wirt <formorer@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>.
(Wed, 06 Feb 2013 22:06:06 GMT) (full text, mbox, link).
Message #15 received at 698137@bugs.debian.org (full text, mbox, reply):
On Wed, 06 Feb 2013, Michael Stapelberg wrote:
> On Mon, 14 Jan 2013 12:02:35 +0100
> Peter Palfrader <weasel@debian.org> wrote:
> > 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 can reproduce this issue.
>
> Alexander, since you uploaded the last icinga packages, are you going to
> upload a new version with a fix?
>
> Alternatively, I could NMU this. Please express your preference, either
> way is fine with me :-).
I'll of course upload this. But I don't think releaseteam will accept this
for wheezy.
>
> --
> Best regards,
> Michael
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>:
Bug#698137; Package icinga-common.
(Wed, 06 Feb 2013 22:42:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Peter Palfrader <weasel@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Nagios Maintainer Group <pkg-nagios-devel@lists.alioth.debian.org>.
(Wed, 06 Feb 2013 22:42:03 GMT) (full text, mbox, link).
Message #20 received at 698137@bugs.debian.org (full text, mbox, reply):
On Wed, 06 Feb 2013, Alexander Wirt wrote:
> On Wed, 06 Feb 2013, Michael Stapelberg wrote:
>
> > On Mon, 14 Jan 2013 12:02:35 +0100
> > Peter Palfrader <weasel@debian.org> wrote:
> > > 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 can reproduce this issue.
> >
> > Alexander, since you uploaded the last icinga packages, are you going to
> > upload a new version with a fix?
> >
> > Alternatively, I could NMU this. Please express your preference, either
> > way is fine with me :-).
> I'll of course upload this. But I don't think releaseteam will accept this
> for wheezy.
I think they should. Right now the package is destroying admin config
each time it configures.
--
| .''`. ** Debian **
Peter Palfrader | : :' : The universal
http://www.palfrader.org/ | `. `' Operating System
| `- http://www.debian.org/
Added tag(s) pending.
Request was from Alexander Wirt <formorer@debian.org>
to control@bugs.debian.org.
(Mon, 11 Feb 2013 20:09:03 GMT) (full text, mbox, link).
Reply sent
to Alexander Wirt <formorer@debian.org>:
You have taken responsibility.
(Mon, 11 Feb 2013 21:21:03 GMT) (full text, mbox, link).
Notification sent
to Peter Palfrader <weasel@debian.org>:
Bug acknowledged by developer.
(Mon, 11 Feb 2013 21:21:03 GMT) (full text, mbox, link).
Message #27 received at 698137-close@bugs.debian.org (full text, mbox, reply):
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 698137@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Alexander Wirt <formorer@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 ftpmaster@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-devel@lists.alioth.debian.org>
Changed-By: Alexander Wirt <formorer@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-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Sun, 17 Mar 2013 07:26:23 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Fri Jan 19 05:46:45 2024;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.