From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/779 Path: news.gmane.org!not-for-mail From: Csillag =?iso-8859-2?Q?Tam=E1s?= Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: runit and lsb init script actions Date: Wed, 20 Apr 2005 00:05:53 +0200 Message-ID: <20050419220553.GR21627@digitus> References: <20050410151610.26722.qmail@c94466ef4374af.315fe32.mid.smarden.org> Reply-To: Csillag =?iso-8859-2?Q?Tam=E1s?= NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Trace: sea.gmane.org 1113948152 17179 80.91.229.2 (19 Apr 2005 22:02:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Apr 2005 22:02:32 +0000 (UTC) Original-X-From: supervision-return-1015-gcsg-supervision=m.gmane.org@list.skarnet.org Wed Apr 20 00:02:28 2005 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1DO0mr-00035t-RA for gcsg-supervision@gmane.org; Wed, 20 Apr 2005 00:01:42 +0200 Original-Received: (qmail 29760 invoked by uid 76); 19 Apr 2005 22:06:16 -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 29754 invoked from network); 19 Apr 2005 22:06:16 -0000 Original-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <20050410151610.26722.qmail@c94466ef4374af.315fe32.mid.smarden.org> X-Operating-System: Gnu/Linux X-PPKE-NOSPAM: I promise, I will never let anything happen to you. Nemo. X-PGP-Key: http://digitus.itk.ppke.hu/~cstamas/cstamas.pgp User-Agent: Mutt/1.5.6+20040907i X-PPKE-ITK-MailScanner: Found to be clean X-PPKE-ITK-MailScanner-SpamCheck: not spam, SpamAssassin (Kikapcsolva 20 egymas utani idotullepes miatt) X-PPKE-ITK-MailScanner-From: cstamas@digitus.itk.ppke.hu Xref: news.gmane.org gmane.comp.sysutils.supervision.general:779 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:779 On 04/10, Gerrit Pape wrote: > Hi, one thing that has been requested for runit multiple times is lsb > compliance concerning 'init script' actions, see > > http://refspecs.freestandards.org/LSB_2.1.0/LSB-Core-generic/LSB-Core-generic.html#INISCRPTACT > > It seems to be quite possible to implement an lsb compliant interface > through a separate program that runs runsvctrl up, down, term, hup, ..., > depending on the command line arguments. For service daemons that don't > do the right thing on up, down, term, hup, ..., it's possible to > override the actions through the customized control scripts in > /control/. This separate program may be symlinked to > /etc/init.d/, or used as a wrapper, and maybe fall back to an > original /etc/init.d/ script in case the service doesn't run > under runit's supervision. > > What do you think? > > Thanks, Gerrit. I made similar script as Charlie Brady's, but mine is a bit simpler. #! /bin/sh NAME=someservicename case "$1" in start) echo -n "Starting $NAME" /usr/bin/runsvctrl u /service/$NAME echo "." ;; stop) echo -n "Stopping $NAME" /usr/bin/runsvctrl d /service/$NAME echo "." ;; restart) echo -n "Restarting $NAME" /usr/bin/runsvctrl t /service/$NAME echo "." ;; *) echo "Usage: $0 {start|stop|restart}" >&2 exit 1 ;; esac exit 0 I use this one in Debian so if I upgrade, it can start/stop the services as needed. (As you can see this is a minimalist script.) The only problem which I see that runit is in /usr/bin and as a base system utility it should be in /sbin or /bin (like init). What do you think? -- "Real programmers can write assembly code in any language." -- Larry Wall cstamas