Problems initializing daemon user cache

Schmottlach, Glenn GSchmott at
Fri Nov 7 06:14:30 PST 2008

I'm working on porting DBus 1.2.4 and the associated daemon to QNX
Neutrino on an SH4. I managed to get the library and daemon built but
when I launch the daemon I get the following error:


520233: Allocated slot 0 on allocator 811cffc total 1 slots allocated 1

520233: Falling back to pseudorandom for 12 bytes

520233: file fd 3 opened

520233: listening on unix socket /var/run/dbus/system_bus_socket

520233: socket fd 3 opened

520233: LOCAL_CREDS enabled for further messages on fd 3

520233: Falling back to pseudorandom for 12 bytes

520233: Initialized server on address

520233: Adding a read watch on fd 3 using newly-set add watch function

520233: Failed to open directory
tem-services: Failed to read directory
stem-services": No such file or directory


520233: Allocated slot 0 on allocator 811cfb0 total 1 slots allocated 1

520233: No cache for UID 0

520233: Finalizing bus context 81210a0

520233: Removing all pre-existing watches

520233: Setting watch fd 3 data to data = 0 function = 0 from data = 0
function = 0

520233: Freeing slot 0 on allocator 811cfb0 total 1 allocated 1 used

520233: Freeing slot 0 on allocator 811cffc total 1 allocated 1 used

Failed to start message bus: Could not get UID and GID for username


Obviously it *appears* to fail getting the UID and GID for "root". The
daemon is launched as "root" and I traced through the code. Here's the
call stack


8 _dbus_user_database_lookup() ..\..\dbus\dbus-userdb.c:147 0x080dbeb8

7 _dbus_user_database_get_uid() ..\..\dbus\dbus-userdb.c:640 0x080dcbca

6 init_system_db() ..\..\dbus\dbus-userdb.c:249 0x080dc2b8         

5 _dbus_user_database_get_system() ..\..\dbus\dbus-userdb.c:335

4 _dbus_get_user_id_and_primary_group()
..\..\dbus\dbus-userdb-util.c:172 0x080e781a     

3 _dbus_verify_daemon_user() ..\..\dbus\dbus-sysdeps-util-unix.c:302

2 bus_context_new() ..\..\bus\bus.c:691 0x08055d92        

1 main() ..\..\bus\main.c:443 0x0807a888 


The UID for root is of course zero (0) and in
_dbus_user_database_lookup() it tries to look up the cached value for
this user. Since the user cache has just been created and initialized,
the database is empty and the lookup fails. This susequently cascades
out as an error and startup fails. Maybe I'm missing something here, but
how is the user cache supposed to be filled initially when the daemon
starts up? It almost seems like my startup will fail no matter who
starts the daemon (root or someone else).  Perhaps the cache behavior is
somehow different on Linux but I need to understand how the user cache
is expected to work on startup. Can anyone help me out and offer some
suggestions how I might get past this startup issue? 
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the dbus mailing list