# HALd won't start any more - no crash, just sits there

## mu-sly

Hey all,

I'm having a strange issue with the HAL daemon, and I'm not quite sure where to start in tracking it down. Basically, it won't start - just sits there with:

```

 * Starting Hardware Abstraction Layer daemon ...

```

It doesn't seem to work "eventually" - others have had a similar problem that works after minutes if you wait, but mine doesn't seem to.

Initially this was preventing me from booting, so I booted in single-user mode and ran:

```

rc-update del hald default

```

So I can now boot, but without HAL - which is OK for the moment, I can cope!  :Wink: 

Now on running "/etc/init.d/hald start" as root, it just sits there until I press Ctrl-C, at which point it returns with:

```

 * ERROR:  hald caught an interrupt

```

So, let me run you through my current process of elimination in trying to work out what's going on here:

I have just today upgraded my kernel from gentoo-sources 2.6.22-gentoo-r5 to gentoo-sources 2.6.22-gentoo-r8. This seemed like the most obvious thing that would break it, but no, HALd won't start even when I boot with my previous kernel (which has been working fine with HAL for a month or more, and in general I've had HAL working for at least 9 months or so with various kernels, no problems).

For the sake of completeness, even though I don't think my kernel is the problem (due to old previously-working kernel not working with HAL either), the only thing I changed when I rebuilt my kernel today (apart from the minor version update) was to change Security Options: "Default Linux Capabilities" as a module this time, as opposed to compiled in which I had in 2.6.22-gentoo-r5. This is because I'm trying to set up Jack for audio work, so need realtime-lsm available to normal users (it had previously only been available to root, which wasn't satisfactory - getting Jack working properly has been "on my list" for a while now).

But again, I don't think it can be the kernel, since HAL now doesn't load with my old "working" kernel either.

I did an "emerge -DuavN world" yesterday, but there didn't appear to be anything too major in there, as it's not long since I last ran that. The new use flag I have added was "berkdb" (in relation to Python stuff and Spambayes), but I can't see that making any difference to HAL?

Python got upgraded a minor version release, as well as QT4, kdepim and a few other things, but I don't think there were any major upgrades in there of anything to do with HAL, with the possible exception of glib? (But why would that stop HAL working, when HAL wasn't updated?)

Looking in /var/log/portage, I can see the following HAL related files (excerpt of those that are relevant):

```

-rw-r--r--  1 root    portage   220920 2007-09-07 16:14 sys-apps:hal-0.5.9-r1:20070907-160955.log

-rw-r--r--  1 root    portage   221023 2007-09-11 09:26 sys-apps:hal-0.5.9-r1:20070911-092319.log

-rw-r--r--  1 root    portage   220583 2007-09-28 09:15 sys-apps:hal-0.5.9-r1:20070928-091040.log

```

HAL has definitely been working OK since the 11th, as it only broke today. The last line above is me recompiling it today to see if it made any difference, but it didn't.

Where do I start in looking for error messages and so on? There doesn't seem to be anything in dmesg. I took a look at /var/log/everything/current and found the following:

```

# grep hal current

Sep 28 09:29:42 [rc-scripts] ERROR:  hald caught an interrupt

```

...which I think is from the time it booted and HAL wouldn't load, so I pressed Ctrl-Alt-Del to reboot.

Gah, and finally, I just ran "/etc/init.d/hald start" again, just to make sure, and now it's doing:

```

* Starting Hardware Abstraction Layer daemon ...                                                                 [ !! ]

```

... and that [ !! ] isn't because it's already started (I checked that).

I've taken another look through /var/log and still can't find any sort of error messages. I'm sure it must be there somewhere, but I'm not sure where to look that I haven't already.

Here's my emerge info:

```

Portage 2.1.3.9 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r4, 2.6.22-gentoo-r8 i686)

=================================================================

System uname: 2.6.22-gentoo-r8 i686 AMD Athlon(TM) XP1800+

Timestamp of tree: Thu, 27 Sep 2007 12:00:01 +0000

ccache version 2.4 [enabled]

app-shells/bash:     3.2_p17

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.4.4-r5

dev-python/pycrypto: 2.0.1-r6

dev-util/ccache:     2.4-r7

sys-apps/baselayout: 1.12.9-r2

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.21

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -ftracer -pipe -msse -mmmx -m3dnow -mfpmath=sse"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"

CXXFLAGS="-march=athlon-xp -O2 -fomit-frame-pointer -ftracer -pipe -msse -mmmx -m3dnow -mfpmath=sse"

DISTDIR="/usr/portage/distfiles"

FEATURES="ccache distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://gentoo.virginmedia.com/ ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://ftp.easynet.nl/mirror/gentoo/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo/"

LANG="en_GB.UTF-8"

LC_ALL="en_GB.UTF-8"

LDFLAGS="-Wl,-O1"

LINGUAS="en_GB"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnow X a52 aac accessibility acpi alsa apache2 audiofile avi berkdb bitmap-fonts bzip2 c++ caps cdda cdio cdr cli cracklib crypt css ctype cups curl dba dbus dri dts dvd dvdr dvdread encode fastcgi fbcon ffmpeg firefox flac flash fmod foomaticdb freetype gcj gd gdbm geoip gif gimp gimpprint gnutls gphoto2 gpm gtk gtk2 hal hqsinc httpd iconv imagemagick ipv6 isdnlog jack java jpeg kde ladcca libsamplerate live mad matroska midi ming mmx modplug mozilla mozsvg mp3 mpeg mplayer mudflap mysql mysqli nas ncurses nls nocd nptl nptlonly nsplugin ogg oggvorbis opengl openmp pam pcre pdf pdflib perl php png postgres ppds pppd python qt3 qt3support qt4 quicktime radeon readline real reflection samba samplerate sdl session sndfile soap spl sse ssl stream svg svga tcpd theora tidy tiff truetype truetype-fonts type1-fonts unicode usb v4l vcd vhosts vlm vorbis win32codecs wxwindows x86 xine xml xorg xv xvid zlib" ALSA_CARDS="ice1712" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" CAMERAS="fuji" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" USERLAND="GNU" VIDEO_CARDS="radeon fglrx vesa fbdev"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

Thanks very much for any help offered!  :Smile: 

UPDATE: Here are the packages that were emerged yesterday and today - I'm sure the answer is in this list somewhere. (Some of these are me cleaning out multiple versions of things such as PHPMyAdmin.)

```

slynux portage # pwd

/var/log/portage

slynux portage # ls -la | grep 2007092[7-8]

-rw-r--r--  1 root    portage    16636 2007-09-28 00:33 app-arch:unrar-3.7.6:20070928-003152.log

-rw-r--r--  1 root    portage    17421 2007-09-28 04:59 app-misc:hal-info-20070618:20070928-045852.log

-rw-r--r--  1 root    portage     2633 2007-09-27 12:30 app-misc:pax-utils-0.1.16:20070927-123025.log

-rw-r--r--  1 root    portage      140 2007-09-27 14:05 dev-db:phpmyadmin-2.10.0.2:20070927-140531.log

-rw-r--r--  1 root    portage      210 2007-09-27 14:04 dev-db:phpmyadmin-2.6.3_p1:20070927-140428.log

-rw-r--r--  1 root    portage      140 2007-09-27 14:04 dev-db:phpmyadmin-2.6.4_p1:20070927-140431.log

-rw-r--r--  1 root    portage      140 2007-09-27 14:04 dev-db:phpmyadmin-2.6.4_p2:20070927-140436.log

-rw-r--r--  1 root    portage      140 2007-09-27 14:04 dev-db:phpmyadmin-2.6.4_p3:20070927-140440.log

-rw-r--r--  1 root    portage      141 2007-09-27 14:04 dev-db:phpmyadmin-2.6.4_rc1:20070927-140444.log

-rw-r--r--  1 root    portage      137 2007-09-27 14:04 dev-db:phpmyadmin-2.7.0:20070927-140422.log

-rw-r--r--  1 root    portage      143 2007-09-27 14:04 dev-db:phpmyadmin-2.7.0_beta1:20070927-140413.log

-rw-r--r--  1 root    portage      140 2007-09-27 14:04 dev-db:phpmyadmin-2.7.0_p1:20070927-140405.log

-rw-r--r--  1 root    portage      140 2007-09-27 14:04 dev-db:phpmyadmin-2.7.0_p2:20070927-140409.log

-rw-r--r--  1 root    portage      141 2007-09-27 14:04 dev-db:phpmyadmin-2.7.0_rc1:20070927-140417.log

-rw-r--r--  1 root    portage      137 2007-09-27 14:03 dev-db:phpmyadmin-2.8.0:20070927-140348.log

-rw-r--r--  1 root    portage      139 2007-09-27 14:03 dev-db:phpmyadmin-2.8.0.2:20070927-140335.log

-rw-r--r--  1 root    portage      139 2007-09-27 14:03 dev-db:phpmyadmin-2.8.0.3:20070927-140340.log

-rw-r--r--  1 root    portage      139 2007-09-27 14:03 dev-db:phpmyadmin-2.8.0.4:20070927-140344.log

-rw-r--r--  1 root    portage      143 2007-09-27 14:03 dev-db:phpmyadmin-2.8.0_beta1:20070927-140330.log

-rw-r--r--  1 root    portage      137 2007-09-27 14:03 dev-db:phpmyadmin-2.8.1:20070927-140352.log

-rw-r--r--  1 root    portage      137 2007-09-27 14:03 dev-db:phpmyadmin-2.8.2:20070927-140356.log

-rw-r--r--  1 root    portage      139 2007-09-27 14:03 dev-db:phpmyadmin-2.9.0.2:20070927-140315.log

-rw-r--r--  1 root    portage      139 2007-09-27 14:03 dev-db:phpmyadmin-2.9.0.3:20070927-140320.log

-rw-r--r--  1 root    portage      139 2007-09-27 14:03 dev-db:phpmyadmin-2.9.1.1:20070927-140324.log

-rw-r--r--  1 root    portage      141 2007-09-27 14:03 dev-db:phpmyadmin-2.9.2_rc1:20070927-140310.log

-rw-r--r--  1 root    portage  1317806 2007-09-27 13:08 dev-lang:php-5.2.4_p20070914-r2:20070927-123612.log

-rw-r--r--  1 root    portage     1533 2007-09-27 12:30 dev-lang:python-2.4.4-r4:20070927-123018.log

-rw-r--r--  1 root    portage   395954 2007-09-27 12:30 dev-lang:python-2.4.4-r5:20070927-122508.log

-rw-r--r--  1 root    portage   248691 2007-09-27 12:22 dev-libs:glib-2.14.1:20070927-121642.log

-rw-r--r--  1 root    portage    29292 2007-09-28 01:37 dev-libs:libusb-0.1.12-r1:20070928-013355.log

-rw-r--r--  1 root    portage   105006 2007-09-28 01:39 dev-libs:libxslt-1.1.20-r1:20070928-013736.log

-rw-r--r--  1 root    portage    16284 2007-09-28 00:45 dev-util:desktop-file-utils-0.14:20070928-004222.log

-rw-r--r--  1 root    portage    38105 2007-09-28 02:55 dev-util:esvn-0.6.12:20070928-025357.log

-rw-r--r--  1 root    portage      245 2007-09-28 02:53 gnome-base:libgnomeprint-2.18.0:20070928-025350.log

-rw-r--r--  1 root    portage   282502 2007-09-28 02:53 gnome-base:libgnomeprint-2.18.1:20070928-024843.log

-rw-r--r--  1 root    portage      245 2007-09-28 01:00 gnome-base:orbit-2.14.7:20070928-010006.log

-rw-r--r--  1 root    portage   291533 2007-09-28 00:59 gnome-base:orbit-2.14.8-r3:20070928-004545.log

-rw-r--r--  1 root    portage  2241973 2007-09-28 04:19 kde-base:kdepim-3.5.7-r4:20070928-025605.log

-rw-r--r--  1 root    portage      274 2007-09-28 04:58 media-gfx:gimp-2.4.0_rc2:20070928-045845.log

-rw-r--r--  1 root    portage  2291131 2007-09-28 04:58 media-gfx:gimp-2.4.0_rc3:20070928-042415.log

-rw-r--r--  1 root    portage   316792 2007-09-27 13:49 media-gfx:imagemagick-6.3.5.10:20070927-133044.log

-rw-r--r--  1 root    portage   278797 2007-09-28 04:24 media-libs:libgphoto2-2.4.0-r1:20070928-042018.log

-rw-r--r--  1 root    portage    75734 2007-09-28 00:40 media-libs:libvorbis-1.2.0:20070928-003404.log

-rw-r--r--  1 root    portage    43292 2007-09-27 12:24 media-libs:t1lib-5.0.2-r1:20070927-122249.log

-rw-r--r--  1 root    portage   694187 2007-09-28 01:24 media-video:ffmpeg-0.4.9_p20070616:20070928-010530.log

-rw-r--r--  1 root    portage   220583 2007-09-28 09:15 sys-apps:hal-0.5.9-r1:20070928-091040.log

-rw-r--r--  1 root    portage     2256 2007-09-28 08:07 sys-apps:realtime-lsm-0.8.5-r1:20070928-080727.log

-rw-r--r--  1 root    portage       71 2007-09-28 08:07 sys-apps:realtime-lsm-0.8.5-r1:20070928-080742.log

-rw-r--r--  1 root    portage     4605 2007-09-28 01:05 sys-kernel:gentoo-sources-2.6.22-r8:20070928-010014.log

-rw-r--r--  1 root    portage      749 2007-09-28 00:33 sys-process:cronbase-0.3.2-r1:20070928-003344.log

-rw-r--r--  1 root    portage    16589 2007-09-27 12:25 sys-process:psmisc-22.5-r2:20070927-122413.log

-rw-r--r--  1 root    portage  1291130 2007-09-27 13:30 x11-libs:gtk+-2.12.0-r2:20070927-130855.log

-rw-r--r--  1 root    portage      245 2007-09-28 01:33 x11-libs:libwnck-2.18.2:20070928-013338.log

-rw-r--r--  1 root    portage    68022 2007-09-28 01:33 x11-libs:libwnck-2.18.3:20070928-012448.log

-rw-r--r--  1 root    portage      490 2007-09-28 00:42 x11-libs:motif-config-0.9-r1:20070928-004132.log

-rw-r--r--  1 root    portage      245 2007-09-27 12:36 x11-libs:pango-1.16.5:20070927-123546.log

-rw-r--r--  1 root    portage   267880 2007-09-27 12:35 x11-libs:pango-1.18.2:20070927-123131.log

-rw-r--r--  1 root    portage  2638814 2007-09-28 02:47 x11-libs:qt-4.3.1-r1:20070928-014353.log

-rw-r--r--  1 root    portage      245 2007-09-28 01:43 x11-libs:vte-0.16.6-r1:20070928-014345.log

-rw-r--r--  1 root    portage   251753 2007-09-28 01:43 x11-libs:vte-0.16.8:20070928-013948.log

-rw-r--r--  1 root    portage    18750 2007-09-27 12:31 x11-misc:shared-mime-info-0.22:20070927-123047.log

-rw-r--r--  1 root    portage     2757 2007-09-27 12:22 x11-misc:xdg-utils-1.0.2:20070927-122241.log

```

----------

## coolsnowmen

I'ld run

```
 revdep-rebuild -p
```

and once that passes w/o any needs (or anything possibly relating to hal)

I'ld reemerge dbus and hal 

```
emerge -av1 dbus hal
```

If I still had problems with hal, and no one had posted recently on the forums to this respect, I'ld run it like this

```
hald --daemon=no --verbose=yes 2>&1 | grep -v "\[I\]"
```

and prayed that gave me some insight.

----------

## mu-sly

 *coolsnowmen wrote:*   

> I'd run
> 
> ```
>  revdep-rebuild -p
> ```
> ...

 

Thanks for your help, and sorry for the gap in replying - I did a whole lot of revdep-rebuilding until there was nothing left to rebuild, but I'm afraid I'm still stuck in the same place.

 *coolsnowmen wrote:*   

> 
> 
> If I still had problems with hal, and no one had posted recently on the forums to this respect, I'ld run it like this
> 
> ```
> ...

 

Well, here's the full output without the grep:

```

slynux dave # hald --daemon=no --verbose=yes 2>&1

16:42:54.641 [I] hald.c:533: hal 0.5.9

16:42:54.641 [I] hald.c:598: Will not daemonize

16:42:54.642 [I] hald_dbus.c:4807: local server is listening at unix:abstract=/var/run/hald/dbus-Ih2e7QFAVG,guid=38e2eb01d487c4b5b9b638004707bb0e

Runner started - allowed paths are '/usr/libexec:/usr/lib/hal/scripts:/usr/bin'

16:42:54.646 [I] hald_runner.c:299: Runner has pid 14844

16:42:54.647 [I] hald_runner.c:180: runner connection is 0x80962a8

16:42:54.649 [I] mmap_cache.c:251: cache mtime is 1191358658

Error binding udev_event socket: Address already in use

```

Seems to be the same whether X is running or not.

I also had something similar to this thread happening, with the error message about 'org.freedesktop.DBus', though can't seem to get it to do that any more (can't remember quite what produced that error).

Anyway, it's encouraging that someone else seems to have had the same problem as me, so I'm hoping they'll post what they did to solve it.

Thanks again for your help so far!

UPDATE: Seems this thread has a possible fix. I'm going to give it a try.

----------

## coolsnowmen

I'ld be interested if that solves the problem, if it does, perhaps we can get the maintainers to have the hald ebuild check for that INOTIFY support in the kernel and warn you if it does not

Do you genkernel, or build yourself?

My Inotify must have been on by default because I didn't pick it, and sure enough, it is enabled

----------

## mu-sly

 *coolsnowmen wrote:*   

> I'ld be interested if that solves the problem, if it does, perhaps we can get the maintainers to have the hald ebuild check for that INOTIFY support in the kernel and warn you if it does not
> 
> Do you genkernel, or build yourself?
> 
> My Inotify must have been on by default because I didn't pick it, and sure enough, it is enabled

 

OK, it's not INOTIFY. That was already enabled in my kernel:

```

[*] Inotify file change notification support

[*]   Inotify support for userspace

```

I do the self-build route, not genkernel.

So still no further on getting this to work.  :Sad: 

----------

## coolsnowmen

 *Quote:*   

> Error binding udev_event socket: Address already in use 

 

Have you updated udev? what version are you at? Perhaps you should

I'm also kind of wondering how you have binutils-2.18 when I only have 2.17-r1 with the same keyword (x86)

----------

## coolsnowmen

Do you have auto login?

Do you have any auto mounting samba shares?

----------

## mu-sly

 *coolsnowmen wrote:*   

> 
> 
> Have you updated udev? what version are you at? Perhaps you should

 

Udev version 114 - seems to be currently the only version in x86 stable.

 *coolsnowmen wrote:*   

> 
> 
> I'm also kind of wondering how you have binutils-2.18 when I only have 2.17-r1 with the same keyword (x86)

 

Seems I've got ~x86 for binutils. It's in my /etc/portage/package.keywords - not sure why, generally I only put ~x86 stuff in there when some package demands it, or when I want the absolute cutting edge stuff on non-critical things such as media and graphics utilities.

Perhaps I should remove it and re-emerge? (Everything on my system, emptytree?)

 *coolsnowmen wrote:*   

> Do you have auto login?
> 
> Do you have any auto mounting samba shares?

 

No to both of those.

Thanks for your continued assistance on this - I really appreciate it!

----------

## coolsnowmen

your welcome

FYI those questions came from a string of google search returns that suggested that udev timing/contention was the problem.  They were ubuntu users and some of them had success with delaying the start of some services, and restarting udev.

I noticed there is a udev related service, and there is also a command "udevstart"...aka I don't really know what th analogous of "restarting" udev on a gentoo system is.

as of now, ...if you care about the functionality of hal, an emerge -e hal isn't looking like such a bad idea right now

http://blog.ubrio.us/gnome/ubuntu-error-hal-failed-to-initialize-udev-address-already-in-use-solution/

edit, just a tip, you can put #comments in your keywords file so you remember if they were for fun or to solve a bug etc...

----------

