Ditch rc-service control-agent, use daemonset insteaad
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
|
||||
|
||||
name="monok8s-control-agent"
|
||||
description="System Control Agent (OSUpgrade controller)"
|
||||
|
||||
supervisor=supervise-daemon
|
||||
|
||||
command="/usr/local/bin/ctl"
|
||||
command_args="agent --env-file /opt/monok8s/config/cluster.env"
|
||||
|
||||
command_user="root:root"
|
||||
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
|
||||
output_log="/var/log/monok8s/agent.log"
|
||||
error_log="/var/log/monok8s/agent.log"
|
||||
|
||||
retry="TERM/10/KILL/5"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory /run
|
||||
checkpath --directory /var/log/monok8s
|
||||
|
||||
if [ ! -f /opt/monok8s/config/cluster.env ]; then
|
||||
eerror "Missing env file: /opt/monok8s/config/cluster.env"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Starting monok8s control agent"
|
||||
supervise-daemon "$RC_SVCNAME" \
|
||||
--start \
|
||||
--pidfile "$pidfile" \
|
||||
--stdout "$output_log" \
|
||||
--stderr "$error_log" \
|
||||
--respawn-delay 5 \
|
||||
--respawn-max 0 \
|
||||
-- \
|
||||
$command $command_args
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping monok8s control agent"
|
||||
supervise-daemon "$RC_SVCNAME" \
|
||||
--stop \
|
||||
--pidfile "$pidfile"
|
||||
eend $?
|
||||
}
|
||||
Reference in New Issue
Block a user