I'm trying to use runit on my SheevaPlug running Ubuntu 9.04 Jaunty. There is a helpful tutorial at TechRepublic (Use runit to supervise Linux services) that walks through the process of setting it up, but it says:

edit /etc/inittab and add:

SV:123456:respawn:/sbin/runsvdir-start

to the bottom of the file. This will start (and re-start, if it ever exits) the /sbin/runsvdir-start program.

I found a post saying that inittab isn't used in some ubuntu versions. I can install/use chkconfig or update-rc.d, but I don't really know what I'm doing or how to translate the above statement into arguments for either tool. Any pointers?

link|improve this question
feedback

1 Answer

Jaunty is no longer supported (it reached End-Of-Life last month), so I would recommend upgrading (go to 10.04 if you need a long-lived system). However, when you upgrade to a version that uses Upstart, you can create a file in the /etc/init directory to do what you need. For example, create /etc/init/sheevaplug.conf:

start on stopped rc RUNLEVEL=[123456]
stop on runlevel [!123456]

respawn
exec /sbin/runsvdir-start

That is a direct translation of the inittab line you gave, and should behave similarly with Upstart. You can start and stop it with service sheevaplug start and service sheevaplug stop, etc.

link|improve this answer
Is there actually any point in using runit, as upstart already supports supervising? (Maybe runit does it better, I've never used it.) – JanC Nov 3 '10 at 17:37
Yeah, I don't know much about runit. If there is a better path to use on the exec line, go for it. Upstart will track its lifetime. – Kees Cook Nov 3 '10 at 17:41
So it turns out that upstart has been in Ubuntu since 6.10, so it's already installed on my system. However, I don't have an /etc/init directory. Can I just create the folder (and the script inside it) and upstart will detect and run it? Since I don't have to use runit, I'll just modify the script to call my executable directly. – Pat Nov 5 '10 at 15:05
Apparently, runit has the ability to redirect output from a script to a logger service (blogs.techrepublic.com.com/opensource/?p=207&tag=rbxccnbtr1). Do you know if upstart provides a similar mechanism? – Pat Nov 5 '10 at 15:06
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.