2024-06-02 03:46:30 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
|
|
extra_started_commands="reload"
|
|
|
|
|
|
2024-06-06 04:23:46 +00:00
|
|
|
agent_name=${SVCNAME#pgmon.}
|
2024-06-02 03:46:30 +00:00
|
|
|
agent_name=${agent_name:-pgmon}
|
|
|
|
|
|
2024-06-06 04:23:46 +00:00
|
|
|
CONFIG_FILE="/etc/pgmon/${agent_name}.cfg"
|
|
|
|
|
PID_FILE="/run/pgmon/${agent_name}.pid"
|
2024-06-07 06:10:38 +00:00
|
|
|
LOG_FILE="/var/log/pgmon/${agent_name}.log"
|
|
|
|
|
SOCKET="/run/pgmon/${agent_name}.socket"
|
2024-06-06 04:23:46 +00:00
|
|
|
|
|
|
|
|
pidfile="$PID_FILE"
|
2024-06-02 03:46:30 +00:00
|
|
|
|
2024-06-06 04:51:04 +00:00
|
|
|
command="/usr/bin/pgmon"
|
2024-06-06 04:44:05 +00:00
|
|
|
command_args="--server -c '$CONFIG_FILE' -l '$LOG_FILE' -s '$SOCKET'"
|
2024-06-06 04:51:04 +00:00
|
|
|
command_background="true"
|
2024-06-06 04:44:05 +00:00
|
|
|
command_user="zabbix:zabbix"
|
|
|
|
|
|
2024-06-07 06:10:38 +00:00
|
|
|
output_log="/var/log/pgmon/${agent_name}-service.log"
|
|
|
|
|
error_log="/var/log/pgmon/${agent_name}-service.err"
|
|
|
|
|
|
2024-06-02 03:46:30 +00:00
|
|
|
start_pre() {
|
2024-06-03 05:10:45 +00:00
|
|
|
checkpath -d -m 0755 -o "${command_user}" "/run/pgmon"
|
|
|
|
|
checkpath -d -m 0755 -o "${command_user}" "/var/log/pgmon"
|
2024-06-02 03:46:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
|
ebegin "Reloading ${RC_SVCNAME}"
|
|
|
|
|
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
|
|
|
|
eend $?
|
|
|
|
|
}
|