From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1580 Path: news.gmane.org!not-for-mail From: Rehan Khan Newsgroups: gmane.comp.sysutils.supervision.general Subject: non-daemon services/scripts as dependancies Date: Sun, 23 Dec 2007 04:31:00 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1198386465 25989 80.91.229.12 (23 Dec 2007 05:07:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Dec 2007 05:07:45 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1815-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Dec 23 06:07:58 2007 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1J6J4A-0002NH-Dk for gcsg-supervision@gmane.org; Sun, 23 Dec 2007 06:07:58 +0100 Original-Received: (qmail 27479 invoked by uid 76); 23 Dec 2007 05:07:46 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 27471 invoked from network); 23 Dec 2007 05:07:46 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 81.86.133.231 (Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.8 (like Gecko)) Original-Sender: news Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1580 Archived-At: 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?