Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: btpand exec at boot time



On Mon, 6 Apr 2009, KIYOHARA Takashi wrote:

> > I have no simple method to arrange this at the moment, I use a script for
> > up/down. Best place is probably rc.local so far but I have been looking
> > into using a routing socket so that btpand can manage the interface more
> > actively and I'm hoping to add a 'persistent' mode for a client, so that
> > you can initialize the interface and use ifconfig up/down to make or break
> > the link, plus some other things relating to the service record.
>
> hmm...
> I execute btpand (and obexapp) in /etc/rc.local.  However I see this
> messages.
>
>   Starting bthcid.
>   Starting local daemons:.
>   Starting obexapp.
>   Apr  5 22:02:38 obexapp[261]: obexapp_server(): Could to open local SDP 
> session. No such file or directory (2)
>   Record: not found
>   Updating motd.
>   Starting sdpd.
>    :
>    :
>
>
> The btpand can execute with option '-S', if SDP is absent perhaps.

Yes but I don't really like that option. (SDP should always be used :),
you can start sdpd in rc.local also to control the ordering or just add
BEFORE: local to /etc/rc.d/sdpd will make it start up first.

> How do you start obexapp?  I hope to start sdpd more beforehand.

I use

obexapp=YES
obexapp_channel="10"

in /etc/rc.conf

probably is needed a /etc/rc.d/btpand using /etc/bluetooth/btpand.conf to
start daemons as required. Something like (incomplete, not tested, could
be better) attached?

iain
#!/bin/sh
#
# $NetBSD$
#

# PROVIDE: btpand
# REQUIRE: bluetooth bthcid sdpd
# BEFORE:  LOGIN

$_rc_subr_loaded . /etc/rc.subr

name="btpand"
rcvar=${name}
required_files="/etc/bluetooth/btpand.conf"

start_cmd=btpand_start
stop_cmd=btpand_stop
status_cmd=btpand_status

btpand_start()
{

        while read -r service device flags; do
                case "${service}" in
                \#*|"")
                        continue
                        ;;
                esac

                if [ -z "${device}" ]; then
                        echo "${name}: invalid entry"
                        return 1
                fi

                /usr/sbin/btpand -d ${device} -s ${service} ${flags:-"-m auth"}
        done < /etc/bluetooth/btpand.conf
}

btpand_stop()
{
}

btpand_status()
{
}

load_rc_config ${name}
run_rc_command "$1"


Home | Main Index | Thread Index | Old Index