~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to vivid/etc/init/bluetooth.conf

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

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
expect fork
 
12
respawn
 
13
 
 
14
exec /usr/sbin/bluetoothd
 
15
 
 
16
post-start script
 
17
        [ "$VERBOSE" = no ] && redirect='>/dev/null 2>&1' || redirect=
 
18
 
 
19
        # start_uarts()
 
20
        if [ -x /usr/sbin/hciattach ] && [ -f $UART_CONF ];
 
21
        then
 
22
                grep -v '^#' $UART_CONF | while read i; do
 
23
                  eval "/usr/sbin/hciattach $i $redirect" || :
 
24
                done
 
25
        fi
 
26
 
 
27
        # start_rfcomm()
 
28
        if [ -x /usr/bin/rfcomm ] && [ -f $RFCOMM_CONF ] ;
 
29
        then
 
30
                # rfcomm must always succeed for now: users
 
31
                # may not yet have an rfcomm-enabled kernel
 
32
                eval "/usr/bin/rfcomm -f $RFCOMM_CONF bind all $redirect" || :
 
33
        fi
 
34
end script
 
35
 
 
36
post-stop script
 
37
        # stop_uarts()
 
38
        logger -t bluez "Stopping uarts"
 
39
        killall hciattach >/dev/null 2>&1 || :
 
40
 
 
41
        # stop_rfcomm()
 
42
        logger -t bluez "Stopping rfcomm"
 
43
        if [ -x /usr/bin/rfcomm ];
 
44
        then
 
45
                eval "/usr/bin/rfcomm unbind all $redirect" || :
 
46
        fi
 
47
end script