# Is hcid init script (bluetooth) missing or not coded yet?

## Dunster

Hi,

I've managed to get my T68i phone syncing with Evolution over bluetooth. It is very cool, when you add a contact in Evolution if the phone is in bluetooth range it is automatically updated. This is very handy for keeping all your numbers with you and current. The calendar and tasks also sync nicely as well. Its been quite stable and is the best phone synching solution I've ever had!

The syncing is done by multisync 0.80 which has an ebuild in bugs.gentoo.org. I emerged it with the following command:

USE="irmc evo" emerge multisync

I used the 2.6 test4 kernel and enabled bluetooth in the config and my USB bluetooth dongle actually worked.

I also emerged bluez-lib and some others.

To bring up bluetooth I do the following:

hciconfig hci0 up

hcid /etc/bluetooth/hcid.conf

It all magically works. However, I need an init script to bringing all up, shutdown and restart like other init scripts in Gentoo. Has this init script been written yet? Perhaps I missed it somewhere?

I think the script should be called /etc/init.d/hcid.

Thanks for any info.

----------

## goalie31

Hi Dunster!

I've noticed the same "problem"... and made an init script myself. It's my first self-made init script so it might be buggy  :Wink:  But it runs fine for me

```
#!/sbin/runscript

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

#depend() {

#   ???

#}

checkconfig() {

        modprobe bluez &> /dev/null

        modprobe hci_usb &> /dev/null

        modprobe rfcomm &> /dev/null

        modprobe l2cap &> /dev/null

        modprobe sco &> /dev/null

        if [ ! -e /proc/bluetooth ] ; then

                eerror "Bluetooth not supported by the kernel"

                return 1

        fi

        

}

start() {

        checkconfig || return 1

        ebegin "Starting Bluetooth..."

        start-stop-daemon --start --quiet --exec /usr/sbin/hcid

        eend $? "Failed to start bluetooth"

}

stop() {

        ebegin "Stopping Bluetooth"

        start-stop-daemon --stop --quiet --exec /usr/sbin/hcid

        rmmod sco & > /dev/null

        rmmod l2cap & > /dev/null

        rmmod rfcomm & > /dev/null

        rmmod hci_usb & > /dev/null

        rmmod bluez & > /dev/null

        eend $? "Failed to stop bluetooth"

} 

```

The rmmod commands for hci_usb and bluez work only if the usb bluetooth adapter is plugged out. If you don't need one of the modules just comment them out!

----------

## Dunster

Thanks Goalie,

This looks great. I'll install it and test it.

It would be nice to see this part Gentoo. I'm not sure how init scripts become part of Gentoo if the project such as "bluez-libs" doesn't include the init script on its own.

----------

## scoobydu

Seems like this is added by default now  :Smile: 

cheers

scooby

----------

## cbueche

 *scoobydu wrote:*   

> Seems like this is added by default now 
> 
> cheers
> 
> scooby

 

Where ?

I emerged bluez-utils, bluez-sdp, bluez-pan, bluez-libs, but the init script is still missing. Do I have to emerge bluez-kernel ? I run 2.4.22-gentoo-test-r1, so bluetooth is included.

Charles

----------

