]> Pileus Git - ~andy/sunrise/blobdiff - net-analyzer/icinga/files/ido2db-init.d
net-analyzer/icinga: change to ido2db init, thanks to Wolfgang Schricker
[~andy/sunrise] / net-analyzer / icinga / files / ido2db-init.d
index aed7a78ea0e1623e0059ddc34ef78db7f429a308..946f3be2986c439682577085a209768317291360 100644 (file)
@@ -4,6 +4,16 @@
 # $Header: $
 
 IDO2DBBIN="/usr/sbin/ido2db"
+SOCKET="/var/icinga/ido.sock"
+
+function check() {
+       if [[ -S "${SOCKET}" ]] ; then
+               ewarn "Strange, the socket file already exist in \"${SOCKET}\""
+               ewarn "it will be removed now and re-created by ido2db"
+               ewarn "BUT please make your checks."
+               rm -f "${SOCKET}"
+       fi
+}
 
 depend() {
        need net
@@ -12,6 +22,7 @@ depend() {
 }
 
 start() {
+       check
        ebegin "Starting ido2db"
        start-stop-daemon --quiet --start --pidfile /var/icinga/ido2db.lock --startas ${IDO2DBBIN} -- -c ${IDO2DBCFG}
        eend $?