From: Stefan Karrmann <sk@mathematik.uni-ulm.de>
Subject: Re: Adding a 'setup' phase to service startup?
Date: Wed, 23 Feb 2005 22:12:23 +0100 [thread overview]
Message-ID: <20050223211223.GC3942@johann.karrmann.de> (raw)
In-Reply-To: <slrnd1k7hn.j93.lars@flowers.house.oddbit.com>
My 2 cent:
Lars Kellogg-Stedman (Mon, Feb 21, 2005 at 05:41:59PM +0000):
> I was mulling over service dependencies yesterday, and I wonder if it would
> make sense to add a "setup" phase to runsv's service startup sequence.
> This would allow, for example, svwaitup to block while a service performed
> one time initialization.
You may use pipe-tools, cf.
<http://www.skarnet.org/software/pipe-tools/index.html>.
> Here I'm thinking particularly of long-running setup actions, such as
> database initialization or something. The current solution -- waiting for
> a number of seconds and then crossing our fingers -- doesn't provide the
> level of control that runit provides in other areas.
>
> This would make the start sequence look like this:
>
> IF file "setup" exists THEN
> SET STATE TO S_SETUP
> RUN file "setup"
> END IF
>
> SET STATE TO S_RUN
> RUN file "run"
>
> IF file "finish" exists THEN
> SET STATE TO S_FINISH
> RUN file "finish"
> END IF
With pipe-tools you only need the run and finish file:
#########################
# run file
./setup
npt-notify ./events isup
standard-run-script
#########################
# finish file
npt-notify ./events down
#########################
The setup code my wait on another service X by ,npt-wait /service/X/events'.
The demon can even use libnptrigger to signal the events during its running.
Regards,
--
Stefan Karrmann
next prev parent reply other threads:[~2005-02-23 21:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-21 17:41 Lars Kellogg-Stedman
2005-02-22 4:08 ` Dean Hall
2005-02-22 15:06 ` Thomas Schwinge
2005-02-23 20:07 ` Lars Kellogg-Stedman
2005-02-24 4:28 ` Dean Hall
2005-02-24 4:40 ` Dean Hall
2005-02-23 21:12 ` Stefan Karrmann [this message]
2005-03-07 11:56 ` Gerrit Pape
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=20050223211223.GC3942@johann.karrmann.de \
--to=sk@mathematik.uni-ulm.de \
/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).