Coder Social home page Coder Social logo

initscripts's Introduction

Supervisor

Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems.

Supported Platforms

Supervisor has been tested and is known to run on Linux (Ubuntu), Mac OS X (10.4, 10.5, 10.6), and Solaris (10 for Intel) and FreeBSD 6.1. It will likely work fine on most UNIX systems.

Supervisor will not run at all under any version of Windows.

Supervisor is intended to work on Python 3 version 3.4 or later and on Python 2 version 2.7.

Documentation

You can view the current Supervisor documentation online in HTML format . This is where you should go for detailed installation and configuration documentation.

Reporting Bugs and Viewing the Source Repository

Please report bugs in the GitHub issue tracker.

You can view the source repository for supervisor via https://github.com/Supervisor/supervisor.

Contributing

We'll review contributions from the community in pull requests on GitHub.

initscripts's People

Contributors

3rwww1 avatar brendanmaguire avatar cameronkerrnz avatar djs avatar ender672 avatar et-cs avatar garymonson avatar gsmethells avatar harobed avatar khsing avatar loostro avatar mayuroks avatar mcdonc avatar mingalevme avatar mnaberez avatar mo-han avatar philfreo avatar sbilly avatar sbilly-co avatar seocam avatar theaxiom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

initscripts's Issues

Ignore PIDFILE

Supervisord create /tmp/supervisord.pid all times. It is doesn't matter of settings in this script.

how to start supervisor in current dir of the program

my program directory is like:
-- program/
---- app (binary file)
---- config/
---- supervisord.conf
---- ubuntu-supervisord.sh

app need to read several files in the 'config' directory.
the command in supervisord.conf is:
./app

the command following works fine :
$ supervisord -c supervisord.conf

so i set DAEMON_OPTS as '-c supervisord.conf'
BUT, i cannot start supervisord using ubuntu-supervisord.sh(ubuntu initscript)
it cannot find the .conf file. Then i set DAEMON_OPTS as /a/absolute/path/to/supervisord.conf, but it can't work too. It failed to find app or files in the 'config' directory.

How can i do? tks

Use service detected unhandled Python exception

supervisord.service

# supervisord service for systemd (CentOS 7.0+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon

[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /home/supervisord.conf
ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown
ExecReload=/usr/bin/supervisorctl $OPTIONS reload
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

supervisord.conf

[supervisord]

[supervisorctl]
serverurl = unix://supervisord.sock

[unix_http_server]
file = /tmp/supervisord.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:cti]
process_name = cti-%(process_num)s
pidfile=/var/run/supervisord.pid
command=/usr/bin/python -m /home/source/oms/cti2/run
autostart=true
autorestart=true
stderr_logfile=/home/source/oms/cti2/log/long.err.log
numprocs = 1
numprocs_start = 8000

but, running manual supervisord -c /home/supervisord.conf no problem.

What is wrong?

how do i start php7.0-fpm with supervisord?

I am trying to build a dockerized ubuntu 16.04lts with apache2 and nginx with php7.0-fpm

commands i have used but did not work

[program:php-fpm7.0]
command = /usr/sbin/php-fpm7.0 --daemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

and

[program:php-fpm7.0]
command = /usr/sbin/php-fpm7.0 -c /etc/php/7.0/fpm/php-fpm.conf
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

and

[program:php-fpm7.0]
command = /usr/sbin/php-fpm7.0 -c /etc/php/7.0/fpm
autostart=true
autorestart=true
priority=5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

below are the error logs from docker when i try to run as containers

from the apache2 container

2016-06-26 20:04:21,488 CRIT Set uid to user 0
2016-06-26 20:04:21,496 INFO RPC interface 'supervisor' initialized
2016-06-26 20:04:21,496 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-06-26 20:04:21,496 INFO supervisord started with pid 8
2016-06-26 20:04:22,499 INFO spawned: 'php-fpm7.0' with pid 11
2016-06-26 20:04:22,500 INFO spawned: 'apache2' with pid 12
2016-06-26 20:04:22,571 INFO exited: apache2 (exit status 0; not expected)
[26-Jun-2016 20:04:22] ERROR: Unable to create the PID file (/run/php/php7.0-fpm.pid).: No such file or directory (2)
[26-Jun-2016 20:04:22] ERROR: FPM initialization failed
2016-06-26 20:04:22,609 INFO exited: php-fpm7.0 (exit status 78; not expected)
2016-06-26 20:04:23,611 INFO spawned: 'php-fpm7.0' with pid 74
2016-06-26 20:04:23,613 INFO spawned: 'apache2' with pid 75
httpd (pid 16) already running
2016-06-26 20:04:23,669 INFO exited: apache2 (exit status 0; not expected)
[26-Jun-2016 20:04:23] ERROR: Unable to create the PID file (/run/php/php7.0-fpm.pid).: No such file or directory (2)
[26-Jun-2016 20:04:23] ERROR: FPM initialization failed
2016-06-26 20:04:23,694 INFO exited: php-fpm7.0 (exit status 78; not expected)
2016-06-26 20:04:25,698 INFO spawned: 'php-fpm7.0' with pid 79
2016-06-26 20:04:25,700 INFO spawned: 'apache2' with pid 80
httpd (pid 16) already running
2016-06-26 20:04:25,758 INFO exited: apache2 (exit status 0; not expected)
[26-Jun-2016 20:04:25] ERROR: Unable to create the PID file (/run/php/php7.0-fpm.pid).: No such file or directory (2)
[26-Jun-2016 20:04:25] ERROR: FPM initialization failed
2016-06-26 20:04:25,784 INFO exited: php-fpm7.0 (exit status 78; not expected)
2016-06-26 20:04:28,788 INFO spawned: 'php-fpm7.0' with pid 84
2016-06-26 20:04:28,789 INFO spawned: 'apache2' with pid 85
httpd (pid 16) already running
2016-06-26 20:04:28,847 INFO exited: apache2 (exit status 0; not expected)
2016-06-26 20:04:28,857 INFO gave up: apache2 entered FATAL state, too many start retries too quickly
[26-Jun-2016 20:04:28] ERROR: Unable to create the PID file (/run/php/php7.0-fpm.pid).: No such file or directory (2)
[26-Jun-2016 20:04:28] ERROR: FPM initialization failed
2016-06-26 20:04:28,872 INFO exited: php-fpm7.0 (exit status 78; not expected)
2016-06-26 20:04:29,873 INFO gave up: php-fpm7.0 entered FATAL state, too many start retries too quickly

and

from the nginx container

2016-06-26 11:19:02,307 CRIT Set uid to user 0
2016-06-26 11:19:02,320 INFO RPC interface 'supervisor' initialized
2016-06-26 11:19:02,320 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2016-06-26 11:19:02,321 INFO supervisord started with pid 14
2016-06-26 11:19:03,323 INFO spawned: 'php7.0-fpm' with pid 17
2016-06-26 11:19:03,324 INFO spawned: 'nginx' with pid 18
[26-Jun-2016 11:19:03] ERROR: unable to bind listening socket for address '/run/php/php7.0-fpm.sock': No such file or directory (2)
[26-Jun-2016 11:19:03] ERROR: FPM initialization failed
2016-06-26 11:19:03,406 INFO exited: php7.0-fpm (exit status 78; not expected)
2016-06-26 11:19:04,409 INFO spawned: 'php7.0-fpm' with pid 20
2016-06-26 11:19:04,409 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[26-Jun-2016 11:19:04] ERROR: unable to bind listening socket for address '/run/php/php7.0-fpm.sock': No such file or directory (2)
[26-Jun-2016 11:19:04] ERROR: FPM initialization failed
2016-06-26 11:19:04,465 INFO exited: php7.0-fpm (exit status 78; not expected)
2016-06-26 11:19:06,470 INFO spawned: 'php7.0-fpm' with pid 21
[26-Jun-2016 11:19:06] ERROR: unable to bind listening socket for address '/run/php/php7.0-fpm.sock': No such file or directory (2)
[26-Jun-2016 11:19:06] ERROR: FPM initialization failed
2016-06-26 11:19:06,527 INFO exited: php7.0-fpm (exit status 78; not expected)
2016-06-26 11:19:09,532 INFO spawned: 'php7.0-fpm' with pid 30
[26-Jun-2016 11:19:09] ERROR: unable to bind listening socket for address '/run/php/php7.0-fpm.sock': No such file or directory (2)
[26-Jun-2016 11:19:09] ERROR: FPM initialization failed
2016-06-26 11:19:09,592 INFO exited: php7.0-fpm (exit status 78; not expected)
2016-06-26 11:19:10,594 INFO gave up: php7.0-fpm entered FATAL state, too many start retries too quickly
2016/06/26 11:19:13 [info] 19#19: *1 client closed connection while waiting for request, client: 192.168.99.1, server: 0.0.0.0:80

So my question is how do i correctly use supervisord to start php7.0-fpm/php-fpm7.0 in the docker containers.

Also understand that when i login into these containers and run this command then it starts to work!..so what am i doing wrong

service php7.0-fpm start

when i run the above command after fpm fails to start when container is ran, then it works. But how do i do this with supervisord? so i dont need to manually start with init.d

Ubuntu specific initd script fails

Hi, supervisor's apt package installs executables under /usr/bin but pip installs them under /usr/local/bin thus the startup script fails. I can provide a PR too.

issue trying to start a supervisor using supervisorctl

Hi

When I tried to start a supervisor I got this error

supervisorctl start XXXX

XXXX ERROR (spawn error)

I am using supervisor version 3.3.0

This is log_

2016-07-22 20:06:52,008 INFO exited: website (exit status 0; not expected)
2016-07-22 20:06:52,009 DEBG received SIGCLD indicating a child quit
2016-07-22 20:06:55,019 INFO spawned: 'website' with pid 5141
2016-07-22 20:06:55,034 DEBG 'website' stdout output:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

2016-07-22 20:06:55,036 DEBG fd 7 closed, stopped monitoring <POutputDispatcher at 140406952237464 for <Subprocess at 140406952304720 with name website in state STARTING> (stdout)>
2016-07-22 20:06:55,036 INFO exited: website (exit status 0; not expected)
2016-07-22 20:06:55,036 DEBG received SIGCLD indicating a child quit
2016-07-22 20:06:55,037 INFO gave up: website entered FATAL state, too many start retries too quickly

Freebsd script

Hello, It seems you didn't include the init script for FreeBSD.

I have come up with the one below which I save in /usr/local/etc/rc.d before enabling in /etc/rc.conf, but it doesn't seem to work well.


#!/bin/sh

. /etc/rc.subr

name="supervisord"
rcvar=`set_rcvar`

command="/usr/local/bin/${name}"
command_args="-c /etc/supervisord.conf"

load_rc_config $name
run_rc_command "$1

[Debian] Systemd loading configuration twice

Quick background

  • Running a Debian-like distribution and installed supervisor via apt-get.
  • Using supervisor to run a Python Tornado Web Server on a total of 4 ports which is load-balanced via an Nginx reverse proxy

Problem

I am seeing 2 sets of my Python configuration for a total of 8 python processes, 2 for each of the 4 ports that I run my web-app on. 1 of these sets seems to randomly be started and not managed by supervisor. I have no idea where this set could be started from or how to properly manage it.

For example

Checking the supervisor service

sudo systemctl status supervisor

You can see there is 8 distinct processes, but 2 sets of port numbers (8000-8003).

● supervisor.service - LSB: Start/stop supervisor
   Loaded: loaded (/etc/init.d/supervisor)
   Active: active (running) since Wed 2015-12-23 18:19:58 CST; 13min ago
  Process: 754 ExecStart=/etc/init.d/supervisor start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/supervisor.service
           ├─760 /usr/bin/python /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
           ├─765 python server.py --port=8002
           ├─770 python server.py --port=8003
           ├─771 python server.py --port=8000
           ├─772 python server.py --port=8001
           ├─777 python server.py --port=8001
           ├─778 python server.py --port=8002
           ├─779 python server.py --port=8003
           └─780 python server.py --port=8000
Can see the same thing with ps

sudo ps -aux | egrep "supervisor|python"

root       760  0.2  2.7  14496  9892 ?        Ss   18:19   0:01 /usr/bin/python /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
www-data   765  0.3  3.9  16860 14156 ?        S    18:19   0:02 python server.py --port=8002
www-data   770  0.3  3.9  16872 14216 ?        S    18:19   0:02 python server.py --port=8003
www-data   771  0.3  3.8  16872 14008 ?        S    18:19   0:02 python server.py --port=8000
www-data   772  0.3  3.9  16860 14220 ?        S    18:19   0:02 python server.py --port=8001
www-data   777  0.0  3.4  17116 12420 ?        S    18:20   0:00 python server.py --port=8001
www-data   778  0.0  3.0  16860 11184 ?        S    18:20   0:00 python server.py --port=8002
www-data   779  0.0  3.1  16872 11264 ?        S    18:20   0:00 python server.py --port=8003
www-data   780  0.0  3.4  17128 12456 ?        S    18:20   0:00 python server.py --port=8000
Stop supervisor via systemctl
sudo systemctl stop supervisor
sudo systemctl status supervisor
● supervisor.service - LSB: Start/stop supervisor
   Loaded: loaded (/etc/init.d/supervisor)
   Active: inactive (dead)

sudo supervisorctl status
unix:///var/run/supervisor.sock no such file

So, supervisor has destroyed the socket file, BUT running ps again shows

sudo ps -aux | egrep "supervisor|python"

www-data   777  0.0  3.4  17116 12420 ?        S    18:20   0:00 python server.py --port=8001
www-data   778  0.0  3.0  16860 11184 ?        S    18:20   0:00 python server.py --port=8002
www-data   779  0.0  3.1  16872 11264 ?        S    18:20   0:00 python server.py --port=8003
www-data   780  0.0  3.4  17128 12456 ?        S    18:20   0:00 python server.py --port=8000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.