[Pkg-nagios-devel] Bug#757103: icinga-common: hardcoded path to conffile in postinst script breaks upgrade

Jonas Meurer jonas at freesources.org
Tue Aug 5 10:24:16 UTC 2014


Package: icinga-common
Version: 1.11.5-1~debmon70+1
Severity: important

Hello,

the upgrade of icinga-common failed with the following error:

Setting up icinga-common (1.11.5-1~debmon70+1) ...
chown: cannot access `/etc/icinga/resource.cfg': No such file or 
directory
dpkg: error processing icinga-common (--configure):
  subprocess installed post-installation script returned error exit 
status 1

On the system in question, the resource file has been moved to a 
different
place before:

# grep ^resource_file /etc/icinga/icinga.cfg
resource_file=/etc/icinga/primary/resource.cfg
# ls /etc/icinga/resource.cfg
ls: cannot access /etc/icinga/resource.cfg: No such file or directory
# ls /etc/icinga/primary/resource.cfg
/etc/icinga/primary/resource.cfg

The hardcoded path to resource.cfg in postinst script is the reason for
this error:

--8<---snip---/var/lib/dpkg/info/icinga-common.postinst---8<---snap--
         # explicitly set permissions on some files that are dependent
         # on the uid/gid of the nagios user, which is dynamically 
created.
         setperm root nagios 0640 $en/resource.cfg
--8<---snip---/var/lib/dpkg/info/icinga-common.postinst---8<---snap--

I'm not sure, but I guess that package maintainance scripts must not
rely on config files being present. This should be easily fixed by
checking for existence of the file first:

[ -f "$en/resource.cfg" ] && setperm root nagios 0640 $en/resource.cfg

Kind regards,
  jonas

-- System Information:
Debian Release: 7.6
   APT prefers stable-updates
   APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/24 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages icinga-common depends on:
ii  adduser                3.113+nmu3
ii  bsd-mailx [mailx]      8.1.2-0.20111106cvs-1
ii  coreutils              8.13-3.5
ii  debconf [debconf-2.0]  1.5.49
ii  dpkg                   1.16.15
ii  lsb-base               4.1+Debian8+deb7u1
ii  nagios-plugins-basic   2.0-1~debmon70+1
ii  ucf                    3.0025+nmu3

Versions of packages icinga-common recommends:
ii  nagios-plugins  2.0-1~debmon70+1

icinga-common suggests no packages.

-- Configuration Files:
/etc/default/icinga changed [not included]
/etc/icinga/commands.cfg [Errno 2] Datei oder Verzeichnis nicht 
gefunden: u'/etc/icinga/commands.cfg'
/etc/icinga/icinga.cfg changed [not included]
/etc/icinga/objects/contacts_icinga.cfg [Errno 2] Datei oder Verzeichnis 
nicht gefunden: u'/etc/icinga/objects/contacts_icinga.cfg'
/etc/icinga/objects/extinfo_icinga.cfg [Errno 2] Datei oder Verzeichnis 
nicht gefunden: u'/etc/icinga/objects/extinfo_icinga.cfg'
/etc/icinga/objects/generic-host_icinga.cfg [Errno 2] Datei oder 
Verzeichnis nicht gefunden: 
u'/etc/icinga/objects/generic-host_icinga.cfg'
/etc/icinga/objects/generic-service_icinga.cfg [Errno 2] Datei oder 
Verzeichnis nicht gefunden: 
u'/etc/icinga/objects/generic-service_icinga.cfg'
/etc/icinga/objects/hostgroups_icinga.cfg [Errno 2] Datei oder 
Verzeichnis nicht gefunden: u'/etc/icinga/objects/hostgroups_icinga.cfg'
/etc/icinga/objects/localhost_icinga.cfg [Errno 2] Datei oder 
Verzeichnis nicht gefunden: u'/etc/icinga/objects/localhost_icinga.cfg'
/etc/icinga/objects/services_icinga.cfg [Errno 2] Datei oder Verzeichnis 
nicht gefunden: u'/etc/icinga/objects/services_icinga.cfg'
/etc/icinga/objects/timeperiods_icinga.cfg [Errno 2] Datei oder 
Verzeichnis nicht gefunden: 
u'/etc/icinga/objects/timeperiods_icinga.cfg'
/etc/icinga/resource.cfg [Errno 2] Datei oder Verzeichnis nicht 
gefunden: u'/etc/icinga/resource.cfg'

-- debconf information:
* icinga/check_external_commands: true



More information about the Pkg-nagios-devel mailing list