X

How To Upgrade Supervisord In CentOS 6

Supervisord is a simple system for process management and monitoring.  It can start processes or restart them when they crash. The repositories for CentOS 6 for supervisor are quite old (version 2.x) which do not contain the latest features.  You can read more on the project’s website.  If you already have an existing installation installed through yum this guide provides the steps to update it to a more recent version.  We are going to remove the old package and install a new one through python’s pip.

Remove the Old Files

Stop the currently running version

/etc/init.d/supervisord stop

Make a backup directory to hold the temporary files

mkdir ~/supervisord-backup

Copy the configuration file

cp /etc/supervisord.conf supervisvor-backup/

Copy the init script

cp /etc/init.d/supervisord supervisvor-backup/

Remove the yum package

yum -y remove supervisor

Install The New Supervisord

Install pip (if you do not already have it)

yum -y install python-pip

Install the updated version through pip

pip install supervisor

Put the configuration file back into place

cp supervisvor-backup/supervisord.conf /etc/supervisord.conf

Put the init script back into place

cp  supervisvor-backup/supervisord /etc/init.d/supervisord

Go ahead and restart the script

/etc/init.d/supervisord restart

Configuration Changes after upgrade

I ran into a couple errors when updating the package. After doing above the first error I got was:

# supervisorctl
unix:///var/tmp/supervisor.sock refused connection

This was resolved by adding the following to /etc/supervisor.conf:

[unix_http_server]
file=/var/tmp/supervisor.sock

I also received this error:

# supervisorctl
Sorry, supervisord responded but did not recognize the supervisor namespace commands that supervisorctl uses to control it. Please check that the [rpcinterface:supervisor] section is enabled in the configuration file (see sample.conf).

This was resolved by adding the following to /etc/supervisor.conf:

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

You should now have completed the upgrade now have the most recent version running on your server.

 

LinuxAdmin.io
0 0 votes
Article Rating
LinuxAdmin.io:

View Comments (3)

  • For those installing supervisord 3.x on CentOS 6. Instead of copying /etc/supervisord.conf for the default configuration settings, make a separate backup of your custom configuration settings. Then after running pip install supervisor, you can run sudo echo_supervisord_conf > /etc/supervisord.conf This will fix the issues mentioned in the "Changes After Upgrade" section, as well as remove the invalid configuration settings from the CentOS 6 supervisord 2.x configuration.

Related Post