start: trabalho desconhecido: monit

0

Então, o que está causando esse erro no seguinte caso?

  1. /etc/init.d/monit existe
  2. instalado usando sudo apt-get install monit

instalação padrão via apt

vagrant@vagrant-ubuntu-trusty-64:~$ sudo apt-get install monit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
monit is already the newest version.
The following packages were automatically installed and are no longer required:
  chef-zero erubis ohai ruby-diff-lcs ruby-erubis ruby-hashie ruby-highline
  ruby-ipaddress ruby-mime-types ruby-mixlib-authentication ruby-mixlib-cli
  ruby-mixlib-config ruby-mixlib-log ruby-mixlib-shellout ruby-net-ssh
  ruby-net-ssh-gateway ruby-net-ssh-multi ruby-rack ruby-rest-client
  ruby-sigar ruby-systemu ruby-yajl
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

/etc/init.d/monit existe

vagrant@vagrant-ubuntu-trusty-64:~$ cat /etc/init.d/monit
#!/bin/sh

### BEGIN INIT INFO
# Provides:          monit
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Should-Start:      $all
# Should-Stop:       $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: service and resource monitoring daemon
# Description:       monit is a utility for managing and monitoring
#                    processes, programs, files, directories and filesystems
#                    on a Unix system. Monit conducts automatic maintenance
#                    and repair and can execute meaningful causal actions
#                    in error situations.
### END INIT INFO

set -e

. /lib/lsb/init-functions

DAEMON=/usr/bin/monit
CONFIG=/etc/monit/monitrc
NAME=monit
DESC="daemon monitor"
MONIT_OPTS=
PID="/run/$NAME.pid"

# Check if DAEMON binary exist
[ -f $DAEMON ] || exit 0

[ -f "/etc/default/$NAME" ] && . /etc/default/$NAME

MONIT_OPTS="-c $CONFIG $MONIT_OPTS"

monit_not_configured () {
  if [ "$1" != "stop" ]
  then
    printf "\tplease configure $NAME and then edit /etc/default/$NAME\n"
    printf "\tand set the \"START\" variable to \"yes\" in order to allow\n"
    printf "\t$NAME to start\n"
  fi
  exit 0
}

monit_checks () {
  # Check if START variable is set to "yes", if not we exit.
  if [ "$START" != "yes" ]
  then
    monit_not_configured $1
  fi
}

case "$1" in
  start)
    log_daemon_msg "Starting $DESC" "$NAME"
    monit_checks $1
    if start-stop-daemon --start --quiet --oknodo --pidfile $PID --exec $DAEMON -- $MONIT_OPTS 1>/dev/null
    then
      log_end_msg 0
    else
      log_end_msg 1
    fi
    ;;
  stop)
    log_daemon_msg "Stopping $DESC" "$NAME"
    if start-stop-daemon --retry TERM/5/KILL/5 --oknodo --stop --quiet --pidfile $PID 1>/dev/null
    then
      log_end_msg 0
    else
      log_end_msg 1
    fi
    ;;
  reload)
    log_daemon_msg "Reloading $DESC configuration" "$NAME"
    if start-stop-daemon --stop --signal HUP --quiet --oknodo --pidfile $PID --exec $DAEMON -- $MONIT_OPTS 1>/dev/null
    then
      log_end_msg 0
    else
      log_end_msg 1
    fi
    ;;
  restart|force-reload)
    log_daemon_msg "Restarting $DESC" "$NAME"
    start-stop-daemon --retry TERM/5/KILL/5 --oknodo --stop --quiet --pidfile $PID 1>/dev/null
    if start-stop-daemon --start --quiet --oknodo --pidfile $PID --exec $DAEMON -- $MONIT_OPTS 1>/dev/null
    then
      log_end_msg 0
    else
      log_end_msg 1
    fi
    ;;
  syntax)
    $DAEMON $MONIT_OPTS -t
    ;;
  status)
    status_of_proc -p $PID $DAEMON $NAME
    ;;
  *)
    log_action_msg "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload|syntax|status}"
    ;;
esac

exit 0

não há serviço de monitoramento em execução

vagrant@vagrant-ubuntu-trusty-64:~$ ps aux | grep monit
vagrant   7338  0.0  0.0  10460   936 pts/0    S+   22:55   0:00 grep --color=auto monit

tenta iniciar o serviço monit, falha

vagrant@vagrant-ubuntu-trusty-64:~$ sudo service monit start
start: Unknown job: monit

vagrant@vagrant-ubuntu-trusty-64:~$ ps aux | grep monit
vagrant   7675  0.0  0.0  10460   932 pts/0    S+   22:56   0:00 grep --color=auto monit

Atualização: 3-set-2016

Estou usando o vagrant para criar uma máquina virtual rodando o Ubuntu / 14.04.

/etc/init.d/monit start parece funcionar

vagrant@vagrant-ubuntu-trusty-64:~$ sudo /etc/init.d/monit start
 * Starting daemon monitor monit                                                                                                            /etc/monit/conf.d/postfix.conf:11: Warning: hostname did not resolve 'INSERT_THE_RELAY_HOST'
                                                                                                                                     [ OK ]

update: 2016-09-04

O nome do serviço é, na verdade, mmonit , não monit . :)

sudo service mmonit start funciona

    
por ramonrails 02.09.2016 / 19:49

1 resposta

1

O nome do serviço é, na verdade, mmonit , não monit . :)

sudo service mmonit start funciona

    
por 04.09.2016 / 15:38