supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Csillag Tamás" <cstamas@digitus.itk.ppke.hu>
Subject: Re: runit and lsb init script actions
Date: Wed, 20 Apr 2005 00:05:53 +0200	[thread overview]
Message-ID: <20050419220553.GR21627@digitus> (raw)
In-Reply-To: <20050410151610.26722.qmail@c94466ef4374af.315fe32.mid.smarden.org>

On 04/10, Gerrit Pape wrote:
> Hi, one thing that has been requested for runit multiple times is lsb
> compliance concerning 'init script' actions, see
> 
>  http://refspecs.freestandards.org/LSB_2.1.0/LSB-Core-generic/LSB-Core-generic.html#INISCRPTACT
> 
> It seems to be quite possible to implement an lsb compliant interface
> through a separate program that runs runsvctrl up, down, term, hup, ...,
> depending on the command line arguments.  For service daemons that don't
> do the right thing on up, down, term, hup, ..., it's possible to
> override the actions through the customized control scripts in
> <service>/control/.  This separate program may be symlinked to
> /etc/init.d/<service>, or used as a wrapper, and maybe fall back to an
> original /etc/init.d/<service> script in case the service doesn't run
> under runit's supervision.
> 
> What do you think?
> 
> Thanks, Gerrit.

I made similar script as Charlie Brady's, but mine is a bit simpler.

#! /bin/sh

NAME=someservicename

case "$1" in
  start)
        echo -n "Starting $NAME"
        /usr/bin/runsvctrl u /service/$NAME
        echo "."
        ;;
  stop)
        echo -n "Stopping $NAME"
        /usr/bin/runsvctrl d /service/$NAME
        echo "."
        ;;
  restart)
        echo -n "Restarting $NAME"
        /usr/bin/runsvctrl t /service/$NAME
        echo "."
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 1
        ;;
esac

exit 0

I use this one in Debian so if I upgrade, it can start/stop the services as needed.
(As you can see this is a minimalist script.)

The only problem which I see that runit is in /usr/bin and as a base system utility
it should be in /sbin or /bin (like init).

What do you think?

-- 
"Real programmers can write assembly code in any language."
                                              -- Larry Wall

cstamas


      parent reply	other threads:[~2005-04-19 22:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-10 15:15 Gerrit Pape
2005-04-10 17:00 ` Charlie Brady
2005-04-18 19:17   ` Gerrit Pape
2005-04-19 22:05 ` Csillag Tamás [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050419220553.GR21627@digitus \
    --to=cstamas@digitus.itk.ppke.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).