hciattach & hcid should be running as user "bluetooth" with both of them in
group bluetooth & net_bt_admin.
If you are in development....
just remove the ANDROID_PARANOID_NETWORK option from your kernel.

regards,
Pavan


On Mon, Feb 2, 2009 at 5:40 PM, Sidharth Malhotra <[email protected]> wrote:

>
> Hi Nick,
>
> I have been a silent observer of this group till now, but now I am
> kinda stuck. I am able to run hciattach, hciconfig, hcitool, etc. but
> while running hcid I get this error message:
>
> "
> bash-3.2# hcid
> hcid[1155]: Bluetooth HCI daemon
> hcid[1155]: Create and Bind socket
> hcid[1155]: Can't open HCI socket: Operation not permitted (1)
> hcid[1155]: Cant open HCI socket: Bad file number (9
> "
>
> Can you tell me how to avoid this? I can run hcid (start hcid) with
> "bluetooth" user, but I guess since hcid is not running in root user
> mode, I am facing this error. The relevant hcid entry in init.rc file
> is:
> service hcid /system/bin/logwrapper /system/bin/hcid -d -s -n -f
> system/etc/hcid.conf
>    socket bluetooth stream 660 bluetooth bluetooth
>    socket dbus_bluetooth stream 660 bluetooth bluetooth
>    # init.rc does not yet support applying capabilities, so run as
> root and
>    # let hcid drop uid to bluetooth with the right linux capabilities
>    group bluetooth net_bt_admin misc
>    user root
>    group bluetooth net_bt_admin misc
> #   disabled
>    oneshot
>
> Still, when I do a ps, I cannot see hcid running.
>
> Thanks,
> Sidharth
>
> On Dec 9 2008, 2:34 am, Nick Pelly <[email protected]> wrote:
> > This is some Android specific magic.
> >
> > When two linux processes wish to communicate via a unix domain socket on
> a
> > traditional linux distribution they often use /tmp. However on Android we
> > got rid of /tmp for security and storage accountability reasons. Instead
> a
> > mechanism was introduced for daemons to request a unix domain socket in
> > /dev/socket than the init process creates on behalf of the daemon. The
> > daemon just picks up the file descriptor from the environment.
> >
> > See
> > /dev/socket
> > #define ANDROID_SOCKET_DIR
> > system/core/init/readme.txt keyword socket
> >
> > The error you show here seems to indicate that hcid was unable to open
> the
> > socket provided by init. Perhaps you did not use the socket syntax in
> your
> > init.rc
> >
> > Nick
> > Android Systems Engineer
> >
> >
> >
> > On Mon, Dec 8, 2008 at 1:16 PM, pavan savoy <[email protected]>
> wrote:
> > > Hi,
> >
> > > I started the bluez hcid as root, after disabling the kernel feature
> that
> > > blocks creation of sockets [CONFIG_ANDROID_PARANOID_NETWORK] in the
> kernel,
> >
> > > Now If I start off hcid, I realise that the SDP server, isn't being
> > > initialised properly.
> >
> > > I get the error...
> >
> > > # hcid -f /etc/hcid.conf -d -n
> > > hcid[681]: Bluetooth HCI daemon
> > > hcid[681]: Enabling debug information
> > > hcid[681]: Starting SDP server
> > > hcid[681]: Adding rec : 0x3b628
> > > hcid[681]: with handle : 0x1
> > > hcid[681]: Adding rec : 0x3b788
> > > hcid[681]: with handle : 0x0
> > > hcid[681]: Service classes 0x00
> > > hcid[681]: Unable to get the control socket for 'bluetooth'
> > > hcid[681]: Server initialization failed
> >
> > > What is the reason ? where is android_get_control_socket defined, why
> do we
> > > need it ?
> >
> > > regards,
> > > Pavan- Hide quoted text -
> >
> > - Show quoted text -
> >
>

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to