Skip to content

Instantly share code, notes, and snippets.

@JensRantil
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JensRantil/9644545 to your computer and use it in GitHub Desktop.
Save JensRantil/9644545 to your computer and use it in GitHub Desktop.
description "my application"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 360 180
setuid myuser
setgid mygroup
chdir /my/directory
exec /bin/sleep 60
post-start script
sleep 5
stop
exit 1
end script
/etc/init$ sudo start myapp # returns after 5 seconds
myapp start/running, process 27477
jrantil@myserver:/etc/init$ ps -ef|grep sleep
107 27477 1 0 16:56 ? 00:00:00 /bin/sleep 60
jrantil 27482 26900 0 16:56 pts/1 00:00:00 grep --color=auto sleep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment