Advertisement
Guest User

itc_d.conf

a guest
Dec 19th, 2011
581
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.73 KB | None | 0 0
  1. ##This file should be placed in /etc/init
  2. ##and the following one-time commands should be run to initialize the config:
  3. ##      sudo initctl reload-configuration
  4. ##      sudo start itc_d
  5.  
  6. description "upstart config to run ~/applications/systems/itc_d.py as an OS service."
  7. author "Corey M. - 12/2011"
  8. version "1.1"
  9.  
  10. pre-start script
  11.         echo 'checking sanity...'
  12.         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$
  13.         mountpoint -q /var/www/uslonsnas001 || { echo 'Error: mountpoint /var/www/uslonsnas001 is not mounted! \n stopping init'; stop; exit 0; }
  14.         echo 'completed sanity check'
  15.         echo 'starting service - itc_.py...'
  16. end script
  17.  
  18. start on (net-device-up
  19.           and (mountall
  20.           and runlevel [2534]))
  21. stop on runlevel [!2534]
  22.  
  23. console output
  24.  
  25. #This is necessary to fetch the resulting forked pid since upstart
  26. #does not otherwise know that itc_d.py will daemonize itself and fork twice
  27. #resulting in 2 new pids (the second being used to host the process)
  28. expect daemon
  29.  
  30. #Whenever the main script/exec exits, without the goal of the job having
  31. #been changed to stop, the job will be started again. This includes running
  32. #the pre-start and post-start stanzas.
  33. respawn
  34.  
  35. #Runs the job's processes with a working directory in the specified
  36. #directory instead of the root of the filesystem.
  37.  #chdir /home/lv_admin/applications/systems
  38.  
  39. #Stanza that allows the specification of a single-line command to run.
  40. exec /home/lv_admin/applications/systems/itc_d.py
  41.  
  42. post-start script
  43.         status itc_d
  44. end script
  45.  
  46. post-stop script
  47.         echo 'stopped service - itc_.py'
  48. end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement