From: Alex Efros <powerman@sky.net.ua>
Subject: Re: runit directory organization
Date: Tue, 5 Apr 2005 09:37:43 +0300 [thread overview]
Message-ID: <20050405063743.GA4691@home.power> (raw)
In-Reply-To: <000a01c53970$dd986680$6601a8c0@GHDESK>
Hi!
On Mon, Apr 04, 2005 at 04:48:55PM -0700, Gregg Howe wrote:
> confuses me. Perhaps someone could explain how they organize their
> service directories, svdir directories and run scripts.
Boot/shutdown scripts:
/etc/runit/1
/etc/runit/2
/etc/runit/3
Directory with service's run scripts repository:
/service/
Directory with current active services:
/var/service/
At least it's looks like this for usage/administration: when I need to
install new service I will add it's run script to /service/SOMENEWSRV/,
when I need to activate that service on current runlevel I will just
symlink it into /var/service/:
ln -s /service/SOMENEWSRV /var/service/
OR
ln -s /service/SOMENEWSRV /var/service/NEW
second form I use to choose between alternative realizations of same service,
for example:
ln -s /service/agetty-tty1 /var/service/tty1
ln -s /service/mingetty-tty2 /var/service/tty2
ln -s /service/apache2 /var/service/web
ln -s /service/oops /var/service/webproxy
Real fs layout is a little different. /var/service/ isn't a real directory -
it's lust symlink to /etc/runit/runsvdir/CURRENT_RUNLEVEL_NAME/ which is
a real directory and contain all these symlinks to active services in
/service/.
I don't use different runlevels, but if you need easy way to switch
between runlevels you can use this layout:
/etc/runit/runsvdir/somerealrunlevel1/
/etc/runit/runsvdir/somerealrunlevel2/
/etc/runit/runsvdir/somerealrunlevel3/
/etc/runit/runsvdir/current -> somerealrunlevel2
/var/service -> /etc/runit/runsvdir/current
This way you will be able to switch between runlevels by just changing
/etc/runit/runsvdir/current symlink.
Of course, with this scheme script /etc/runit/2 should start `runsvdir`
with '/var/service/' as first param.
I prefer this layout because:
- all contiguration-related files under /etc, so there is no need to
backup /service/ or /var/service/ in addition to /etc
- /service/ is mostly like /usr/ from administration view - it contain
static run-scripts (which installed from 'baselayout' package or
some service packages) and there is no needs to update these run-scripts
except in very rare cases... yeah, I know there some dynamic files
will be created (locks, pipes, etc.) in this directory and this is why
this directory called /service/ instead of /usr/service/ - it's not
completely static like /usr/, it's special directory for services with
own special behaviour which differ from /etc, /usr and /var
- there is no need to know current runlevel name to update it because
I will add/remove symlinks only in /var/service/ directory
I don't sure this layout is FHS-compliant, but looks like djb's and djb-like
software, packaging system and proposed fs-layout will never be included
in global standards like FHS, no matter how good they are. :(
--
WBR, Alex.
next prev parent reply other threads:[~2005-04-05 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-04 23:48 Gregg Howe
2005-04-05 6:37 ` Alex Efros [this message]
2005-04-06 17:52 ` Csillag Tamás
2005-04-08 18:45 ` Dean Hall
2005-04-18 19:30 ` 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=20050405063743.GA4691@home.power \
--to=powerman@sky.net.ua \
/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).