On Tuesday 03 November 2009 14:18, Vladimir Dronnikov wrote:
> Hello, Denys!
> 
> I'd like to discuss the drawback (feature?) of runit services
> (http://busybox.net/~vda/init_vs_runsv.html) which has always been
> inspiring me to make some changes:
> 
> runsv spoils service container directory with "supervise" directory --
> pure runtime info which _should not_ survive between reboots -- thus
> it's native place is /var/run/<service name>.
> 
> There too should go "supervise" or "service logger" subservice.

If you like stuff to be spread into many directories - yes.

> Suppose I have getty service (say, on tty1) and want its activity to
> be logged. I should make:
> /etc/init.d/getty1/
>     run # service starter
>     supervise/ is a symlink for /var/run/getty1/supervise

You propose that what exactly should make this link?

>     log/
>         run # logger subservice
>         supervise/ is a symlink for /var/run/getty1/log/supervise
> 
> Furthermore, one can expect service logs under /var/log/<service
> name>.

And on my home system, log/run makes it so. Without making
it mandatory for every user of runsv.

> To achieve that, logger service's run should be a symlink to a 
> generic enough script, which retrieves the name of parent service and
> prepares /var/log/<service name>.
> 
> E.g. generic /usr/bin/log can be of form:
> -------------
> A=`pwd`
> A=${A%/log}
> A=${A##*/}
> D=/var/log/$A
> mkdir -p -m 750 $D && chown log:log $D && exec chpst -u log:log -- svlogd -tt 
> $D
> -------------
> 
> Furthermore, logger subservice then is invariant for any service, and
> we can control whether to start it or not by placing, say, "nolog"
> file marker into service directory, just like "down" file to control
> service startup mode. That way, service's "run" can analyze the
> presence of "nolog" marker and create logger subservice hierarchy
> automagically.

Yes, you can make your log/run loo like this. I have no objections.

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox
  • runit Vladimir Dronnikov
    • Re: runit Denys Vlasenko

Reply via email to