12345678910111213141516171819202122232425262728 |
- description "cjdns startup script"
- author "Sergey Davidoff <shnatsel@gmail.com>"
- start on (local-filesystems and net-device-up IFACE!=lo)
- stop on runlevel [!2345]
- # respawn cjdns if it crashes, but no more than once in 180 seconds
- respawn
- respawn limit 2 300
- pre-start script
- if ! [ -s /etc/cjdroute.conf ]; then
- ( # start a subshell to avoid side effects of umask later on
- umask 077 # to create the file with 600 permissions without races
- /usr/bin/cjdroute --genconf > /etc/cjdroute.conf
- ) # exit subshell; umask no longer applies
- echo 'WARNING: A new cjdns cjdroute.conf file has been generated.'
- fi
- # If you need a non-standard setup, as described in
- # https://github.com/cjdelisle/cjdns#non-standard-setups,
- # you should add the commands to be run on every boot here.
- # You'll also have to add a "setuid" stanza to this file,
- # see http://upstart.ubuntu.com/cookbook/#setuid
- end script
- exec /usr/bin/cjdroute --nobg < /etc/cjdroute.conf
|