Created
July 10, 2021 21:32
-
-
Save frederickding/3602e79151b087c2d9d046755164b5c5 to your computer and use it in GitHub Desktop.
Basic openrc init file for traefik (/etc/init.d/traefik)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/openrc-run | |
LOG_FILE=/var/log/traefik.log | |
name="traefik" | |
command="/usr/local/bin/traefik" | |
command_args=" --log" | |
pidfile="/run/${RC_SVCNAME}.pid" | |
output_log=${LOG_FILE} | |
error_log=${LOG_FILE} | |
depend() { | |
need net | |
} | |
start() { | |
ebegin "Starting Traefik" | |
start-stop-daemon --background --start \ | |
--exec "${command}" \ | |
--make-pidfile --pidfile "${pidfile}" \ | |
-- ${command_args} | |
eend $? | |
} | |
stop() { | |
ebegin "Stopping Traefik" | |
start-stop-daemon --stop --exec "${command}" \ | |
--pidfile "${pidfile}" | |
eend $? | |
} | |
set -o allexport | |
if [ -f /usr/local/bin/traefik-env.sh ]; then source /usr/local/bin/traefik-env.sh; fi | |
set +o allexport |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment