Gonçalo Cabrita

OpenRC Init Scripts

#linux

Init script for non-daemons

#!/sbin/openrc-run

command="/usr/bin/$RC_SVCNAME"
command_args="--some-flag"
command_background=true # if your binary is not daemonized
command_user=myuser:myuser
pidfile="/run/$RC_SVCNAME.pid"
description="Description of my service"
extra_started_commands="reload"

depend() {
	need net
	use logger
	after firewall
}

reload() {
    ebegin "Reloading ${RC_SVCNAME}"
    start-stop-daemon --signal HUP --pidfile "${pidfile}"
    eend $?
}