• Bug#267295: initscript fails to start nagios

    From Radu Spineanu@1:229/2 to All on Sat Aug 21 22:10:14 2004
    From: [email protected]

    Package: nagios
    Severity: normal
    Tags: patch

    Hello

    If /var/run/nagios/nagios.pid is not present nagios fails to start...

    Here is a small patch for the initscript that just adds a check for that
    file


    --- nagios_orig 2004-08-11 08:58:10.000000000 +0300
    +++ nagios 2004-08-21 02:42:50.000000000 +0300
    @@ -41,11 +41,15 @@
    return 1 # Isn't started
    fi
    else
    - # Try discovering if nagios is alive checking its pid
    - if kill -CHLD $( cat /var/run/nagios/$NAME.pid ) ; then
    - return 1 # Isn't started
    - else
    - return 0 # Is started
    + if [ -f "/var/run/nagios/$NAME.pid" ]; then
    + # Try discovering if nagios is alive checking its pid
    + if kill -CHLD $( cat /var/run/nagios/$NAME.pid ) ; then
    + return 1 # Isn't started
    + else
    + return 0 # Is started
    + fi
    + else
    + return 1 # Isn't started
    fi
    fi
    }


    -- System Information:
    Debian Release: 3.1
    APT prefers unstable
    APT policy: (500, 'unstable')
    Architecture: i386 (i686)
    Kernel: Linux 2.6.5
    Locale: LANG=C, LC_CTYPE=C


    --
    To UNSU