* Re: runit directory organization
2005-04-04 23:48 runit directory organization Gregg Howe
@ 2005-04-05 6:37 ` Alex Efros
2005-04-06 17:52 ` Csillag Tamás
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alex Efros @ 2005-04-05 6:37 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: runit directory organization
2005-04-04 23:48 runit directory organization Gregg Howe
2005-04-05 6:37 ` Alex Efros
@ 2005-04-06 17:52 ` Csillag Tamás
2005-04-08 18:45 ` Dean Hall
2005-04-18 19:30 ` Gerrit Pape
3 siblings, 0 replies; 5+ messages in thread
From: Csillag Tamás @ 2005-04-06 17:52 UTC (permalink / raw)
Cc: supervision
Hi
On 04/04, Gregg Howe wrote:
> I have just installed runit in my lfs system and I am so grateful to be
> able to simplify managing services.
>
> However, I am undecided as to how to organize the service file directories
> and I am wondering what works for others. And whether anyone cares about
> whether or how the runit file organization should fit into the Linux FHS.
>
> Ordinarily, I would have service start and finish scripts in /etc, yet the
> service hierarchy also contains pipes, flags, pid files, etc which seem
> more appropriate in /var. Or is this the kind of information that is
> destined for /svc (I am not really sure what /svc is for)?
>
> I also will be setting up different service configurations, which I
> suppose are like runlevels. But the description of using runsvchdir shows
> the svdirs (current, previous, etc) back in /etc rather than /var. This
> confuses me. Perhaps someone could explain how they organize their
> service directories, svdir directories and run scripts.
>
> Gregg Howe
I put each service in /var/srv I have /service which is symlinked to
/var/service. If I want to set-up a new service I put it into /var/srv
then symlink it to /service.
runsvdir watches /var/service
(The symlink is just for my own preference.)
This is better (IMHO) because I do not want to mess with log directories in
every dir. I mean log/run contains:
#!/bin/sh
exec chpst -u log svlogd -tt ./main
I do not have to keep up the same structure for log files.
And log files must not go to /etc.
--
What's the most effective Windows NT remote management tool?
A car.
cstamas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: runit directory organization
2005-04-04 23:48 runit directory organization Gregg Howe
2005-04-05 6:37 ` Alex Efros
2005-04-06 17:52 ` Csillag Tamás
@ 2005-04-08 18:45 ` Dean Hall
2005-04-18 19:30 ` Gerrit Pape
3 siblings, 0 replies; 5+ messages in thread
From: Dean Hall @ 2005-04-08 18:45 UTC (permalink / raw)
On Apr 4, 2005 7:48 PM, Gregg Howe <gregg@astronumerics.com> wrote:
>
> However, I am undecided as to how to organize the service file directories
> and I am wondering what works for others. And whether anyone cares about
> whether or how the runit file organization should fit into the Linux FHS.
As someone has noted already, runit and other djb-ish software usually
deliberately breaks FHS compatibility. I run gentoo myself and,
without editing every ebuild I install, I'm pretty much stuck with a
mostly FHS-compatible OS. Luckily, djb-ish stuff lets you do whatever
you want.
> Ordinarily, I would have service start and finish scripts in /etc, yet the
> service hierarchy also contains pipes, flags, pid files, etc which seem more
> appropriate in /var. Or is this the kind of information that is destined
> for /svc (I am not really sure what /svc is for)?
Here's the way I do it, though I'm sure many might dislike it:
- envdirs in /etc/envdir.d
- misc. configuration in /etc/config.d
- services in /var/service/{all,default,current}
I don't use /etc/runit at all.
Don't worry too much about what directories in which to put stuff.
It's really up to you.
d
--
http://deanpence.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: runit directory organization
2005-04-04 23:48 runit directory organization Gregg Howe
` (2 preceding siblings ...)
2005-04-08 18:45 ` Dean Hall
@ 2005-04-18 19:30 ` Gerrit Pape
3 siblings, 0 replies; 5+ messages in thread
From: Gerrit Pape @ 2005-04-18 19:30 UTC (permalink / raw)
On Mon, Apr 04, 2005 at 04:48:55PM -0700, Gregg Howe wrote:
> I have just installed runit in my lfs system and I am so grateful to
> be able to simplify managing services.
>
> However, I am undecided as to how to organize the service file
> directories and I am wondering what works for others. And whether
> anyone cares about whether or how the runit file organization should
> fit into the Linux FHS.
On Debian, I have the runit configuration including getty services in
/etc/runit/. Other packages/services put their service directories into
/etc/ (or a subdirectory /etc/<package>/), and optionally provide a link
in /var/service/. Logs are put into /var/log/.
> Ordinarily, I would have service start and finish scripts in /etc, yet
> the service hierarchy also contains pipes, flags, pid files, etc which
> seem more appropriate in /var.
You can make the ./supervise subdirectory in the service directory a
symlink to /var/run/<service> before enabling it for the first time.
runsv will follow the dangling symlink, and creates the directory in
/var/run/. So you only have the configuration in /etc/.
Regards, Gerrit.
^ permalink raw reply [flat|nested] 5+ messages in thread