dbus_bus_request_name (): Connections are not allowed to own the service

Error on starting RIL daemon using dbus: “dbus_bus_request_name() failed (“Connection “connection_name” is not allowed to own the service “service_id” due to security policies in the configuration file”)”.


Make sure that access is granted in configuration file for user and group running the application

<!DOCTYPE busconfig PUBLIC 
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"

<policy user="user">
<allow own="service_id"/>

<policy group="group">
<allow own="service_id"/>

<policy context="default">
<allow send_destination="service_id"/>
<allow receive_sender="service_id"/>


Copy configuration file into /etc/dbus-1/system.d.

Read more

How to build and install cmocka?

Step into directory containing sources and create build sub-directory.

Step into build directory and execute

$ make


$ sudo make install

Download cmocka

cmocka at GitHub


How to create self-extracting script for Android?

This is useful for consistent updating RIL, applications and configuration file.

Idea is to add compressed binary at the end of executable shell script file.

Step 1

On the build machine create payload directory and copy files into it.

Step 2

Create script installer in that directory which should do installation of components on target platform.

Step 3

Move one level up from payload directory and create decompress script with following content:

echo “”
echo “Self Extracting Installer”
echo “”

# Creates temporary directory.
export TMPDIR=`mktemp -d selfextract.XXXXXX`

# Searches for marker of beginning of binary data.
ARCHIVE=`sed -n ‘/^__ARCHIVE_BELOW__/=’ $0`

# Adds 1 to get next line after the marker.

# Extracts binary data into temporary directory.
tail -n+$ARCHIVE $0 | tar xv -C $TMPDIR

# Stores current directory, goes to the temporary
# directory and starts the install script.

# Returns back and removes temporary directory.
cd $CDIR
rm -rf $TMPDIR

# Prevents executing binary data.
exit 0

# No extra lines should be added after the marker.

Step 4

Create build script having following content:

# Compresses payload data.
cd payload
tar cf ../payload.tar ./*
cd ..

if [ -e “payload.tar” ]; then
# Data aren’t compressed due to lack of gunzip on target platform.
# Concatenates the decompressing script with binary data.
cat decompress payload.tar > selfextract.bsx
echo “payload.tar does not exist”
exit 1

echo “selextract.bsx created”
exit 0

Step 5

Execute build script. Make sure that selfextract.bsx file is created.

Step 6

Copy selfextract.bsx file to target device, change file mode by

# chmod 755 selfextract.bsx

and execute it by

# ./selfextract.bsx

Make sure that files were updated successfully.

Read in more details

Bash Self-Extracting Script

How to make a self-extracting shell script from a TAR archive

Use grep to report back only line numbers

Sed Command in Linux/Unix with examples

Alternative to awk

The main differences from the solution proposed in referenced articles are:

  • sed utility is used instead of awk because the latter is not included in Android distribution by default;
  • compressing by gzip is not used because gunzip utility is not included as well.

How to get debug output from pppd on Android-x86

Disable starting ppp as a service (comment corresponding lines in file /hardware/ril/rild/rild.rc)

service ril-daemon /system/bin/rild
    class main
    socket rild stream 660 root radio
    socket rild-debug stream 660 radio system
    user root
    group radio cache inet misc audio log readproc wakelock

#service ppp /system/bin/pppd call gprs
#    user root
#    group system radio
#    disabled
#    oneshot

and start pppd manually with redirecting stderr output

# pppd call gprs &>/data/misc/radio/pppd.log

Bash Reference Manual

Logcat command-line tool