91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

zabbix_proxy開機啟動腳本

發布時間:2020-08-07 22:19:18 來源:網絡 閱讀:266 作者:Mengix 欄目:系統運維

zabbix init開機腳本——redhat6系統(centos6通用)
將下面代碼存在/etc/init.d/zabbix-proxy
chkconfig zabbix-proxy on

. /etc/init.d/functions
    BASEDIR=/usr/local/sbin
        BINARY_NAME=zabbix_agent
        FULLPATH=$BASEDIR/sbin/$BINARY_NAME
        PIDFILE=/tmp/$BINARY_NAME.pid
        ERROR=0
    STOPPING=0

if [ -f $PIDFILE  ] && [ -s $PIDFILE ]
    then
    PID=`cat $PIDFILE`

    if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null && [ $BINARY_NAME == `ps -e | grep $PID | awk '{print $4}'` ]
    then
        STATUS="$BINARY_NAME (pid `pidof $APP`) running.."
        RUNNING=1
    else
        rm -f $PIDFILE
        STATUS="$BINARY_NAME (pid file existed ($PID) and now removed) not running.."
        RUNNING=0
    fi
else
    if [ `ps -e | grep $BINARY_NAME | head -1 | awk '{ print $1 }'` ]
        then
        STATUS="$BINARY_NAME (pid `pidof $APP`, but no pid file) running.."
    else
        STATUS="$BINARY_NAME (no pid file) not running"
    fi
    RUNNING=0
fi

start() {
    if [ $RUNNING -eq 1 ]
        then
        echo "$0 $ARG: $BINARY_NAME (pid $PID) already running"
    else
        action $"Starting $BINARY_NAME: " $FULLPATH
        touch /var/lock/subsys/$BINARY_NAME
    fi
}

stop() {
    echo -n $"Shutting down $BINARY_NAME: "
    killproc $BINARY_NAME
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$BINARY_NAME
    RUNNING=0
}
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status $BINARY_NAME
        ;;
    restart)
        stop
        sleep 10
        start
        ;;
    help|*)
        echo $"Usage: $0 {start|stop|status|restart|help}"
        cat <<EOF

            start       - start $BINARY_NAME
            stop        - stop $BINARY_NAME
            status      - show current status of $BINARY_NAME
            restart     - restart $BINARY_NAME if running by sending a SIGHUP or start if not running
            help        - this screen

EOF
    exit 1
    ;;
esac

exit 0

zabbix init開機腳本——Ubuntu系統
將下面代碼存在/etc/init.d/zabbix-proxy
update-rc.d zabbix-proxy defaults 95

NAME=zabbix_proxy
DAEMON=/usr/local/sbin/${NAME}
DESC="Zabbix proxy daemon"
PID=/tmp/$NAME.pid

test -f $DAEMON || exit 0

case "$1" in
  start)
        echo "Starting $DESC: $NAME"
        start-stop-daemon --start --oknodo --pidfile $PID --exec $DAEMON
        ;;
  stop)
        echo "Stopping $DESC: $NAME"
        start-stop-daemon --stop --quiet --pidfile $PID --retry=TERM/10/KILL/5 && exit 0
        start-stop-daemon --stop --oknodo --exec $DAEMON --name $NAME --retry=TERM/10/KILL/5
        ;;
  restart|force-reload)
        $0 stop
        $0 start
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

建宁县| 庆元县| 松滋市| 舞阳县| 绥芬河市| 黄山市| 双城市| 炉霍县| 神池县| 舒城县| 沈丘县| 手机| 宜川县| 万全县| 武陟县| 顺义区| 宁阳县| 梓潼县| 安新县| 丹东市| 济源市| 聊城市| 平原县| 鄂州市| 海阳市| 清丰县| 额济纳旗| 如东县| 定州市| 苍溪县| 周宁县| 建平县| 永平县| 申扎县| 清水河县| 昌江| 仁寿县| 安泽县| 荣昌县| 出国| 周口市|