Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic openrc init file for traefik (/etc/init.d/traefik)
#!/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