Jump to content

Small hints on dbus and hal (useful when updating)


scoonma
 Share

Recommended Posts

Hi all,

 

in the process of upgrading to new Mandriva versions I found it more or less regular that haldaemon refused to start during boot. Entering "service haldaemon start" manually as root often did not help either. The problem seemed to be quite common considered to google hits. hald does not write an error log by defaul and without an error message on console you're stuck at first. (hal can be hell...)

 

The purpose of hal is to present a transparent userspace layer for hardware accesss (HAL=Hardware Abstraction Layer). This is important i.e. for USB device access and many other type of hardware from Gnome-Desktop, for example. Relying on udev and dbus it builds a database for further use.

 

Most important is dbus/messagebus: hald won't work without. Messagebus has two components: One for the system side (which should be running now) and a user component. The system component starts first after booting (and probably you've managed to get it running so far). The user component does not start until "X" is started. So it's handy to care

 

1. for the system component,

 

2. then for hal, and

 

3. finally start X to let GDM or KDE or... (hopefully ;-) run the user component of messagebus fine when the rest is okay.

 

 

So you could do the following: Start your system into console mode.

 

Udev should be up and running. You should be root (su root, then give password) and type:

 

"service udev status"

 

If it's not working properly, make sure it does. Do an update if possible ("urpmi udev").

 

Typing "service messagebus status" should result in a message that dbus-daemon is running with some PID number. This is the process ID of the dbus-system part. hald will try to connect to it. You can check the number by using "ps". The number printed out should be identical to the entry in line with 'dbus-daemon --system' here (ps output).

 

Note that names can be somehow confusing at the beginning: 'dbus-daemon' is the program actually run, 'messagebus' denotes the according service. For hal it's 'hald' (actual program) and 'haldaemon' (service).

 

You can find the configuration files of messagebus in '/etc/dbus-1'. This is the place you should begin consistency checking if something is wrong. Closely inspect the system.conf. Hal attaches to dbus not only through the PID given here, but also relies on the local socket. So the most important entries here are:

 

<pidfile>/var/run/messagebus.pid</pidfile> (The process id number you should have seen)

 

and

 

<listen>unix:path=/var/run/dbus/system_dbus_socket</listen>

 

 

Now messagebus and haldaemon shall both be started at boot time. Hald is invoked from /etc/initd./haldaemon. For messagebus we have /etc/init.d/messagebus. The names of the services and processes are given here, too. So check /etc/init.d/messagebus, wether it contains the same full path entry for the pid file as given in /etc/dbus-1.

 

Be aware of overall consistency! You could search for hours, when in one place 'dbus-1' as a path component is given, but another config file tries to access .../dbus/... (i.e. socket path in /etc/dbus-1).

 

So hopefully you managed to get messagebus up and running by now.

 

Hald builds his database by looking at your hardware. If typing "service haldaemon start" still won't work, you could do this by typing the following:

 

"hald --verbose=yes --daemon=no"

 

It prints out a big bunch of messages (use Scroll & Stop on keyboard to check). This can take a few minutes, depending on your hardware. But finally when it comes to an end the database should be rewritten and ready to use. Exit with Ctrl-C and try again: "service haldaemon start")

 

If something goes wrong, you could check hal.conf (residing in /etc/dbus/system.d/ ). Sometimes it's necessary that hal's policies are being updated. So you could do the following:

 

1. Find out the package names of hal and libhal ("urpmq hal" and "urpmq libhal")

 

2. Force-delete these packages (i.e. "rpm -e --nodeps libhal0"; "rpm -e --nodeps hal")

 

3. Reinstall hal: "urpmi hal"; "urpmi libhal1" (or "urpmi libhal0")

 

Then step back to rebuilding the hal database. Afterwards you may be able "service haldaemon start" successfully. The rest (i.e. invoking the user-components of messagebus) should be done automatically by your X system. Try "startx" as normal user from console and see if it works.

 

Good luck!

 

Scoonma

 

 

 

See also:

 

HAL: http://www.freedesktop.org/wiki/Software_2fhal

 

(Messagebus is from GNOME, server actually in transit)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...