So, for a project I needed to get something running in order to insure memcached would keep on running. The (for me) natural choice for this was daemontools (0.76 at time of writing).
There are a couple of things you have to pay attention to, in order to get this going on RHEL 6. (and I suppose many other Linux distro’s)
Phase 1 – get the source and compile it
get the source tarball here (note: this might not be the current version anymore!) and download it to /usr/local/src
- unpack it with tar -zvxf daemontools-0.76.tar.gz and cd into admin/daemontools-0.76.
- edit src/conf-cc and add ‘-include /usr/include/errno.h’ at the end of the line. (anywhere is fine, really)
- run package/install
this should give you the needed files in /command and an existing /service
Phase 2 – fixing startup
Daemontools requires a somewhat different approach to starting up then you might be used to. ( the most common way being /etc/init.d/<name>, and using chkconfig to influence when it starts). Daemontools should be started on boot, and init must be told to restart it when it dies. This ensures continued operation. The installer you ran in phase 1, took care of this by adding a line in /etc/inittab, but that’s an old method, and for the sake of continued operation (and working straight away) we’ll use the new method:
- Remove the added line from /etc/inittab.
- cd /etc/init
- create a new file called svscan.conf, and put the following contents in:
start on runlevel [345]
respawn
exec /command/svscanboot
now, tell init, it should re-read it’s configuration, and then start svscanboot:
- initctl reload-configuration
- initctl start svscan
if you check now, you should see a happily running svscan, and daemontools is ready to kick some:
2676 ? Ss 0:00 /bin/sh /command/svscanboot 2678 ? S 0:00 \_ svscan /service
Enjoy! I hope this little post was helpful.
many thanks,i am building qmail on my rhel6,now it works,thanks.
You’re welcome. Glad I could be of service to someone. 🙂
Cheers, just ran into this problem and your quick and accurate guidance helped get things working 🙂
Glad to hear I could be of some help mate 🙂
I do believe on Centos 6..
starting on runlevel [12345]
caused an unexpected kernel panic on shutdown/restart..
some bug about the filesystem not being mounted.. etc etc..
Anyways..
starting on runlevel [3] only
fixed my problem
I realise this is for version 5, but it shows the centos mentality of runlevels
http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-boot-init-shutdown-sysv.html
Good point. I changed it to [345], which covers the only proper run-levels.
Thanks for this – just been installing my first RH6 server with daemontool and this saved me a lot of time!
glad to be of help! 🙂
very helpful, thanks!
You’re welcome! 🙂