From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1912 Path: news.gmane.org!not-for-mail From: Laurent Bercot Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Please review my Bluetooth run script Date: Wed, 13 Aug 2008 14:05:05 +0200 Message-ID: <20080813120505.GA11751@skarnet.org> References: <1775.124.170.84.119.1218624530.squirrel@www.magtech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218629147 16183 80.91.229.12 (13 Aug 2008 12:05:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 12:05:47 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-2147-gcsg-supervision=m.gmane.org@list.skarnet.org Wed Aug 13 14:06:38 2008 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 1KTF6j-0001Wf-Vm for gcsg-supervision@gmane.org; Wed, 13 Aug 2008 14:05:49 +0200 Original-Received: (qmail 15481 invoked by uid 76); 13 Aug 2008 12:05:05 -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 15473 invoked by uid 1000); 13 Aug 2008 12:05:05 -0000 Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <1775.124.170.84.119.1218624530.squirrel@www.magtech.com.au> User-Agent: Mutt/1.4i Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1912 Archived-At: > What I want to know is if this is the "proper" way to go about it. The > original Blue-Z startup script starts quite a few daemons all at once, > and it kills off each of them with a "killall". The original point of service supervision, what caused it to be implemented (with daemontools first, then with runit) in the first place, is that some daemons need to be automatically restarted if something somehow causes them to die. Your current "run script" does not accomplish this. It starts the various Bluetooth daemons, and kills them, just like a System V script would do. Those daemons are not supervised; what is supervised is actually the following script: exec sh -c "while [ 1 ]; do sleep 100; done" I'm sure you will agree that supervising this script isn't particularly useful. :) In other words, you've successfully converted your System V scripts to the runsv model, but you're not taking advantage of what service supervision can do for you. As is, you'd still be better off using a start/stop SysV script, and do without your akward "bluetooth" service which isn't a real service. My advice would be to have separate services for hcid, sdpd, hidd, rfcommm (if it's a long-lived daemon), dund, pand and pppd. All those daemons need to be kept alive and running; as an additional benefit, you don't have to lose their logs by sending them to /dev/null, you can make use of runsv's logging facility to send each daemon's log into its own multilog or whatever your favorite logging system is. Then, once you have set up one service for each Bluetooth daemon that needs to be up, you can have a "bluetooth start" script that does a "sv up" on all those services at once, and a "bluetooth stop" script that does a "sv down" on them. And you can even control each daemon separately if the need arises. -- Laurent