runit and supervised services on RHEL/CentOS 5
I’m sure I’ve mentioned this before, but I maintain a repository of packages for Red Hat Enterprise Linux 5 (arguably these could/should be in EPEL but I’ve not had time to get into the Fedora side of things as of yet… someone will beat me with a wet noodle, no doubt). It’s a very small set of packages so I don’t feel too awful about it.
Anyways, one of my favourite features in Annvix was being able to run the entire system out of runit (Annvix used runit in place of SysVinit). This gave us nicely supervised services using runit (much like DJB’s daemontools). Feeling crappy with the first day of a head cold, I spent some time today over lunch to get runit working with RHEL5. I had to re-tool the package since I don’t want it to replace SysVinit, but run under init and just supervise services (like sshd, exim, etc. — call me weird, but runit/daemontools makes a fantastic watchdog and with sshd running from tcpsvd, I get some nice ACLs to use as well).
At any rate, runit now installs and works properly. Sorry to anyone who wanted to use it (I’ve been meaning to do this for the last year, ever since I switched all of my servers over to CentOS). The runit package also comes with a bunch of run scripts; I’ve not tested them all yet so if you do end up using it and have issues, let me know. I did have to fix a few minor things in a few of them.
At any rate, I’ve chkconfig’d off a few services and have them running supervised now:
# srv --list|grep -v '-' service status pid started crond up 2737 04/07/2010 02:16:32 PM crond/log up 2735 04/07/2010 02:16:32 PM exim up 2747 04/07/2010 02:16:32 PM exim/log up 2746 04/07/2010 02:16:32 PM mdadm up 2738 04/07/2010 02:16:32 PM mdadm/log up 2736 04/07/2010 02:16:32 PM ntpd up 2733 04/07/2010 02:16:32 PM ntpd/log up 2731 04/07/2010 02:16:32 PM smartd up 2739 04/07/2010 02:16:32 PM smartd/log up 2734 04/07/2010 02:16:32 PM sshd up 2732 04/07/2010 02:16:32 PM sshd/log up 2730 04/07/2010 02:16:32 PM
One thing knocked off my TODO list. Replaced it with going to bed early tonight.
Chris McClimans
What version of the package should we look at if we don’t want to replace sysinit, and have it run along side the original centos 5.4 init?
Jan 17, 2011 @ 22:01:18vdanen
The latest version in the repository, runit-2.1.1-4.el5.avx runs alongside SysVinit and doesn’t replace it. I use it on my box and haven’t replaced all services, but I do run two different instances of dropbox with it, as well as crond, exim, mdadm, ntpd, smartd, and sshd.
Jan 20, 2011 @ 08:29:36David
This is about the only post I have found that discusses runit with CentOS. Quite interested in getting this working however your repo link is broken. Also want to ensure this is not going to cause any problems on system for existing init.
Apr 20, 2011 @ 10:13:17vdanen
The repo link is broken? Doesn’t seem broken to me.. http://repo.annvix.org/media/EL5/ — what’s broken?
No, it shouldn’t cause any problems. It doesn’t replace SysVinit, but allows you to run stuff supervised _and_ use SysVinit (init starts runit, runit starts whatever you tell it to; you just have to be sure that you “chkconfig sshd off” if you run sshd supervised).
Apr 20, 2011 @ 10:21:47Josh Toft
vdanen, you don’t have a closed tag; so the repo doesn’t show up properly in chrome, and most other browsers.
Apr 23, 2011 @ 18:25:42vdanen
I must be blind, but where are you talking about? The blog entry? The link there has a closed </a> tag. Or are you referring to somewhere else? (Sorry, I must sound really clueless but I don’t know where you are talking about…)
Apr 23, 2011 @ 19:43:54Josh Toft
the title tag for your repository isn’t closed.
Apr 23, 2011 @ 19:51:36Josh Toft
http://pastebin.com/qERu4t3E is how it’s showing in chrome
If you notice, the head is written twice, also take a look at lines 5 and 11. You have two titles declared.
Line 11, is the one with the unclosed title tag.
Lines… 1-8 are in conflict with 9-14
Apr 23, 2011 @ 19:55:43vdanen
Aha! I think I’ve found it. That really made it not load in Chrome?
Apr 23, 2011 @ 19:57:35Josh Toft
Chrome doesn’t fix broken html like firefox will.
And yes; loads like a peach
Apr 23, 2011 @ 20:00:51vdanen
Ok, now it’s fully fixed. There are no longer two <head> statements, etc. Likely I was busy or lazy or both. =)
Thanks for helping make me aware of that. Safari didn’t tell me there was anything wrong their either.
Apr 23, 2011 @ 20:40:23Jason Boxman
Thank you for this! I was about to do an install from sources. I much prefer RPMs.
Jun 30, 2011 @ 10:50:05