Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (38 sloc) 1002 Bytes
# <name of daemon>
#
#
# <Longer description>
#
#
description "Derp"
author "Herp Herp D Derp"
# The below "start on" line controls when it starts up. There are many options available.
start on (local-filesystems and net-device-up)
#Ditto for stop on.
stop on runlevel [016]
respawn
respawn limit 5 30
env uid=<user to run as>
env gid=<group to run as>
env umask=000
#A more insane start condition. This one is based off starting lightdm
start on ((filesystem
and runlevel [!06]
and started dbus
and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
or stopped udev-fallback-graphics))
or runlevel PREVLEVEL=S)
stop on runlevel [016]
#The below lines are run as a shell script on start, and the started binaries killed on stop.
script
if [ "$RUNLEVEL" = S -o "$RUNLEVEL" = 1 ]
then
# Single-user mode
exit 0
fi
exec <some binary>
end script
#This runs after stop
post-stop script
rm /some/tmp/files/
end script