The debug mode doesn't seem to show any useful info.. however it does force the daemon to stay in the foreground and I managed to strace it. The output:
execve("/usr/sbin/acpid", ["acpid", "-d", "-d", "-d", "-c", "/etc/acpi/events", "-s", "/var/run/.acpid.socket"], [/* 24 vars */]) = 0
uname({sys="Linux", node="whitefang", ...}) = 0
brk(0) = 0x804d764
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=8733, ...}) = 0
old_mmap(NULL, 8733, PROT_READ, MAP_PRIVATE, 3, 0) = 0x273f3000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\30\222"..., 1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1153784, ...}) = 0
old_mmap(NULL, 1166560, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x273f6000
mprotect(0x27509000, 40160, PROT_NONE) = 0
old_mmap(0x27509000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x113000) = 0x27509000
old_mmap(0x2750f000, 15584, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2750f000
close(3) = 0
munmap(0x273f3000, 8733) = 0
geteuid32() = 0
open("/proc/acpi/event", O_RDONLY) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
fcntl64(3, F_GETFL) = 0 (flags O_RDONLY)
fcntl64(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
read(3, 0x5a6c328f, 1) = -1 EAGAIN (Resource temporarily unavailable)
fcntl64(3, F_SETFL, O_RDONLY) = 0
unlink("/var/run/.acpid.socket") = 0
socket(PF_UNIX, SOCK_STREAM, 0) = 4
bind(4, {sin_family=AF_UNIX, path="/var/run/.acpid.socket"}, 110) = 0
listen(4, 10) = 0
fcntl64(4, F_SETFD, FD_CLOEXEC) = 0
chmod("/var/run/.acpid.socket", 0666) = 0
time(NULL) = 1033748595
brk(0) = 0x804d764
brk(0x804d78c) = 0x804d78c
brk(0x804e000) = 0x804e000
open("/etc/localtime", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=1323, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x273f3000
read(5, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0"..., 4096) = 1323
close(5) = 0
munmap(0x273f3000, 4096) = 0
write(2, "[Fri Oct 4 17:23:15 2002] ", 27) = 27
write(2, "starting up\n", 12) = 12
rt_sigaction(SIGHUP, {0x8049da8, [HUP], SA_RESTART|0x4000000}, {SIG_DFL},
= 0
rt_sigaction(SIGINT, {0x8049d7c, [INT], SA_RESTART|0x4000000}, {SIG_DFL},
= 0
rt_sigaction(SIGQUIT, {0x8049d7c, [QUIT], SA_RESTART|0x4000000}, {SIG_DFL},
= 0
rt_sigaction(SIGTERM, {0x8049d7c, [TERM], SA_RESTART|0x4000000}, {SIG_DFL},
= 0
rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL},
= 0
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM], NULL,
= 0
open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a directory)
open("/etc/acpi/events", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 5
fstat64(5, {st_mode=S_IFDIR|0755, st_size=72, ...}) = 0
fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
brk(0x8050000) = 0x8050000
getdents64(0x5, 0x804de30, 0x1000, 0xb) = 80
time(NULL) = 1033748595
write(2, "[Fri Oct 4 17:23:15 2002] ", 27) = 27
write(2, "DBG: parsing conf file /etc/acpi"..., 49) = 49
open("/etc/acpi/events/powerbtn", O_RDONLY) = 6
fstat64(6, {st_mode=S_IFREG|0644, st_size=425, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x273f3000
read(6, "# /etc/acpid/events/powerbtn\n# T"..., 4096) = 425
time(NULL) = 1033748595
write(2, "[Fri Oct 4 17:23:15 2002] ", 27) = 27
write(2, "DBG: key=\"event\" val=\"button["..., 42) = 42
time(NULL) = 1033748595
write(2, "[Fri Oct 4 17:23:15 2002] ", 27) = 27
write(2, "DBG: key=\"action\" val=\"/etc/a"..., 49) = 49
read(6, "", 4096) = 0
close(6) = 0
munmap(0x273f3000, 4096) = 0
munmap(0xa28e729a, 2498353563) = -1 EINVAL (Invalid argument)
getdents64(0x5, 0x804de30, 0x1000, 0x16) = 0
It dies on getdents64 on file handle 5. File handle 5 is the /etc/acpi/events directory. No idea why. I also straced a normal run (with page-based noexec instead of segmentation) and it does the above, then continues with:
close(5) = 0
time(NULL) = 1033749719
write(2, "[Fri Oct 4 17:41:59 2002] ", 27) = 27
write(2, "DBG: unblocking signals for rule"..., 38) = 38
rt_sigprocmask(SIG_UNBLOCK, [HUP INT QUIT TERM], NULL,
= 0
time(NULL) = 1033749719
write(2, "[Fri Oct 4 17:41:59 2002] ", 27) = 27
write(2, "1 rule loaded\n", 14) = 14
I cut off at this point because the next call is to poll the ACPI events interface for data. This means that the failure is occuring before it's even opened the ACPI interface - it is in fact dying in that getdents64 call as far as I can see.
Well.. that's my explanation of what's going on to the best of my ability. I hope this is enough to allow you to work out *why*, which is the part that stumps me. =)
Torne