From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1911 Path: news.gmane.org!not-for-mail From: arasv@magtech.com.au Newsgroups: gmane.comp.sysutils.supervision.general Subject: Please review my Bluetooth run script Date: Wed, 13 Aug 2008 20:48:50 +1000 (EST) Message-ID: <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=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1218624544 1666 80.91.229.12 (13 Aug 2008 10:49:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 10:49:04 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-2146-gcsg-supervision=m.gmane.org@list.skarnet.org Wed Aug 13 12:49:56 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 1KTDvO-0008TQ-Pq for gcsg-supervision@gmane.org; Wed, 13 Aug 2008 12:49:54 +0200 Original-Received: (qmail 3376 invoked by uid 76); 13 Aug 2008 10:49:15 -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 3368 invoked from network); 13 Aug 2008 10:49:15 -0000 X-VirusChecked: Checked X-Env-Sender: arasv@magtech.com.au X-Msg-Ref: server-15.tower-130.messagelabs.com!1218624531!23391703!1 X-StarScan-Version: 5.5.12.14.2; banners=magtech.com.au,-,- X-Originating-IP: [150.101.126.166] User-Agent: SquirrelMail/1.4.10a X-Priority: 3 (Normal) Importance: Normal Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1911 Archived-At: Hi there, I'm using the runit scripts in Busybox v1.11.1. I've pretty well moved all my old init.d scripts over to the runit format and I'm very happy with it. I had a little bit of trouble with my Bluetooth Blue-Z startup script but I have a working version. 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". I've managed to split the old init.d script into a "run" and "finish" script. I also have a "down" file so Bluetooth is only started when a BT dongle is added (triggered via udev). Here is my (simplified!) run script: /etc # cat /etc/sv/bluetooth/run #!/bin/sh set -e PATH=/sbin:/bin:/usr/sbin:/usr/bin [ -e /etc/default/bluetooth ] && . /etc/default/bluetooth # start all the Bluetooth services hcid -f $HCID_CONFIG sdpd hidd $HIDD_OPTIONS --server || true hid2hci --tohci > /dev/null 2>&1 || true rfcomm -f $RFCOMM_CONFIG bind all || true dund $DUND_OPTIONS pand $PAND_OPTIONS # now wait until we are told to finish by sv trap 'exit 2' 1 2 3 15 exec sh -c "while [ 1 ]; do sleep 100; done" exit 0 Here is the finish script: /etc # cat /etc/sv/bluetooth/finish #!/bin/sh set -e killall pppd > /dev/null 2>&1 || true killall pand > /dev/null 2>&1 || true killall dund > /dev/null 2>&1 || true rfcommm release all > /dev/null 2>&1 || true killall hidd > /dev/null 2>&1 || true killall sdpd > /dev/null 2>&1 || true killall hcid > /dev/null 2>&1 || true exit 0 Does this seem reasonable? Aras Vaichas ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________