2004-07-10 18:27:50

by Matthias Thomae

[permalink] [raw]
Subject: [Bluez-devel] starting order in debian init script for bluez

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 http://www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2004-07-11 19:32:18

by Matthias Thomae

[permalink] [raw]
Subject: Re: [Bluez-devel] starting order in debian init script for bluez

Edd Dumbill wrote:
> 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 :)

> 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 http://www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2004-07-11 17:17:34

by Edd Dumbill

[permalink] [raw]
Subject: Re: [Bluez-devel] starting order in debian init script for bluez

On Sun, 2004-07-11 at 17:27 +0200, Matthias Thomae wrote:
> Marcel Holtmann wrote:
> > 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

2004-07-11 15:27:54

by Matthias Thomae

[permalink] [raw]
Subject: Re: [Bluez-devel] starting order in debian init script for bluez

Marcel Holtmann wrote:
> 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

2004-07-11 15:22:42

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] starting order in debian init script for bluez

Hi Matthias,

> 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.

> 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 http://www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2004-07-11 10:25:22

by Matthias Thomae

[permalink] [raw]
Subject: Re: [Bluez-devel] starting order in debian init script for bluez

Hi Marcel, Edd,

Marcel Holtmann wrote:
>>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.

>>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

2004-07-10 18:55:17

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] starting order in debian init script for bluez

Hi Matthias,

> 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?

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.

> 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 http://www.blackhat.com
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel