It’s been a long time since the last time I checked the available software for managing long running processes. Software in this particular area has evolved and, after some research and testing on a virtual machine, I tried to install supervisord in a CentOS 5.6 box. Unfortunately, no RPM package exists for the latest 3.X version, so I decided to go through the procedure to rebuild the supervisor RPM from the Fedora development tree, since v3.X has some really cool features I cannot do without.
If you haven’t built an RPM package before, you will need to go through a simple procedure in order to prepare an RPM building environment. It is highly recommended that you build your packages in a separate box, dedicated to this kind of work, and also use a typical user and not root for building. So, let’s get the source RPM of supervisord from a Fedora Rawhide mirror:
The simplest way to build an RPM for our CentOS release is to use the
--rebuild option of
rpmbuild --rebuild supervisor-3.0-0.4.a10.fc16.src.rpm
Wait a few seconds for it to finish and then your binary RPM package will be in
To satisfy dependencies, you will also need the package python-meld3. So, download and rebuild it:
wget ftp://ftp.cc.uoc.gr/mirrors/linux/fedora/linux/development/rawhide/source/SRPMS/python-meld3-0.6.7-4.fc16.src.rpm rpmbuild --rebuild python-meld3-0.6.7-4.fc16.src.rpm
Having built RPM packages for supervisor and python-meld3, you can now transfer them to a testing box and install them:
yum localinstall /path/to/supervisor.rpm /path/to/python-meld3 yum install python-elementtree
We also installed elementtree as this is a dependency missing from the supervisor spec file (note to self: file a bug report).
Finally, try to start supervisord:
Surprisingly, it complains about the missing elementtree!
Starting supervisord: Traceback (most recent call last): File "/usr/bin/supervisord", line 5, in ? from pkg_resources import load_entry_point File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2479, in ? working_set.require(__requires__) File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 585, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 483, in resolve raise DistributionNotFound(req) # put more info here pkg_resources.DistributionNotFound: elementtree
Checking the requirements file at:
/usr/lib/python2.4/site-packages/supervisor-3.0a10-py2.4.egg-info/requires.txt there are no special version requirements:
meld3 >= 0.6.5 elementtree [iterparse] cElementTree >= 1.0.2
After some investigation on the supervisor-users mailing list, I found a message that indicated that setuptools.setup() should be used instead of distutils.core.setup() in the setup.py script.
So, the dependency resolution depends on the way the package has been installed! I didn’t even bother to patch setup.py… Knowing that the dependencies are correctly installed, I commented out the
elementtree line and also the
meld3 line as this caused the same error.
/usr/lib/python2.4/site-packages/supervisor-3.0a10-py2.4.egg-info/requires.txt file looks like this:
#meld3 >= 0.6.5 #elementtree [iterparse] cElementTree >= 1.0.2
Now supervisor starts without errors:
# /etc/init.d/supervisord start Starting supervisord: [ OK ] # cat /var/log/supervisor/supervisord.log 2011-05-12 02:56:08,221 CRIT Supervisor running as root (no user in config file) 2011-05-12 02:56:08,267 INFO RPC interface 'supervisor' initialized 2011-05-12 02:56:08,267 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2011-05-12 02:56:08,271 INFO daemonizing the supervisord process 2011-05-12 02:56:08,272 INFO supervisord started with pid 21337
This is what it takes to run supervisord 3 in CentOS 5 or RHEL 5. If you have any comments and suggestions, please let me know in the comments below.
Running supervisor 3 on CentOS 5 by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Permissions beyond the scope of this license may be available at Licensing Information.
Copyright © 2011 - Some Rights Reserved