Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1. [program:program_name]
  2. command=python /home/hoge/hoge.py some param
  3. startsecs = 5
  4. user = root
  5. redirect_stderr = true
  6. stderr_logfile = /var/log/supervisor/program/hoge-stderr.log
  7. stdout_logfile = /var/log/supervisor/program/hoge-stdout.log
  8.  
  9. [supervisord]
  10. http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
  11. http_port=0.0.0.0:8888 ; (alternately, ip_address:port specifies AF_INET)
  12. ;http_port=127.0.0.1:9001 ; (alternately, ip_address:port specifies AF_INET)
  13. ;sockchmod=0700 ; AF_UNIX socketmode (AF_INET ignore, default 0700)
  14. ;sockchown=nobody.nogroup ; AF_UNIX socket uid.gid owner (AF_INET ignores)
  15. ;umask=022 ; (process file creation umask;default 022)
  16. logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
  17. logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
  18. logfile_backups=10 ; (num of main logfile rotation backups;default 10)
  19. loglevel=info ; (logging level;default info; others: debug,warn)
  20. pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
  21. nodaemon=false ; (start in foreground if true;default false)
  22. minfds=1024 ; (min. avail startup file descriptors;default 1024)
  23. minprocs=200 ; (min. avail process descriptors;default 200)
  24.  
  25. ;nocleanup=true ; (don't clean up tempfiles at start;default false)
  26. ;http_username=user ; (default is no username (open system))
  27. ;http_password=123 ; (default is no password (open system))
  28. ;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP)
  29. ;user=chrism ; (default is current user, required if root)
  30. ;directory=/tmp ; (default is not to cd during start)
  31. ;environment=KEY=value ; (key value pairs to add to environment)
  32.  
  33. ;[unix_http_server]
  34. ;file = /tmp/supervisor.sock
  35. ;chmod = 0777
  36. ;chown = dev:dev
  37.  
  38. [supervisorctl]
  39. serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL for a unix socket
  40. ;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
  41. ;serverurl=http://127.0.0.1:3331 ; use an http:// url to specify an inet socket
  42. ;username=chris ; should be same as http_username if set
  43. ;password=123 ; should be same as http_password if set
  44. ;prompt=mysupervisor ; cmd line prompt (default "supervisor")
  45.  
  46.  
  47. ; App appname Program ================================
  48. ; hoge 3
  49. [program:hoge_appname]
  50. command=python /home/username/work/some_program.py start 3 demo_appname /var/www/django/demo/appname/appname
  51. startsecs = 5
  52. user = root
  53. redirect_stderr = true
  54. stderr_logfile = /var/log/supervisor/Program/hoge_appname-stderr.log
  55. stdout_logfile = /var/log/supervisor/Program/hoge_appname-stdout.log
  56.  
  57. ; bar 4
  58. [program:bar_appname]
  59. command=python /home/username/work/some_program.py start 4 demo_appname /var/www/django/demo/appname/appname
  60. startsecs = 5
  61. user = root
  62. redirect_stderr = true
  63. stderr_logfile = /var/log/supervisor/Program/bar_appname-stderr.log
  64. stdout_logfile = /var/log/supervisor/Program/bar_appname-stdout.log
  65.  
  66.  
  67. ; appnametwo Program ================================
  68. ; hoge
  69. [program:hoge_appnametwo]
  70. command=python /home/username/work/some_program.py start 3 demo_appnametwo /var/www/django/demo/appnametwo/appname
  71. startsecs = 5
  72. user = root
  73. redirect_stderr = true
  74. stderr_logfile = /var/log/supervisor/Program/hoge_appnametwo-stderr.log
  75. stdout_logfile = /var/log/supervisor/Program/hoge_appnametwo-stdout.log
  76.  
  77.  
  78. ; bar 4
  79. [program:bar_appnametwo]
  80. command=python /home/username/work/some_program.py start 4 demo_appnametwo /var/www/django/demo/appnametwo/appname
  81. startsecs = 5
  82. user = root
  83. redirect_stderr = true
  84. stderr_logfile = /var/log/supervisor/Program/bar_appnametwo-stderr.log
  85. stdout_logfile = /var/log/supervisor/Program/bar_appnametwo-stdout.log
  86.  
  87.  
  88.  
  89. ; The below sample program section shows all possible program subsection values,
  90. ; create one or more 'real' program: sections to be able to control them under
  91. ; supervisor.
  92.  
  93. ;[program:theprogramname]
  94. ;command=/bin/cat ; the program (relative uses PATH, can take args)
  95. ;priority=999 ; the relative start priority (default 999)
  96. ;autostart=true ; start at supervisord start (default: true)
  97. ;autorestart=true ; retstart at unexpected quit (default: true)
  98. ;startsecs=10 ; number of secs prog must stay running (def. 10)
  99. ;startretries=3 ; max # of serial start failures (default 3)
  100. ;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2)
  101. ;stopsignal=QUIT ; signal used to kill process (default TERM)
  102. ;stopwaitsecs=10 ; max num secs to wait before SIGKILL (default 10)
  103. ;user=chrism ; setuid to this UNIX account to run the program
  104. ;log_stdout=true ; if true, log program stdout (default true)
  105. ;log_stderr=true ; if true, log program stderr (def false)
  106. ;logfile=/var/log/cat.log ; child log path, use NONE for none; default AUTO
  107. ;logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
  108. ;logfile_backups=10 ; # of logfile backups (default 10)
  109.  
  110. echo_supervisord_conf > /etc/supervisord.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement