[Pkg-acpi-devel] Bug#483805: Opens /dev/null read-only as stdout and stderr

Harald Braumann harry at unheit.net
Fri Dec 19 18:00:25 UTC 2008


tags 483805 patch
thanks

Hi,

stumbled across the same bug. The problem is, that acpid connects
stdout and stderr to /dev/null (only in daemon mode), but it
opens /dev/null read-only. 

Thus, any output in /etc/init.d/gdm will fail, and as the script most
probably does a ``set -e'', it fails altogether.

The attached patch fixes this. 

In the meantime, you can work around the bug, by creating the
following script as /etc/acpi/restart_gdm.sh:

#!/bin/sh

/etc/init.d/gdm restart > /dev/null 2>&1 < /dev/null

and setting ``action=/etc/acpi/restart_gdm.sh''. Or, more generally,
put the following line in any script in /etc/acpi at the top:

#!/bin/sh
exec > /dev/null 2>&1 < /dev/null
#...

Cheers,
harry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixfd.diff
Type: text/x-patch
Size: 381 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20081219/59db9b5a/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20081219/59db9b5a/attachment.pgp 


More information about the Pkg-acpi-devel mailing list