Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 433401 - net-analyzer/icinga-1.7.1-r4: ido2db init.d script: sed: can't read /etc/icinga/ido2db.cfg: No such file or directory
Summary: net-analyzer/icinga-1.7.1-r4: ido2db init.d script: sed: can't read /etc/icin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-30 07:49 UTC by Martin Dummer
Modified: 2012-09-10 15:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Dummer 2012-08-30 07:49:44 UTC
since the update to net-analyzer/icinga-1.7.1-r4 the init script of ido2db throws an error message during system boot, sometimes when rc-status is invoked and always when /etc/init.d/ido2db is called directly

sample:

linux ~ # LANG=C /etc/init.d/ido2db status
sed: can't read /etc/icinga/ido2db.cfg: No such file or directory
sed: can't read /etc/icinga/ido2db.cfg: No such file or directory
 * status: stopped



The reason is that there no default config file for ido2db after the emerge, but the init scripts expects it unconditionally.

Proposed solution:

- let the init script take care of the non-existing config file, like this:

---------------------------------------------------
--- /etc/init.d/ido2db.orig  2012-08-30 09:35:41.000000000 +0200
+++ /etc/init.d/ido2db       2012-08-30 09:37:10.263979886 +0200
@@ -4,8 +4,10 @@
 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/icinga/files/ido2db-init.d-2,v 1.2 2012/08/19 08:25:22 prometheanfire Exp $
 
 get_config() {
-    sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' \
-       "${IDO2DBCFG}"
+       if [ -e "${IDO2DBCFG}" ]; then
+           sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' \
+               "${IDO2DBCFG}"
+       fi
 }
 
 command=/usr/sbin/ido2db
---------------------------------------------------
Comment 1 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2012-09-10 15:25:58 UTC
fixed in 1.7.2 (also fixed is CVE-2012-3441)