시작: 알 수 없음 작업: monit

시작: 알 수 없음 작업: monit

그러면 다음 상황에서 이 오류가 발생하는 이유는 무엇입니까?

  1. /etc/init.d/monit가 존재합니다.
  2. 설치 및 사용sudo apt-get install monit

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존재하다

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

모니터링 서비스가 실행되고 있지 않습니다.

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

monit 서비스를 시작하려고 시도했지만 실패했습니다.

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

고쳐 쓰다:2016년 9월 3일

나는 ubuntu/trusty 14.04를 실행하는 가상 머신을 생성하기 위해 vagrant를 사용하고 있습니다.

/etc/init.d/monit start작동하는 것 같습니다

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 ]

업데이트 날짜: 2016-09-04

실제로 서비스 이름은 입니다 . mmonit그렇지 않나요? monit:)

sudo service mmonit start일하다

답변1

실제로 서비스 이름은 입니다 . mmonit그렇지 않나요? monit:)

sudo service mmonit start일하다

관련 정보