Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##This file should be placed in /etc/init
- ##and the following one-time commands should be run to initialize the config:
- ## sudo initctl reload-configuration
- ## sudo start itc_d
- description "upstart config to run ~/applications/systems/itc_d.py as an OS service."
- author "Corey M. - 12/2011"
- version "1.1"
- pre-start script
- echo 'checking sanity...'
- test -x /home/lv_admin/applications/systems/itc_d.py || { echo 'Error: file itc_d.py does not exist or is not executable! \n stopping init'; stop; exi$
- mountpoint -q /var/www/uslonsnas001 || { echo 'Error: mountpoint /var/www/uslonsnas001 is not mounted! \n stopping init'; stop; exit 0; }
- echo 'completed sanity check'
- echo 'starting service - itc_.py...'
- end script
- start on (net-device-up
- and (mountall
- and runlevel [2534]))
- stop on runlevel [!2534]
- console output
- #This is necessary to fetch the resulting forked pid since upstart
- #does not otherwise know that itc_d.py will daemonize itself and fork twice
- #resulting in 2 new pids (the second being used to host the process)
- expect daemon
- #Whenever the main script/exec exits, without the goal of the job having
- #been changed to stop, the job will be started again. This includes running
- #the pre-start and post-start stanzas.
- respawn
- #Runs the job's processes with a working directory in the specified
- #directory instead of the root of the filesystem.
- #chdir /home/lv_admin/applications/systems
- #Stanza that allows the specification of a single-line command to run.
- exec /home/lv_admin/applications/systems/itc_d.py
- post-start script
- status itc_d
- end script
- post-stop script
- echo 'stopped service - itc_.py'
- end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement