init
This commit is contained in:
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="api"
|
||||
description="4server API Service"
|
||||
|
||||
# Command uses Python inside the venv
|
||||
command="/4server/sbin/api"
|
||||
command_args=""
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
command_background="yes"
|
||||
|
||||
respawn_delay=5 # seconds to wait before restart
|
||||
respawn_max=0 # 0 = unlimited restarts
|
||||
|
||||
# Load environment variables if needed
|
||||
if [ -f /etc/4server ]; then
|
||||
. /etc/4server
|
||||
export $(cut -d= -f1 /etc/4server)
|
||||
fi
|
||||
|
||||
# Logs
|
||||
output_log="/4server/data/log/api.log"
|
||||
error_log="/4server/data/log/api.log"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use logger dns
|
||||
after firewall
|
||||
}
|
||||
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="checkCalls"
|
||||
description="check container service calls"
|
||||
|
||||
# Command uses Python inside the venv
|
||||
command="/4server/sbin/checkCalls"
|
||||
command_args=""
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
command_background="yes"
|
||||
|
||||
directory="/4server"
|
||||
command_user="root"
|
||||
|
||||
respawn_delay=5 # seconds to wait before restart
|
||||
respawn_max=0 # 0 = unlimited restarts
|
||||
|
||||
|
||||
|
||||
|
||||
# Load environment variables if needed
|
||||
output_log="/4server/data/log/checkCalls.log"
|
||||
error_log="/4server/data/log/checkCalls.log"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
use logger dns
|
||||
after firewall
|
||||
}
|
||||
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/sbin/openrc-run
|
||||
# OpenRC service for /4server/sbin/cleanTmp
|
||||
|
||||
name="cleanTmp"
|
||||
description="Looping /tmp cleaner that removes files older than 2 days"
|
||||
|
||||
command="/4server/sbin/cleanTmp"
|
||||
command_background="yes"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
output_log="/4server/data/log/checkCalls.log"
|
||||
error_log="/4server/data/log/checkCalls.log"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/sbin/openrc-run
|
||||
# OpenRC service for /4server/sbin/cpu
|
||||
|
||||
name="cpu"
|
||||
description="Logs cpu usage"
|
||||
|
||||
command="/4server/sbin/cpu"
|
||||
command_background="yes"
|
||||
pidfile="/run/cpu.pid"
|
||||
output_log="/4server/data/log/cpu.log"
|
||||
error_log="/4server/data/log/cpu.log"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/sbin/openrc-run
|
||||
command="/usr/bin/nebula"
|
||||
command_args="-config /etc/nebula/config.yml"
|
||||
command_background="yes"
|
||||
pidfile="/run/nebula.pid"
|
||||
name="nebula"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after networking
|
||||
}
|
||||
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/sbin/openrc-run
|
||||
description="Ping 192.168.9.1 every minute"
|
||||
|
||||
pidfile="/run/ping_check.pid"
|
||||
|
||||
start() {
|
||||
ebegin "Starting ping_check service"
|
||||
start-stop-daemon --start --background --make-pidfile --pidfile $pidfile --exec /bin/sh -- -c "while true; do ping -c 1 192.168.9.1; sleep 60; done"
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ping_check service"
|
||||
start-stop-daemon --stop --pidfile $pidfile
|
||||
eend $?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user