acpid install fails (because of hal running)

Bug #63450 reported by Subhuman
296
This bug affects 8 people
Affects Status Importance Assigned to Milestone
acpid (Debian)
Fix Released
Unknown
acpid (Ubuntu)
Fix Released
High
Michael Vogt

Bug Description

On upgrading from dapper to the edgy beta, the installer failed on the acpid update, because acpid fails to install, acpi-support cannot install, and therfore the required packages in the meta package ubuntu-desktop cannot be met.

The error is as follows:
Setting up acpid (1.0.4-5ubuntu4) ...
 * Loading ACPI modules... [ ok ]
 * Starting ACPI services... acpid: can't open /proc/acpi/event: Device or resource busy
invoke-rc.d: initscript acpid, action "start" failed.
dpkg: error processing acpid (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of acpi-support:
 acpi-support depends on acpid (>= 1.0.4-1ubuntu4); however:
  Package acpid is not configured yet.
dpkg: error processing acpi-support (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on acpi-support; however:
  Package acpi-support is not configured yet.
 ubuntu-desktop depends on acpid; however:
  Package acpid is not configured yet.
dpkg: error processing ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 acpid
 acpi-support
 ubuntu-desktop
E: Sub-process /usr/bin/dpkg returned an error code (1)

If any other logs are required please specify.

TESTCASE:
1. Remove acpid
2. Restart hal
3. Install acpid
=> Failure

Revision history for this message
Subhuman (jacknicoll) wrote :

I have now found a fix for this, running:
"sudo killall hald "
and then
"sudo dpkg --configure -a"
This seems to fix the "device or resource busy" error and therefore allows acpid, acpi-support and ubuntu-desktop to install

Revision history for this message
Julien Humbert (julroy67) wrote :

Yes, right, I had the same problem and this had fix it.

Revision history for this message
Yves Junqueira (yves.junqueira) wrote :

The postinst script is not indempotent. One possible fix is:

--- /tmp/acpid.postinst 2006-10-23 17:00:28.000000000 -0200
+++ acpid.postinst 2006-10-23 17:01:18.000000000 -0200
@@ -11,9 +11,9 @@
 if [ -x "/etc/init.d/acpid" ]; then
        update-rc.d acpid multiuser 10 21 >/dev/null
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d acpid start || exit $?
+ invoke-rc.d acpid restart || exit $?
        else
- /etc/init.d/acpid start || exit $?
+ /etc/init.d/acpid restart || exit $?
        fi
 fi
 # End automatically added section

Changed in acpid:
status: Unconfirmed → Confirmed
Revision history for this message
Risto H. Kurppa (risto.kurppa) wrote :

Same problem here, acpid and acpi-support fail to configure..

"sudo killall hald "
and then
"sudo dpkg --configure -a"

didn't help..

Revision history for this message
Risto H. Kurppa (risto.kurppa) wrote :
Revision history for this message
Florian Jensen (florian.jensen) wrote :

This bug also exists during the upgrade from edgy to feisty.

The fix above works.

Revision history for this message
Kacper Antosik (kiperz) wrote :

It exists after updating from fiesty to gutsy, fix up did it job.

Revision history for this message
Rudd-O (rudd-o) wrote :

the fix didn't work for me. as a matter of fact I just uninstalled all acpi crap and I had to remove kubuntu-desktop metapackage as well.

I think this is because hal is opening /proc/acpi/event first. Or perhaps other process...

Revision history for this message
Florian Jensen (florian.jensen) wrote :

Same problem when upgrading from Feisty to Gutsy

root@Zeus:~# dpkg --configure -a
Setting up acpid (1.0.4-5ubuntu8) ...
 * Loading ACPI modules... [ OK ]
 * Starting ACPI services... invoke-rc.d: initscript acpid, action "start" failed.
dpkg: error processing acpid (--configure):
 subprocess post-installation script returned error exit status 1
Setting up snmpd (5.3.1-6ubuntu2) ...
Starting network management services:invoke-rc.d: initscript snmpd, action "start" failed.
dpkg: error processing snmpd (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of acpi-support:
 acpi-support depends on acpid (>= 1.0.4-1ubuntu4); however:
  Package acpid is not configured yet.
dpkg: error processing acpi-support (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of powermanagement-interface:
 powermanagement-interface depends on acpi-support (>= 0.17); however:
  Package acpi-support is not configured yet.
dpkg: error processing powermanagement-interface (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of kubuntu-desktop:
 kubuntu-desktop depends on acpi-support; however:
  Package acpi-support is not configured yet.
 kubuntu-desktop depends on acpid; however:
  Package acpid is not configured yet.
 kubuntu-desktop depends on powermanagement-interface; however:
  Package powermanagement-interface is not configured yet.
dpkg: error processing kubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 acpid
 snmpd
 acpi-support
 powermanagement-interface
 kubuntu-desktop
root@Zeus:~#

Revision history for this message
Christian Haeberli (christian-haeberli) wrote :

Same for me when upgrading from Feisty to Gutsy.

* Loading ACPI modules... [ OK ]
 * Starting ACPI services... invoke-rc.d: initscript acpid, action "start" failed.

The workaround of stopping acpid manually before running 'dpkg --configure -a' worked for me.

I think that the issue should be addressed, because it is a stumbling stone for people who are upgrading their Kubuntu installation.

Revision history for this message
Erik de Castro Lopo (erikd) wrote :

Same problem on Gutsy to Hardy Heron upgrade.

Fixed by doing:

    sudo /etc/init.d/acpid stop
    sudo dpkg --configure -a
    sudo /etc/init.d/acpid start

Revision history for this message
Whit Blauvelt (whit-launchpad) wrote :

Also the same problem on a Gutsy server fresh installation, although can't recall if acpi has been included in an upgrade within Gutsy since install. Fix just above worked.

Revision history for this message
Popa Adrian Marius (mapopa) wrote :

confirmed in hardy too
I have installed the server version and then

sudo apt-get install ubuntu-desktop
and at the end i had that error

so these lines worked for me (thanks Erik )
sudo /etc/init.d/acpid stop
sudo dpkg --configure -a

Revision history for this message
Popa Adrian Marius (mapopa) wrote :

here is the install error log for ubuntu-desktop

Errors were encountered while processing:
 acpid
 acpi-support
 powermanagement-interface
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up acpid (1.0.4-5ubuntu8) ...
 * Loading ACPI modules...
   ...done.
 * Starting ACPI services...
invoke-rc.d: initscript acpid, action "start" failed.
dpkg: error processing acpid (--configure):
 subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of acpi-support:
 acpi-support depends on acpid (>= 1.0.4-1ubuntu4); however:
  Package acpid is not configured yet.
dpkg: error processing acpi-support (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of powermanagement-interface:
 powermanagement-interface depends on acpi-support (>= 0.17); however:
  Package acpi-support is not configured yet.
dpkg: error processing powermanagement-interface (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 acpid
 acpi-support
 powermanagement-interface

Revision history for this message
machak (machak) wrote :

sudo dpkg --configure -a
Setting up acpid (1.0.4-5ubuntu8) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing acpid (--configure):
 subprocess post-installation script returned error exit status 1
Setting up pulseaudio (0.9.9-1ubuntu2) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing pulseaudio (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 acpid
 pulseaudio

Revision history for this message
Daniel Hahler (blueyed) wrote :

The simple reason for this appears to be that the acpid init script, invoked with "start" should not fail, if acpid is already running.
I'll provide a patch for this.

Changed in acpid:
assignee: nobody → blueyed
importance: Undecided → High
milestone: none → ubuntu-8.04
status: Confirmed → In Progress
Revision history for this message
Daniel Hahler (blueyed) wrote :

  * debian/acpid.init.d: Add "--oknodo" to the start-stop-daemon call in
    "start". The action must not fail, if acpid is already running.
    (LP: #63450)

Subscribed ubuntu-main-sponsors.

Changed in acpid:
assignee: blueyed → nobody
status: In Progress → Triaged
Revision history for this message
Daniel Hahler (blueyed) wrote :

While "start" should never fail for an init script, when the process is already running (which gets fixed above), the real problem appears to be hal running, when acpid gets installed (not upgraded).

I've taken the fix for this from Debian bug 380520 (http://bugs.debian.org/380520) and added it to the debdiff.
This appears to be the real reason for this bug, but I've left the --oknodo in there, which is a reasonable fix, too.

description: updated
Revision history for this message
Daniel Holbach (dholbach) wrote :

Michael: can you please take a look at it? Is this change OK for dapper->hardy upgrades?

Revision history for this message
Steve Langasek (vorlon) wrote :

I believe this change is correct (and necessary), but I wouldn't like to be both the sponsor and the reviewer this close to release. Michael, does this look ok to you, or do you have concerns about a hal restart on the upgrade path, which I guess may be what Daniel was suggesting?

Michael Vogt (mvo)
Changed in acpid:
assignee: nobody → mvo
status: Triaged → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for the patch.

I applied it and modified it to not start/stop hald on dapper->hardy upgrades. That works fine.

However on a testupgrade with gutsy->hardy and this package it hangs on

Setting up acpid (1.0.4-5ubuntu9) ...
Installing new version of config file /etc/init.d/acpid ...
 * Stopping Hardware abstraction layer hald
   ...done.
 * Starting Hardware abstraction layer hald

strace shows that it hangs in select() (this is in a kvm VM).

Revision history for this message
Martin Pitt (pitti) wrote :

This looks like a bit of a hack, but acceptable enough for hardy IMHO.

I cannot say anything about the hanging hal startup, that would need a hald --verbose=yes --daemon=no output.

Revision history for this message
Michael Vogt (mvo) wrote :

It looks like it fails with the following error:

00:17:09.508 [I] hald.c:669: hal 0.5.11rc2^M
00:17:09.508 [I] hald.c:734: Will not daemonize^M
00:17:09.508 [I] hald_dbus.c:5381: local server is listening at unix:abstract=/var/run/hald/dbus-BMPCogLaGK,guid=351451954fbd37ffc1a936d348067ae5^M
00:17:09.512 [E] ck-tracker.c:367: Error doing GetSeats on ConsoleKit: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files^M
00:17:09.512 [E] ck-tracker.c:792: Could not get seats and sessions^M
00:17:09.512 [W] hald_dbus.c:5806: Could not initialize seats and sessions from ConsoleKit^M
00:17:09.520 [I] hald_runner.c:301: Runner has pid 10617^M
Runner started - allowed paths are '/usr/lib/hal:/usr/lib/hal/scripts:/usr/bin'^M
00:17:09.524 [I] hald_runner.c:182: runner connection is 0x80a5e28^M
00:17:09.524 [W] osspec.c:373: Unable to open /proc/mdstat: No such file or directory^M
[WARN 10616] polkit-error.c:143:polkit_error_get_error_message(): error != NULL^M
 Not built with -rdynamic so unable to print a backtrace^M
*** [DIE] hald.c:main():785 : Could not init PolicyKit context: (null)^M
dpkg: error processing acpid (--configure):^M
 subprocess post-installation script returned error exit status 1^M

Revision history for this message
Michael Vogt (mvo) wrote :

Hm, that might be a side effect of the following problem:

[95.6009] policykit: Configuring policykit
 * Reloading system message bus config...^M
Error org.freedesktop.DBus.Error.Failed: Element <standard_system_servicedirs> not allowed inside <busconfig> in configuration file^M
invoke-rc.d: initscript dbus, action "reload" failed.^M
^M

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 63450] Re: acpid install fails (because of hal running)

Michael Vogt [2008-04-16 22:26 -0000]:
> Hm, that might be a side effect of the following problem:
>
> [95.6009] policykit: Configuring policykit
> * Reloading system message bus config...^M
> Error org.freedesktop.DBus.Error.Failed: Element <standard_system_servicedirs> not allowed inside <busconfig> in configuration file^M
> invoke-rc.d: initscript dbus, action "reload" failed.^M

That would be it, yes. Was this during an upgrade from dapper? Please
keep in mind that hal should not be restarted on upgrades from earlier
than gutsy. The current acpi patch from above restarts it
unconditionally, but you mentioned that you changed this?

Revision history for this message
Michael Vogt (mvo) wrote :

This is a gutsy->hardy upgrade, attached is the full log of the upgrade until the hang.

Revision history for this message
Michael Vogt (mvo) wrote :

There is something funny going on with dbus I think, when the hal start fails (I sent a ctrl-c), then I get later:

[99.0573] hal: Configuring hal
Setting up hal (0.5.11~rc2-1ubuntu6) ...
Installing new version of config file /etc/init.d/hal ...
Installing new version of config file /etc/hal/fdi/policy/preferences.fdi ...
Installing new version of config file /etc/dbus-1/system.d/hal.conf ...
 * Reloading system message bus config...
Error org.freedesktop.DBus.Error.Failed: Element <standard_system_servicedirs> not allowed inside <busconfig> in configuration file
invoke-rc.d: initscript dbus, action "force-reload" failed.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = (unset),
 LC_ALL = (unset),
 LANG = "en_DK.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
 * Starting Hardware abstraction layer hald
   ...done.

Revision history for this message
Michael Vogt (mvo) wrote :

Hrm, it looks like this is a problem with the unpack/configure ordering. hal in unpacked, but not configured yet when acpid gets configured it seems.

For testing I added a Pre-Depends on hal to ensure that it is configured when the postinst is run and then it works.

Revision history for this message
Michael Vogt (mvo) wrote :

I think we have the following options for a fix:

1) use the original acpid.postinst and just change it to ignore if it can not be restarted

2) add code to hald-addons-acpi so that we can sent it a signal that makes hald-addon-acpid close event_fd (/proc/acpi/event), sleep for some seconds and try to open /var/run/acpid.socket then

Revision history for this message
Michael Vogt (mvo) wrote :

If we go with option (1) the acpid start problem will cure itself automatically on the next reboot because hald is patched to not try to open /proc/acpi/event if acpid is installed. Its less correct than (2) but really simple.

Revision history for this message
Martin Pitt (pitti) wrote :

I still don't quite understand this. Hal does not connect to the acpi socket if /usr/sbin/acpid exists. So the only situation where this breaks would be if hal starts up before acpid is even unpacked. This could be avoided with adding a dependency to acpid to hal, but if that's too ugly, maybe we can do something with Breaks: hal (<<...)?

Revision history for this message
Michael Vogt (mvo) wrote :

I forgot option (3): only restart hal if it is actually running. This is nice and simple and I will do that.

Revision history for this message
Michael Vogt (mvo) wrote :

Uploaded with a additional check for /var/run/hald/hald.pid, waiting for approval.

Changed in acpid:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package acpid - 1.0.4-5ubuntu9

---------------
acpid (1.0.4-5ubuntu9) hardy; urgency=low

  [ Daniel Hahler ]
  * debian/acpid.postinst: Stop and start hal, if present.
    This allows acpid to take /proc/acpi/event and hal will ignore this kernel
    interface, when acpid is installed. (LP: #63450)
  * debian/acpid.init.d: Add "--oknodo" to the start-stop-daemon call in
    "start". The action must not fail, if acpid is already running.

  [ Michael Vogt ]
  * debian/acpid.postinst: do not restart hal on dapper upgrades
    (hal may hang forever because of a incompatible dbus)
  * only restart if hal is actually running

 -- Michael Vogt <email address hidden> Wed, 16 Apr 2008 16:12:12 +0200

Changed in acpid:
status: Fix Committed → Fix Released
Revision history for this message
Dong Calmada (dongcalmada) wrote :

I've upgraded from Gutsy to Hardy and had the same problem upgrading acpi stuff. I followed Erik de Castro Lopo's workaround and it fixed my problem. Genius!

Revision history for this message
ricnar456 (ricardonarvaja) wrote :
Download full text (12.5 KiB)

i upgrade fron gutsy to hard and have the same problem but the solutions not solve the problem.
ricnar456@ricnar456-desktop:~$ sudo /etc/init.d/acpid stop
[sudo] password for ricnar456:
Sorry, try again.
[sudo] password for ricnar456:
 * Stopping ACPI services... [ OK ]
ricnar456@ricnar456-desktop:~$ sudo dpkg --configure -a
Configurando acpid (1.0.4-5ubuntu9) ...
 * Stopping Hardware abstraction layer hald [ OK ]
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error al procesar acpid (--configure):
 el subproceso post-installation script devolvió el código de salida de error 1
Configurando hotkey-setup (0.1-17ubuntu21) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error al procesar hotkey-setup (--configure):
 el subproceso post-installation script devolvió el código de salida de error 1
dpkg: problemas de dependencias impiden la configuración de ubuntu-desktop:
 ubuntu-desktop depende de acpid; sin embargo:
 El paquete `acpid' no está configurado todavía.
 ubuntu-desktop depende de hotkey-setup; sin embargo:
 El paquete `hotkey-setup' no está configurado todavía.
dpkg: error al procesar ubuntu-desktop (--configure):
 problemas de dependencias - se deja sin configurar
Configurando cron (3.0pl1-100ubuntu2) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error al procesar cron (--configure):
 el subproceso post-installation script devolvió el código de salida de error 1
dpkg: problemas de dependencias impiden la configuración de acpi-support:
 acpi-support depende de acpid (>= 1.0.4-1ubuntu4); sin embargo:
 El paquete `acpid' no está configurado todavía.
dpkg: error al procesar acpi-support (--configure):
 problemas de dependencias - se deja sin configurar
Configurando nvidia-kernel-common (20051028+1ubuntu8) ...

************************************************************************
*
* The update-modules command is deprecated and should not be used!
*
************************************************************************

usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error al procesar nvidia-kernel-common (--configure):
 el subproceso post-installation script devolvió el código de salida de error 1
Configurando pulseaudio (0.9.10-1ubuntu1) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error al procesar pulseaudio (--configure):
 e...

Revision history for this message
Steve Langasek (vorlon) wrote :

Ricardo,

Your problem is unrelated to this bug. You appear to have a non-Ubuntu version of the update-rc.d program installed, which is normally provided by the sysv-rc package. In Ubuntu, versions 2.86.ds1-14.1ubuntu2 and above of sysv-rc support a "multiuser" option to update-rc.d; since your update-rc.d does not support this, you evidently aren't using the Ubuntu package.

You should correct this by installing the sysv-rc package from the Ubuntu archive in place of the non-Ubuntu one you currently have installed.

Changed in acpid:
status: Unknown → Fix Released
Revision history for this message
Sergio Daroca (sergio-daroca) wrote : Solution to Ricardo's problem (upgrading to Hardy)

See this page: (en español)
http://www.ubuntu-es.org/index.php?q=node/86171#comment-258025
Or this: (in english)
http://<email address hidden>/msg874223.html

it comes down to updating sysv-rc file to the default and last version from ubuntu distro:

sudo apt-get install sysv-rc=2.86.ds1-14.1ubuntu45

and if needed then:

sudo dpkg --configure -a

Revision history for this message
Paul Abrahams (abrahams) wrote :

That doesn't work because of the ubiquitous hal install problem:

root@lepiota:~# apt-get install sysv-rc=2.86.ds1-14.1ubuntu45
Reading package lists... Done
Building dependency tree
Reading state information... Done
sysv-rc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up hal (0.5.11~rc2-1ubuntu8.2) ...
 * Reloading system message bus config... [ OK ]
 * Starting Hardware abstraction layer hald invoke-rc.d: initscript hal, action "start" failed.
dpkg: error processing hal (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 hal
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Buddhika (blaknath) wrote :

Ricardo,

>Your problem is unrelated to this bug. You appear to have a non-Ubuntu version of the update-rc.d program >installed, which is normally provided by the sysv-rc package. In Ubuntu, versions 2.86.ds1-14.1ubuntu2 and above >of sysv-rc support a "multiuser" option to update-rc.d; since your update-rc.d does not support this, you evidently >aren't using the Ubuntu package.

>You should correct this by installing the sysv-rc package from the Ubuntu archive in place of the non-Ubuntu one >you currently have installed.

You have solved my problem. Thanks a lot :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.