~bluetooth/bluez/ubuntu

« back to all changes in this revision

Viewing changes to debian/bluez.bluetooth.upstart

  • Committer: simon.busch at canonical
  • Date: 2015-08-14 10:04:55 UTC
  • Revision ID: simon.busch@canonical.com-20150814100455-2nfs8l8r3fuly8ws
Add current packaging bits from wily

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# bluez - bluetooth daemon
 
2
 
 
3
description     "bluetooth daemon"
 
4
 
 
5
start on started dbus
 
6
stop on stopping dbus
 
7
 
 
8
env UART_CONF=/etc/bluetooth/uart
 
9
env RFCOMM_CONF=/etc/bluetooth/rfcomm.conf
 
10
 
 
11
respawn
 
12
 
 
13
exec /usr/sbin/bluetoothd
 
14
 
 
15
post-start script
 
16
        [ "$VERBOSE" = no ] && redirect='>/dev/null 2>&1' || redirect=
 
17
 
 
18
        # start_uarts()
 
19
        if [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];
 
20
        then
 
21
                grep -v '^#' $UART_CONF | while read i; do
 
22
                  eval "/usr/sbin/hciattach $i $redirect" || :
 
23
                done
 
24
        fi
 
25
 
 
26
        # start_rfcomm()
 
27
        if [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;
 
28
        then
 
29
                # rfcomm must always succeed for now: users
 
30
                # may not yet have an rfcomm-enabled kernel
 
31
                eval "/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect" || :
 
32
        fi
 
33
end script
 
34
 
 
35
post-stop script
 
36
        # stop_uarts()
 
37
        logger -t bluez "Stopping uarts"
 
38
        killall hciattach >/dev/null 2>&1 || :
 
39
 
 
40
        # stop_rfcomm()
 
41
        logger -t bluez "Stopping rfcomm"
 
42
        if [ -x /usr/bin/rfcomm ];
 
43
        then
 
44
                eval "/usr/bin/rfcomm unbind all $redirect" || :
 
45
        fi
 
46
end script