Skip to contentSkip to conversation

starting order in debian init script for bluez

Bluez-devel Matthias Thomae 3 participants 7 messages Jul 10, 2004 – Jul 11, 2004 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi Edd, all,

I noticed that in /etc/init.d/bluez-utils from bluez-utils 2.7-4, the hcd2hci command is executed after starting all other bluez stuff:

case "$1" in
start)

        echo -n "Starting $DESC:"
        start-stop-daemon --start --quiet --exec $HCID || true
        echo -n " $HCID_NAME"
        start_uarts || true
        start_rfcomm || true
        start-stop-daemon --start --quiet --exec $SDPD || true
        echo -n " $SDPD_NAME"
        start_pan || true
        start_hid || true
        echo "."
        enable_hci_input || true
        ;;

Wouldn't it be better to start it before rfcomm/sdpd/pand/hidd, to allow these services to use the dongle immediately?

I had a problem connection a Logitech-Hub-dongled PC to a NAP, and changing the order (and adding 'sleep 2' before start_pan, but that's a different story I guess) helped here.

Regards.
Matthias

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Matthias,

Quoted 18 lines

I noticed that in /etc/init.d/bluez-utils from bluez-utils 2.7-4, the hcd2hci command is executed after starting all other bluez stuff:

case "$1" in
start)

         echo -n "Starting $DESC:"
         start-stop-daemon --start --quiet --exec $HCID || true
         echo -n " $HCID_NAME"
         start_uarts || true
         start_rfcomm || true
         start-stop-daemon --start --quiet --exec $SDPD || true
         echo -n " $SDPD_NAME"
         start_pan || true
         start_hid || true
         echo "."
         enable_hci_input || true
         ;;
Quoted 2 lines

Wouldn't it be better to start it before rfcomm/sdpd/pand/hidd, to allow these services to use the dongle immediately?

no, because the hcid/sdpd/rfcomm/pand/hidd etc. can be started without any real device attached. And when you run hid2hci to switch into HCI mode, the hidd must already running to accept the reconnect from your HID devices.

Quoted 3 lines

I had a problem connection a Logitech-Hub-dongled PC to a NAP, and changing the order (and adding 'sleep 2' before start_pan, but that's a different story I guess) helped here.

If you start a client connection then this is really a different story.

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#2 lore raw

Hi Marcel, Edd,

Quoted 6 lines · Marcel Holtmann
Quoted 1 line

Wouldn't it be better to start it before rfcomm/sdpd/pand/hidd, to allow these services to use the dongle immediately?

no, because the hcid/sdpd/rfcomm/pand/hidd etc. can be started without any real device attached. And when you run hid2hci to switch into HCI mode, the hidd must already running to accept the reconnect from your HID devices.

Ok, I see.

Quoted 4 lines
Quoted 1 line

I had a problem connection a Logitech-Hub-dongled PC to a NAP, and changing the order (and adding 'sleep 2' before start_pan, but that's a different story I guess) helped here.

If you start a client connection then this is really a different story.

So it would still make sense to call hci2hid before rfcomm/dund/pand, wouldn't it?

BTW, this is exactly the case in the init script contained in bluez-utils 2.8:

start)

        echo -n "Starting $DESC:"
        if $HCID_ENABLE && [ -x "$HCID_EXEC" -a -f "$HCID_CONFIG" ] ; then
                $HCID_EXEC -f $HCID_CONFIG
                echo -n " $HCID_NAME"
        fi
        if $SDPD_ENABLE && [ -x "$SDPD_EXEC" ] ; then
                $SDPD_EXEC
                echo -n " $SDPD_NAME"
        fi
        if $HIDD_ENABLE && [ -x "$HIDD_EXEC" ] ; then
                $HIDD_EXEC $HIDD_OPTIONS --server || true
                echo -n " $HIDD_NAME"
        fi
        if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then
                $HID2HCI_EXEC --tohci > /dev/null 2>&1 || true
                echo -n " $HID2HCI_NAME"
        fi
        if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" 
] ; then
                $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true
                echo -n " $RFCOMM_NAME"
        fi
        if $DUND_ENABLE && [ -x "$DUND_EXEC" -a -n "$DUND_OPTIONS" ] ; then
                $DUND_EXEC $DUND_OPTIONS
                echo -n " $DUND_NAME"
        fi
        if $PAND_ENABLE && [ -x "$PAND_EXEC" -a -n "$PAND_OPTIONS" ] ; then
                $PAND_EXEC $PAND_OPTIONS
                echo -n " $PAND_NAME"
        fi
        echo "."
        ;;

Regards.
Matthias

maintainer
#3 lore raw

Hi Matthias,

Quoted 2 lines

So it would still make sense to call hci2hid before rfcomm/dund/pand, wouldn't it?

this depends on what you wanna do, but you should make sure that at least hcid and sdpd are running.

Quoted 2 lines

BTW, this is exactly the case in the init script contained in bluez-utils 2.8:

I know, because I wrote that init script. If you don't like the Debian init script or thing it is wrong, file a bug report for it.

Regards

Marcel

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#4 lore raw
Quoted 2 lines · Marcel Holtmann

I know, because I wrote that init script. If you don't like the Debian init script or thing it is wrong, file a bug report for it.

I thought I'd be writing directly to Edd as the Debian Maintainer. Let's see what he thinks about it.

Greets
Matthias

#5 lore raw
Quoted 6 lines · Matthias Thomae
Quoted 2 lines · Marcel Holtmann

I know, because I wrote that init script. If you don't like the Debian init script or thing it is wrong, file a bug report for it.

I thought I'd be writing directly to Edd as the Debian Maintainer. Let's see what he thinks about it.

Easiest way to get me to remember is to file a bug in the BTS. I have no objection to using the ordering in bluez-utils 2.8 etc. The existing script exists for legacy reasons.

-- Edd

#6 lore raw
Quoted 1 line · Edd Dumbill

Easiest way to get me to remember is to file a bug in the BTS. I have

Done, to get practise in filing debian bug reports, it was my first one :)

Quoted 2 lines

no objection to using the ordering in bluez-utils 2.8 etc. The existing script exists for legacy reasons.

Good.

Matthias

-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel