acpid killed by default logrotate script

Bug #263888 reported by Matt Zimmerman
6
Affects Status Importance Assigned to Milestone
acpid (Ubuntu)
Fix Released
Medium
Unassigned
Intrepid
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: acpid

I noticed, by way of bug 247195, that acpid has been routinely dying on my Intrepid system. This didn't happen under 8.04. I believe this is happening because its logrotate script sends SIGUSR1, whose default action is to terminate the process, which isn't handled by acpid.

mizar:[~] cat /etc/logrotate.d/acpid
/var/log/acpid {
    weekly
    rotate 4
    compress
    missingok
    postrotate
     pkill -SIGUSR1 acpid > /dev/null
    endscript
}
root 23633 0.0 0.0 2308 1172 ? Ss 09:25 0:00 /usr/sbin/acpid -c /etc/acpi/events -s /var/run/acpid.socket
mizar:[~] sudo pkill -SIGUSR1 acpid
[sudo] password for mdz:
mizar:[~] ps u 23633
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
zsh: exit 1 ps u 23633
mizar:[~] cd /tmp/acpid-1.0.6
mizar:[/tmp/acpid-1.0.6] grep -ri SIGUSR1 .
zsh: exit 1 grep -ri SIGUSR1 .

This means that acpid will die each week when the logrotate script is run.

Related branches

Revision history for this message
Matt Zimmerman (mdz) wrote :

Further confirmation:

root 24503 0.0 0.0 2308 1176 ? Ss 09:33 0:00 /usr/sbin/acpid -c /etc/acpi/events -s /var/run/acpid.socket
mizar:[/tmp/acpid-1.0.6] sudo logrotate --force /etc/logrotate.d/acpid
mizar:[/tmp/acpid-1.0.6] ps u 24503
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
zsh: exit 1 ps u 24503

Changed in acpid:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
James Westby (james-w) wrote :

Hi,

Attached is a patch that should fix this. Hopefully the changelog entry
explains it well enough:

acpid (1.0.6-9ubuntu4) intrepid; urgency=low

  * Remove the logrotate file on upgrade, as the previous one that was
    installed did a "kill -USR1" on the acpid process to cause it to reload
    its logfiles. As the new acpid doesn't use a log file it doesn't catch
    this signal, which means that once a week acpid is killed. As it doesn't
    have a logfile the logrotate file is not needed, and so is no longer
    installed, but as it was a conffile it is not removed on upgrades.
    .
    On an upgrade from an older version of the package we remove the file
    if it exists and matches one of the two known versions of the conffile.
    If it doesn't match it is just moved aside. The older logrotate file
    didn't send SIGUSR1, and so it is not as critical to remove, but it does
    restart acpid, which is unecessary. (LP: #263888)

 -- James Westby <email address hidden> Wed, 24 Sep 2008 15:19:14 +0100

Thanks,

James

Revision history for this message
James Westby (james-w) wrote :

Hi,

Here is a better fix thanks to Loïc.

Thanks,

James

Revision history for this message
Loïc Minier (lool) wrote :

Uploaded, thanks!

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

This bug was fixed in the package acpid - 1.0.6-9ubuntu4

---------------
acpid (1.0.6-9ubuntu4) intrepid; urgency=low

  * Remove the logrotate file on upgrade, as the previous one that was
    installed did a "kill -USR1" on the acpid process to cause it to reload
    its logfiles. As the new acpid doesn't use a log file it doesn't catch
    this signal, which means that once a week acpid is killed. As it doesn't
    have a logfile the logrotate file is not needed, and so is no longer
    installed, but as it was a conffile it is not removed on upgrades.
    Thanks to Loic Minier for his help with the fix. (LP: #263888)
    - ad81211857dabeb88538e0f90c922b7c787b34c5 in Debian's pkg-acpi git repo.

 -- James Westby <email address hidden> Wed, 24 Sep 2008 15:19:14 +0100

Changed in acpid:
status: Fix Committed → Fix Released
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.