supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* non-daemon services/scripts as dependancies
@ 2007-12-23  4:31 Rehan Khan
  2007-12-30 22:27 ` Charlie Brady
  0 siblings, 1 reply; 3+ messages in thread
From: Rehan Khan @ 2007-12-23  4:31 UTC (permalink / raw)
  To: supervision

Hi

I am trying to implement the facility names of the LSB 3.1 specification 
chapter 20.6. This requires that when certain 'facilities' like the local 
filesystem are available other services can depend on them.

The LSB spec says:

    Boot facilities are used to indicate dependencies in initialization 
scripts, as defined in Comment Conventions for Init Scripts. Facility names 
are assigned to scripts by the Provides: keyword. Facility names that begin 
with a dollar sign ('$') are reserved system facility names. Note: Facility 
names are only recognized in the context of the init script comment block and 
are not available in the body of the init script. In particular, the use of 
the leading '$' character does not imply system facility names are subject to 
shell variable expansion, since they appear inside comments. Conforming 
applications shall not provide facilities that begin with a dollar sign.
Implementations shall provide the following facility names:
$local_fs
$network
$named
.
..
... 

Each of these facilities can have many providers e.g. $named can be provided 
by bind, powerdns, djbdns etc and some cannot be run as supervised services 
e.g. $local_fs as they are just straight configuration scripts.

One way I can do this is have some sort of global variable or data structure 
where each script can register it's 'provides' facility name (good for 
$local_fs, $network). Another way is to create a service for each facility or 
name the symlink as the facility name but the service directory as the real 
name of the application so that one can see clearly which service is providing 
the facility (good for named, djbdns etc). 

To mix it up some more, sometimes a facility can be provided by multiple 
services which can also run at the same time without affecting the other 
service.

One of the main issues I am tussling with is tasks that *can* be implemented 
as non-supervised services and must run only once. There does not seem to be a 
simple/universal way to tell runsvdir to run a service only once (and not 
expect it to run a continuous process and if it returns succesfully on that 
first run then to tell other services that the service ran successfully. I 
realise that this is out of the scope of the primary function of runit but it 
would be very useful when trying to meet the lsb requirements.

I wanted to know if anyone has any ideas on how this can be implemented 
further?





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: non-daemon services/scripts as dependancies
  2007-12-23  4:31 non-daemon services/scripts as dependancies Rehan Khan
@ 2007-12-30 22:27 ` Charlie Brady
  2008-01-01  8:10   ` Rehan Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Brady @ 2007-12-30 22:27 UTC (permalink / raw)
  To: Rehan Khan; +Cc: supervision


On Sun, 23 Dec 2007, Rehan Khan wrote:

> One of the main issues I am tussling with is tasks that *can* be implemented
> as non-supervised services and must run only once. There does not seem to be a
> simple/universal way to tell runsvdir to run a service only once ...

Create a run script which does it's thing, and then finally does "sv d .".

> (and not
> expect it to run a continuous process and if it returns succesfully on that
> first run then to tell other services that the service ran successfully.

Last I looked runit had no such notification feature.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: non-daemon services/scripts as dependancies
  2007-12-30 22:27 ` Charlie Brady
@ 2008-01-01  8:10   ` Rehan Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Rehan Khan @ 2008-01-01  8:10 UTC (permalink / raw)
  To: supervision

Charlie Brady <charlieb-supervision <at> budge.apana.org.au> writes:

> 
> 
> On Sun, 23 Dec 2007, Rehan Khan wrote:
> 
> > One of the main issues I am tussling with is tasks that *can* be 
implemented
> > as non-supervised services and must run only once. There does not seem to 
be a
> > simple/universal way to tell runsvdir to run a service only once ...
> 
> Create a run script which does it's thing, and then finally does "sv d .".
> 
> > (and not
> > expect it to run a continuous process and if it returns succesfully on 
that
> > first run then to tell other services that the service ran successfully.
> 
> Last I looked runit had no such notification feature.
> 
> 

"sv d ." - ok that looks good, I'll try it. Didn't know that could be done.

yup, Runit doesn't have a notification feature. I could use something like 
that though. I guess I will have to try doing it some other way.

Thanks
R



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-01  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-23  4:31 non-daemon services/scripts as dependancies Rehan Khan
2007-12-30 22:27 ` Charlie Brady
2008-01-01  8:10   ` Rehan Khan

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).