Package: monit
Version: 1:5.1.1-1
Severity: normal

The default init script dependencies have monit starting before
most other services.  If you are using monit to monitor your
critical services, it would be preferable to have monit start
last so that it does not detect "downed" services that have
simply not been started yet.

Similarly, it would be ideal for monit to stop before all other
services.

I added these directives to my monit init script to get the
behavior I'm describing:

Should-Start: $ALL
Should-Stop: $ALL

Thanks,
--Joey Parrish


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages monit depends on:
ii  libc6                         2.11.2-7   Embedded GNU C Library: Shared lib
ii  libpam0g                      1.1.1-6.1  Pluggable Authentication Modules l
ii  libssl0.9.8                   0.9.8o-3   SSL shared libraries

monit recommends no packages.

monit suggests no packages.

-- Configuration Files:
/etc/default/monit changed:
startup=1

/etc/init.d/monit changed:
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/monit
CONFIG="/etc/monit/monitrc"
DELAY="/etc/monit/monit_delay"
NAME=monit
DESC="daemon monitor"
test -f $DAEMON || exit 0
if [ -f "/etc/default/monit" ]; then
     . /etc/default/monit
fi
ARGS="-c $CONFIG -s /var/lib/monit/monit.state"
monit_not_configured () {
    printf "%b\n" "monit won't be started/stopped\n\tunless it it's configured"
    if [ "$1" != "stop" ]
        then
        printf "%b\n" "\tplease configure monit and then edit 
/etc/default/monit"
        printf "%b\n" "\tand set the \"startup\" variable to 1 in order to 
allow "
        printf "%b\n" "\tmonit to start"
    fi
    exit 0
}
monit_check_config () {
    # Check for emtpy config, probably default configfile.
    if [ "`grep -s -v \"^#\" $CONFIG`" = "" ]; then
        echo "empty config, please edit $CONFIG."
        exit 0
    fi
}
monit_check_perms () {
    # Check the permission on configfile. 
    # The permission must not have more than -rwx------ (0700) permissions.
   
    # Skip checking, fix perms instead.
    /bin/chmod go-rwx $CONFIG
}
monit_delayed_monitoring () {
    if [ -x $DELAY ]; then
      $DELAY &
    elif [ -f $DELAY ]; then
      echo
      echo "[WARNING] A delayed start file exists ($DELAY) but it is not 
executable."
    fi
}
monit_check_syntax () {
  $DAEMON -t 2>/dev/null >/dev/null
  if [ $? -eq 1 ] ; then
      echo "Syntax error:"
                $DAEMON -t
                exit 0
  fi
}
monit_checks () {
    # Check if startup variable is set to 1, if not we exit.
    if [ "$startup" != "1" ]; then
        monit_not_configured $1
    fi
    # Check for emtpy configfile
    monit_check_config
    # Check permissions of configfile
    monit_check_perms
         # Check syntax of config file
    monit_check_syntax
}
case "$1" in
  start)
        echo -n "Starting $DESC: "
    monit_checks $1
        echo -n "$NAME"
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
                --exec $DAEMON > /dev/null 2>&1 -- $ARGS
   monit_delayed_monitoring
        echo "."
        ;;
  stop)
        echo -n "Stopping $DESC: "
    #monit_checks $1
        echo -n "$NAME"
        start-stop-daemon --retry 5 --oknodo --stop --quiet --pidfile 
/var/run/$NAME.pid \
                --exec $DAEMON  > /dev/null 2>&1
        echo "."
        ;;
  restart|force-reload)
        $0 stop
        $0 start
        ;;
  syntax)
   monit_check_syntax
   ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload|syntax}" >&2
        exit 1
        ;;
esac
exit 0

/etc/monit/monitrc [Errno 13] Permission denied: u'/etc/monit/monitrc'

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to