Re: freebsd-questions Digest, Vol 326, Issue 11, Message: 19 On Sun, 5 Sep 2010 19:04:51 +0800 dave jones <s.dave.jo...@gmail.com> wrote:
> I'm running FreeBSD 8 on my desktop. I want to write a file or do something > when I or someone presses power button. In devd.conf, I added the > following lines > for testing: > > notify 10 { > match "system" "ACPI"; > match "subsystem" "Button"; > matcho "notify" "0x00" > action "echo hello world"; > }; > > But it doesn't work. Would anyone tell me how to do? Thanks. I'm not sure this will do what you want anyway; devd will handle the notify but won't replace the normal action itself, ie it might power down (hopefully running shutdown actions, synching disks etc), however 'matcho' won't match 'match' :) and that line needs a trailing ';'. Whether or not it powers down (perhaps depending on BIOS setting, ie instant-off or 4-second-delay), it may be more useful logging it, say: action "logger -p kern.emerg 'power button pressed!'"; cheers, Ian _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"