HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //etc/init.d/zabbix-agent
#! /bin/sh
### BEGIN INIT INFO
# Provides:          zabbix-agent
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start zabbix-agent daemon
# Description: Start zabbix-agent daemon
### END INIT INFO

NAME=zabbix_agentd
DAEMON=/usr/sbin/$NAME
# Exit if executable is not installed
[ -x $DAEMON ] || exit 0

DIR=/run/zabbix
PID=$DIR/$NAME.pid
RETRY=TERM/30/KILL/5

# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS

# define LSB log_* functions.
. /lib/lsb/init-functions

_ev_ () {
  [ "$VERBOSE" = "no" ] || eval $@
}

[ -d "$DIR" ] || mkdir "$DIR"
chown -R zabbix:zabbix "$DIR"
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"

case "$1" in
  start)
    start-stop-daemon --start --pidfile $PID --exec $DAEMON --test --quiet > /dev/null
    [ $? -ne 0 ] && log_action_msg "$NAME is already running" && exit 0
    _ev_ log_action_begin_msg \"$NAME starting\"
    R=$(start-stop-daemon --start --pidfile $PID --exec $DAEMON --oknodo 2>&1) \
    && _ev_ log_action_end_msg 0 \"$R\" \
    || _ev_ log_action_end_msg 1 \"$R\"
  ;;
  stop)
    _ev_ log_action_begin_msg "$NAME stopping"
    R=$(start-stop-daemon --stop --pidfile $PID --exec $DAEMON --oknodo --retry=$RETRY 2>&1) \
    && _ev_ log_action_end_msg 0 \"$R\" \
    || _ev_ log_action_end_msg 1 \"$R\"
  ;;
  status)
    ## return status 0 if process is running.
    status_of_proc -p $PID "$DAEMON" "$NAME"
  ;;
  restart|force-reload)
    $0 stop
    $0 start
  ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload|status}" >&2
    exit 1
  ;;
esac