supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Re: runit VS daemontools
@ 2004-02-21 16:03 Alex Efros
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Efros @ 2004-02-21 16:03 UTC (permalink / raw)


Hi!

On Sat, Feb 21, 2004 at 11:56:47AM +0000, Gerrit Pape wrote:
> > Can you please explain one more thing? I don't understand goal of
> > these lines in your example for /etc/runit/1 file for debian:
> > 
> >     touch /etc/runit/stopit
> >     chmod 0 /etc/runit/stopit
> 
> If runit receives a CONT signal, and the file /etc/runit/stopit exists
> and has the execute by owner permission set, runit is told to shutdown
> the system.
> 
> As an one time initialization task stage 1 ensures that the stopit file
> exists and has the execute by owner permission unset.  runit supports
> magic files being symbolic links.

So, these lines protect from case if someone send CONT to process 1?
But only root can send any signals to process 1, so I still don't understand
goal of these lines.

As far as I see, all commands like Ctrl+Alt+Del, init 0, init 6, reboot, halt,
shutdown -r now -- all of them result in creating this file, so server will
be rebooted even if this file was not exists before executing these commands.

-- 
			WBR, Alex.


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

* Re: runit VS daemontools
  2004-02-18 20:48   ` runit VS daemontools Alex Efros
  2004-02-19 16:21     ` Gerrit Pape
@ 2004-03-08 19:29     ` Gerrit Pape
  1 sibling, 0 replies; 6+ messages in thread
From: Gerrit Pape @ 2004-03-08 19:29 UTC (permalink / raw)


On Wed, Feb 18, 2004 at 10:48:02PM +0200, Alex Efros wrote:
> Comparation of runit's documentation VS daemontools's documentation. ;-)
> # svlogd   VS   multilog

> + able to add timestamp with microseconds(micro?) in sortable text format
>   (it's unclean from docs, but probably in GMT)

I always intended to have svlogd print human readable timestamps in UTC,
but did it wrong, and didn't notice because most of my systems' clocks
are set to UTC.  It's changed now in release 1.0.1.

Regards, Gerrit.


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

* Re: runit VS daemontools
  2004-02-20  3:24       ` Alex Efros
@ 2004-02-21 11:56         ` Gerrit Pape
  0 siblings, 0 replies; 6+ messages in thread
From: Gerrit Pape @ 2004-02-21 11:56 UTC (permalink / raw)


On Fri, Feb 20, 2004 at 05:24:30AM +0200, Alex Efros wrote:
> Can you please explain one more thing? I don't understand goal of
> these lines in your example for /etc/runit/1 file for debian:
> 
>     touch /etc/runit/stopit
>     chmod 0 /etc/runit/stopit

If runit receives a CONT signal, and the file /etc/runit/stopit exists
and has the execute by owner permission set, runit is told to shutdown
the system.

As an one time initialization task stage 1 ensures that the stopit file
exists and has the execute by owner permission unset.  runit supports
magic files being symbolic links.

Regards, Gerrit.


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

* Re: runit VS daemontools
  2004-02-19 16:21     ` Gerrit Pape
@ 2004-02-20  3:24       ` Alex Efros
  2004-02-21 11:56         ` Gerrit Pape
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Efros @ 2004-02-20  3:24 UTC (permalink / raw)


Hi!

On Thu, Feb 19, 2004 at 04:21:32PM +0000, Gerrit Pape wrote:
> This is very nice, and nearly complete.  Thanks a lot.

It will be very good if you add to your website something like it. :-)

> You can simply use
>  # echo -n 'dx' >/var/service/<service>/supervise/control

Yeah, I know. :-) As far as I understand I even can use 'svc'..?

> You can run the chpst program as 'setlock' or 'softlimit' (or
> 'dsetlock', "dsoftlimit'), then it accepts the same options as the
> corresponding daemontools programs.

Cool!

Can you please explain one more thing? I don't understand goal of these lines
in your example for /etc/runit/1 file for debian:

    touch /etc/runit/stopit
    chmod 0 /etc/runit/stopit

Looks like everything working without them too... :)

-- 
			WBR, Alex.


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

* Re: runit VS daemontools
  2004-02-18 20:48   ` runit VS daemontools Alex Efros
@ 2004-02-19 16:21     ` Gerrit Pape
  2004-02-20  3:24       ` Alex Efros
  2004-03-08 19:29     ` Gerrit Pape
  1 sibling, 1 reply; 6+ messages in thread
From: Gerrit Pape @ 2004-02-19 16:21 UTC (permalink / raw)


On Wed, Feb 18, 2004 at 10:48:02PM +0200, Alex Efros wrote:
> On Wed, Feb 18, 2004 at 06:30:09PM +0100, Clemens Fischer wrote:
> > this might be valuable to a number of people.  can you post the
> > translation some place?
> 
> Comparation of runit's documentation VS daemontools's documentation. ;-)
> (I've also added some noted from myself, not from documentation.)

This is very nice, and nearly complete.  Thanks a lot.

> # runsvctrl   VS   svc
> + able to send SIGUSR1 and SIGUSR2 to service
> - don't able to send more than one command at once like `svc - dx`

You can simply use
 # echo -n 'dx' >/var/service/<service>/supervise/control

> # chpst   VS   pgrphack + setuidgid + envuidgid + envdir + setlock + softlimit
> * has functionality of pgrphack + setuidgid +envuidgid + envdir + setlock +
>   softlimit
> + allows set group different from user's main group
> + able to close STDIN/STDOUT/STDERR
> - no way to define what to do (exit(0) or print error and exit(1)) in case if
>   it fail to open/close/lock lock-file
> - no way to set soft limit to hard limit like softlimit do it (bug in docs?)
> - no way to set separate memory limits (data/stack/locked/total) - they all
>   set to same value
> - no way to set soft limits for RSS and CPU

You can run the chpst program as 'setlock' or 'softlimit' (or
'dsetlock', "dsoftlimit'), then it accepts the same options as the
corresponding daemontools programs.

Regards, Gerrit.


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

* runit VS daemontools
  2004-02-18 17:30 ` reboot->wtmp Clemens Fischer
@ 2004-02-18 20:48   ` Alex Efros
  2004-02-19 16:21     ` Gerrit Pape
  2004-03-08 19:29     ` Gerrit Pape
  0 siblings, 2 replies; 6+ messages in thread
From: Alex Efros @ 2004-02-18 20:48 UTC (permalink / raw)


Hi!

On Wed, Feb 18, 2004 at 06:30:09PM +0100, Clemens Fischer wrote:
> this might be valuable to a number of people.  can you post the
> translation some place?

Comparation of runit's documentation VS daemontools's documentation. ;-)
(I've also added some noted from myself, not from documentation.)

This text may contain mistypo, bugs and even bad ideas. :)

Legend:
 * just note
 - runit don't have this daemontools feature
 + runit add this feature

* runit can be used as replacement for sysvinit and daemontools
  but also can be used together with them
+ man and --help documentation
# maybe daemontools also has similar stdout/stderr behaviour, but I never
# seen it in daemontools before
* runsvdir's stdout by default going to first (?!) virtual console
* stdout of ./{run,finish} (if there is no ./log/run) and stdout of
  ./log/run is going to runsvdir's stdout
* stderr of ./run and ./finish and ./log/run going to runsvdir's title
# runsvdir   VS   svscanboot + svscan + readproctitle
+ runsvdir has functionality of svscanboot + svscan + readproctitle
  which is very useful and safe against another one bash process in
  memory (for pipe between svscan and readproctitle)
* runsvdir execute runsv (svscan execute supervise)
+ service will be stopped automatically if it disappear from /var/service/
  directory (so there is no need for additional svc -dx command after
  removing service)
# runsv   VS   supervise
+ support ./finish script which (if exists) will be executed after ./run
  exits (./finish stdout also send to ./log/run if it exists)
+ current service status available in text format in files
  ./supervise/{stat,pid} (supervise-compatible binary status in
  ./supervise/status is also supported)
+ when terminating service if it has ./log/run then runsv will first
  terminate ./run then close ./log/run's stdin then wait until ./log/run
  exits - this make logs more reliable
+ both ./run and ./log/run served by single runsv process
# runsvctrl   VS   svc
+ able to send SIGUSR1 and SIGUSR2 to service
- don't able to send more than one command at once like `svc - dx`
* commands are readable plain text ("down" instead of "-d")
# runsvstat   VS   svok + svstat
* has functionality of svok (exit code) and svstat (print server status)
* can optionally show ./log/ statuses in addition to main service status
# chpst   VS   pgrphack + setuidgid + envuidgid + envdir + setlock + softlimit
* has functionality of pgrphack + setuidgid +envuidgid + envdir + setlock +
  softlimit
+ allows set group different from user's main group
+ able to close STDIN/STDOUT/STDERR
- no way to define what to do (exit(0) or print error and exit(1)) in case if
  it fail to open/close/lock lock-file
- no way to set soft limit to hard limit like softlimit do it (bug in docs?)
- no way to set separate memory limits (data/stack/locked/total) - they all
  set to same value
- no way to set soft limits for RSS and CPU
# svlogd   VS   multilog
* executing external program as "processor" explained in documenation in
  much more details, but it's unclear is it differ from multilog
+ log configurations moved from multilog's paramemters to /logdir/config
  (file may not exists), it also support comments
+ may send data to syslog using UDP
+ a little extended patterns for selecting strings to log
+ able to add timestamp with microseconds(micro?) in sortable text format
  (it's unclean from docs, but probably in GMT)
+ able to replace unprintable plus user-defined chars by one user-defined
+ it's possible to control maximum string length and size of read buffer
+ SIGHUP: reopen all logs and reread /logdir/config files
+ SIGALRM: force (non-empty) log rotation now
# utils only in daemontools:
- fghack
- tai64n
- tai64nlocal
# added service dependencies
+ svwaitup ( http://smarden.org/pape/djb/daemontools/noinit.html )
    * should be executed from ./run before service daemon itself
    + able to wait until required services will be "up" for at least
      (configurable) timeout seconds
    - as author noted, this way isn't safe because race still possible;
      IMHO Right Way to realize service dependencies is use some sort of
      IPC between ./run and runsvdir so all ./run scripts will be able to
      register is't provides or dependences in one daemon which guarantied
      to be running (after runsvdir die system will be rebooted), and runsvdir
      will be able to control service executing order and check is they alive;
      btw, this race may be (?) worked around by stopping all services which
      require this one from it's ./finish script.
# added safe shutdown for services at reboot/halt
+ svwaitdown
    + able to send down, kill, exit commands to services and wait
      until they exits or timeout happens
# added runlevels support
+ runsvchdir
# added sysvinit replacement
+ runit-init: replaced /sbin/init; execute runit at system boot time
+ runit
    + simple /etc/inittab replacement by using 4 hardcoded script names
      for initializing (/etc/runit/1), execute services including getties
      (/etc/runit/2), prepare for reboot/halt (/etc/runit/3) and process
      ctrl+alt+del (/etc/runit/ctrlaltdel)
    + restart /etc/runit/2 if it died (hmm.. looks like on my server it
      going to reboot instead... is it my mistake or bug in runit?)
    + SIGINT: emulate ctrl+alt+del
    + SIGCONT: doing reboot/halt if executable file /etc/runit/stopit exists
      (hmm, looks like it impossible to reboot while executing /etc/runit/1 -
      for example if it executed /sbin/sulogin I'm unable to reboot/halt from
      it...)
+ utmpset
    * complement runit-init functionality (sysvinit add records to utmp/wtmp,
      but runit-init doesn't) by adding 'logout' information to utmp/wtmp
      (should be executed in ./finish script for getty-* services)
# new/changed files and directories:
/etc/runit/1
/etc/runit/2
/etc/runit/3
/etc/runit/reboot
    define what should be done on shutdown: halt or reboot
/etc/runit/ctrlaltdel
    script for processing ctrl+alt+del (able to block rebooting)
/etc/runit/stopit
    allow or deny system reboot (for use in ctrlaltdel script, for example)
/var/service/
    now - symlink, was directory /service/
/etc/runit/runsvdir/current/
    symlink to current runlevel (really, to directory with services, "default"
    for example)
/etc/runit/runsvdir/default/
    directory with services for runlevel "default"
./finish
    executed after ./run exits
./supervise/{stat,pid}
    contain service status in text format
/logdir/config
    contain svlogd paramemtes for this /logdir/

-- 
			WBR, Alex.


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

end of thread, other threads:[~2004-03-08 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-21 16:03 runit VS daemontools Alex Efros
  -- strict thread matches above, loose matches on Subject: below --
2004-02-18  6:22 reboot->wtmp Alex Efros
2004-02-18 17:30 ` reboot->wtmp Clemens Fischer
2004-02-18 20:48   ` runit VS daemontools Alex Efros
2004-02-19 16:21     ` Gerrit Pape
2004-02-20  3:24       ` Alex Efros
2004-02-21 11:56         ` Gerrit Pape
2004-03-08 19:29     ` Gerrit Pape

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).