Tag: Supervisord

  • How to Install Supervisord on CentOS 7

    How to Install Supervisord on CentOS 7

    Supervisor is a program used to monitor and control programs. It can auto startup application on server boot time, and restart if the application fails.

    http://supervisord.org

    To install supervisors on CentOS 7, first, enable epel repository.

    yum install -y epel-release
    

    Once EPEL repository is enabled, you can install supervisors with the yum command

    yum install -y supervisor
    

    Enable supervisord to start on boot, run

    systemctl enable supervisord
    

    Start supervisord

    systemctl start supervisord
    

    To start a python application on boot time, I created file

    vi /etc/supervisord.d/telegram-bot.ini
    

    With the following content

    [program:telegram_bot]
    command=/root/bots/telegram_bot/bot.py
    directory=/root/bots/telegram_bot
    ;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
    numprocs=1
    autostart=true
    autorestart=true
    stdout_logfile=/var/log/telegram-bot.log
    stdout_logfile_maxbytes=1MB
    stdout_logfile_backups=10
    stdout_capture_maxbytes=1MB
    stdout_events_enabled=false
    stderr_logfile=/var/log/telegram-bot-error.log
    stderr_logfile_maxbytes=1MB
    stderr_logfile_backups=10
    stderr_capture_maxbytes=1MB
    stderr_events_enabled=false
    

    Started application with

    supervisorctl reload
    

    See supervisord

  • supervisorctl

    supervisorctl is used to control supervisord.

    To reload all monitored processes, run

    supervisorctl reload
    

    To restart a monitored process, run

    supervisorctl restart PROCESS_NAME_HERE
    

    See supervisord

  • Supervisord

    supervisord is a program that allows you to monitor and control processes. supervisord runs processes as its sub-process and can restart a process if it crashes.

    supervisord is the server. supervisorctl is the client program.

    You can find more info at

    supervisorctl
    How to Install Supervisord on CentOS 7

    To install on CentOS run

    yum -y install supervisor
    

    On Ubuntu/Debian

    apt install -y supervisor
    

    Config files are stored in

    /etc/supervisor/
    

    Your own application configurations at

    /etc/supervisor/conf.d/
    

    some useful commands

    supervisorctl reread
    supervisorctl update
    

    To restart all services, run

    supervisorctl restart all
    

    Start x11vnc with supervisord

    See autostart