supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Converting from daemontools to runit
@ 2004-06-23 19:18 Lloyd Zusman
  2004-06-23 20:06 ` Charlie Brady
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Lloyd Zusman @ 2004-06-23 19:18 UTC (permalink / raw)


I'm currently using daemontools under FreeBSD (i.e., started via
rc.local) to manage a number of daemons.  I'd like to move all those
daemons to be under runit control, and I have some questions about
this.

Specifically, I'd like to know ...

1.  Can I simultaneously run daemontools and runit (via rc.local
    initiation)?  If so, I can then move each daemon one by one at my
    convenience.  Or would I have to shut down daemontools before runit
    can properly function, thereby requiring me to do this conversion
    for all my daemons in one fell swoop?

2.  Is there any howto-like documentation for converting an existing
    daemontools setup to be managed under runit?

3.  Are there, perhaps, any software tools that can automate or
    semi-automate the task of converting a daemontools setup to runit?

4.  (I guess I should have asked this first) are there any drawbacks to
    moving my daemons from daemontools control to runit?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Converting from daemontools to runit
  2004-06-23 19:18 Converting from daemontools to runit Lloyd Zusman
@ 2004-06-23 20:06 ` Charlie Brady
  2004-06-23 22:26   ` Lloyd Zusman
  2004-06-23 20:11 ` Charlie Brady
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Charlie Brady @ 2004-06-23 20:06 UTC (permalink / raw)
  Cc: supervision


On Wed, 23 Jun 2004, Lloyd Zusman wrote:

> Specifically, I'd like to know ...
> 
> 1.  Can I simultaneously run daemontools and runit (via rc.local
>     initiation)?  If so, I can then move each daemon one by one at my
>     convenience.

I can't think why not. You'll need separate service directories, of 
course.

> 2.  Is there any howto-like documentation for converting an existing
>     daemontools setup to be managed under runit?

If you are going to leave daemontools installed, you shouldn't need to do 
more than move the service directories. If you are going to uninstall 
daemontools, then you'll need to remove any use of daemontools components  
in the run and log/run scripts (e.g. you'll need to convert from multilog 
to svlogd).

> 3.  Are there, perhaps, any software tools that can automate or
>     semi-automate the task of converting a daemontools setup to runit?

You won't need tools. It shouldn't take you long. You'll need the
daemontools and runit documentation, and will need to consider each
service individually.

> 4.  (I guess I should have asked this first) are there any drawbacks to
>     moving my daemons from daemontools control to runit?

runit doesn't have an equivalent of tai64nlocal.

---
Charlie



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Converting from daemontools to runit
  2004-06-23 19:18 Converting from daemontools to runit Lloyd Zusman
  2004-06-23 20:06 ` Charlie Brady
@ 2004-06-23 20:11 ` Charlie Brady
  2004-06-23 20:24 ` Charlie Brady
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Charlie Brady @ 2004-06-23 20:11 UTC (permalink / raw)
  Cc: supervision


Lloyd, please contact me off list - I want to know why your mail server 
rejected my mail. [Please adjust it so that it gives a reason.]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Converting from daemontools to runit
  2004-06-23 19:18 Converting from daemontools to runit Lloyd Zusman
  2004-06-23 20:06 ` Charlie Brady
  2004-06-23 20:11 ` Charlie Brady
@ 2004-06-23 20:24 ` Charlie Brady
  2004-06-23 20:42 ` Dean Hall
  2004-06-24 17:49 ` Lloyd Zusman
  4 siblings, 0 replies; 7+ messages in thread
From: Charlie Brady @ 2004-06-23 20:24 UTC (permalink / raw)
  Cc: supervision


Lloyd, please contact me off list - I want to know why your mail server 
rejected my mail. [Please adjust it so that it gives a reason.]

---
Charlie




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Converting from daemontools to runit
  2004-06-23 19:18 Converting from daemontools to runit Lloyd Zusman
                   ` (2 preceding siblings ...)
  2004-06-23 20:24 ` Charlie Brady
@ 2004-06-23 20:42 ` Dean Hall
  2004-06-24 17:49 ` Lloyd Zusman
  4 siblings, 0 replies; 7+ messages in thread
From: Dean Hall @ 2004-06-23 20:42 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lloyd Zusman wrote:
| <snip>
|
| 1.  Can I simultaneously run daemontools and runit (via rc.local
|     initiation)?  If so, I can then move each daemon one by one at my
|     convenience.  Or would I have to shut down daemontools before runit
|     can properly function, thereby requiring me to do this conversion
|     for all my daemons in one fell swoop?

I recently converted from svscan and sysvinit to runsvdir and
runit-init. I would actually recommend simply running all your daemons
under runit instead of simultaneously using svscan. I replaced svscan
with runit in one fell swoop, and everything worked. I continued to use
tcpserver, multilog, and other daemontools programs under runit until I
slowly replaced them with the runit programs.

| 2.  Is there any howto-like documentation for converting an existing
|     daemontools setup to be managed under runit?

The only problems I ran into were special cases with multilog and
tcpserver vs. tcpsvd syntax.

svlogd doesn't take all its log configuration on the command line;
instead, it uses a "config" file in the log directory to determine all
specifics about that particular log. I think this makes tons of sense in
the long-run, and makes log configurations easier to handle.

tcpsvd's rules configuration is a bit different than tcpserver's. It's
easy to convert, but it's directory-based, not file-based.

| 3.  Are there, perhaps, any software tools that can automate or
|     semi-automate the task of converting a daemontools setup to runit?
|
| 4.  (I guess I should have asked this first) are there any drawbacks to
|     moving my daemons from daemontools control to runit?

I haven't found any. In fact, runit seems to be far more mature and
robust than daemontools, providing you easier ways to stop and remove
services on-the-fly and providing you with a way to run commands after
the service goes down (with the "finish" file). Also, it makes runlevels
really easy with runsvchdir--something daemontools doesn't even
consider, I don't think.


Dean
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA2esl8JGc+1NO6/MRAjh7AJ43P6sykF78cLSFAAr5591NMqHeUwCeOtel
n9PtmZeoukiRIF8yPr4L2No=
=sGzp
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Converting from daemontools to runit
  2004-06-23 20:06 ` Charlie Brady
@ 2004-06-23 22:26   ` Lloyd Zusman
  0 siblings, 0 replies; 7+ messages in thread
From: Lloyd Zusman @ 2004-06-23 22:26 UTC (permalink / raw)


Thanks to the two of you (Charlie Brady and Dean Hall) for your
helpful replies.

I still have a few questions, which I'm replying to here:


> On Wed, 23 Jun 2004, Lloyd Zusman wrote:
>
>> Specifically, I'd like to know ...
>> 
>> 1.  Can I simultaneously run daemontools and runit (via rc.local
>>     initiation)?  If so, I can then move each daemon one by one at my
>>     convenience.
>
> Charlie Brady:
>   I can't think why not. You'll need separate service directories, of
>   course.
>
> Dean Hall:
>   I recently converted from svscan and sysvinit to runsvdir and
>   runit-init. I would actually recommend simply running all your
>   daemons under runit instead of simultaneously using svscan. I
>   replaced svscan with runit in one fell swoop, and everything
>   worked. I continued to use tcpserver, multilog, and other
>   daemontools programs under runit until I slowly replaced them with
>   the runit programs.

As for having separate service directories, I believe that this is
already the case, as daemontools uses /service and runit uses
/var/service ... correct?

In the "one fell swoop" case, above, I'm still not sure about the
mechanics.  Would it be something like this?

A. Perform the installation of runit as described here:
   http://smarden.org/runit/install.html

B. Move each symbolic link in /service "as is" to /var/service.  The
   /service directory will be empty when this step is completed.

C. Change my /etc/rc.local (which currently is set up to start
   daemontools) to look like this:

     #!/bin/sh
     csh -cf '/sbin/runsvdir-start &'

   This means that the demontools programs svscanboot, svscan, and
   proctitle won't be running the next time I reboot, and their runit
   analogs will be running instead.

D. Reboot my system.

E. At this point, I presume, all services will be managed by runit, but
   each on will still be running using daemontools semantics.  I can
   then change them, one by one, to use runit semantics.  Is this
   correct?


>> 2.  Is there any howto-like documentation for converting an existing
>>     daemontools setup to be managed under runit?
>
> Charlie Brady:
>   If you are going to leave daemontools installed, you shouldn't need
>   to do more than move the service directories. If you are going to
>   uninstall daemontools, then you'll need to remove any use of
>   daemontools components in the run and log/run scripts (e.g. you'll
>   need to convert from multilog to svlogd).
>
> Dean Hall:
>   The only problems I ran into were special cases with multilog and
>   tcpserver vs. tcpsvd syntax.
>
>   svlogd doesn't take all its log configuration on the command line;
>   instead, it uses a "config" file in the log directory to determine
>   all specifics about that particular log. I think this makes tons of
>   sense in the long-run, and makes log configurations easier to
>   handle.
>
>   tcpsvd's rules configuration is a bit different than
>   tcpserver's. It's easy to convert, but it's directory-based, not
>   file-based.

OK.  The removal of daemontools components shouldn't be necessary in the
scenario I outlined above in steps A-E.  And if I'm understanding the
two of you correctly, I will only have to change the logging and do the
tcpserver/tcpsvd syntax changes for each component at the time I switch
it over from daemontools to runit.

In other words, the logging, etc. from daemontools will still work "as
is" as long as I don't uninstall the daemontools software, even though
the demons will be started by runit.

Is everything I'm stating here correct?


Thanks a lot.



> [ ... ]



-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Converting from daemontools to runit
  2004-06-23 19:18 Converting from daemontools to runit Lloyd Zusman
                   ` (3 preceding siblings ...)
  2004-06-23 20:42 ` Dean Hall
@ 2004-06-24 17:49 ` Lloyd Zusman
  4 siblings, 0 replies; 7+ messages in thread
From: Lloyd Zusman @ 2004-06-24 17:49 UTC (permalink / raw)


Lloyd Zusman <ljz@asfast.com> writes:

> I'm currently using daemontools under FreeBSD (i.e., started via
> rc.local) to manage a number of daemons.  I'd like to move all those
> daemons to be under runit control, and I have some questions about
> this.

Thanks again to all of you who helped me.  I have now completely
converted from daemontools to runit.  The whole thing turned out to be
easy.

In case anyone here is interested, this is what I did:

1.  I installed runit via the instructions here:
    http://smarden.org/runit/install.html

2.  Since I'm on a non-inittab-based freebsd system, my
    daemontools startup was handled via /etc/rc.local.
    Inside of that file, I replaced line A (for daemontools)
    with line B (for runit):

      A: csh -cf '/command/svscanboot &'
      B: csh -cf '/sbin/runsvdir-start &'

3.  I moved the symlinks from /service (for daemontools)
    to /var/service (for runit):

      mv /service/* /var/service

4.  I rebooted and crossed my fingers.

5.  The system came up with all of those daemons running and being
    properly managed via runsv.  I breathed a sigh of relief.

6.  For each daemon, I did the following:

      a.  In its log/run script, I changed the string
          "multilog t" into the string "svlogd -t".

      b.  I stopped the daemon.

      c.  I backed up all of the log files under the
          'main' directory and deleted them from that
          location.

      d.  I restarted the daemon.

    All daemons came up without a problem and were logging
    properly.

7.  As a final test, I rebooted again.  Everything restarted
    without a problem.

Steps 1-5 took me something like 10 minutes.  Step 6 took me around 3-5
minutes per daemon.  This included all the checking and double-checking
that I did along the way.  If I were to do this again, I could probably
complete it all in about a third of the time.

-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-24 17:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23 19:18 Converting from daemontools to runit Lloyd Zusman
2004-06-23 20:06 ` Charlie Brady
2004-06-23 22:26   ` Lloyd Zusman
2004-06-23 20:11 ` Charlie Brady
2004-06-23 20:24 ` Charlie Brady
2004-06-23 20:42 ` Dean Hall
2004-06-24 17:49 ` Lloyd Zusman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).