I would like for apmd to tell me when the system goes to sleep, not
just when it wakes up.
Index: apmd.c
===================================================================
RCS file: /cvs/src/usr.sbin/apmd/apmd.c,v
retrieving revision 1.59
diff -u -p -r1.59 apmd.c
--- apmd.c 29 Apr 2013 00:28:23 -0000 1.59
+++ apmd.c 15 May 2013 22:04:52 -0000
@@ -476,6 +476,7 @@ handle_client(int sock_fd, int ctl_fd)
void
suspend(int ctl_fd)
{
+ syslog(LOG_NOTICE, "system entering APM sleep");
do_etc_file(_PATH_APM_ETC_SUSPEND);
sync();
sleep(1);
@@ -485,6 +486,7 @@ suspend(int ctl_fd)
void
stand_by(int ctl_fd)
{
+ syslog(LOG_NOTICE, "system entering APM standby");
do_etc_file(_PATH_APM_ETC_STANDBY);
sync();
sleep(1);
@@ -494,6 +496,7 @@ stand_by(int ctl_fd)
void
hibernate(int ctl_fd)
{
+ syslog(LOG_NOTICE, "system entering APM hibernation");
do_etc_file(_PATH_APM_ETC_HIBERNATE);
sync();
sleep(1);