Sometimes (particuarly if you are using apmd -z) the default polling interval
of 10 minutes is a bit lazy and we fail to respond to low battery situations
before they become no battery situations.

Perhaps something smarter could be done, but the simplest change is to reduce
the default polling interval to one minute. This is still rather slow, so as
to not introduce unnecessary load on the system, but should make it more
responsive to changing conditions.


Index: apmd.8
===================================================================
RCS file: /home/cvs/src/usr.sbin/apmd/apmd.8,v
retrieving revision 1.50
diff -u -p -r1.50 apmd.8
--- apmd.8      4 Dec 2018 18:00:57 -0000       1.50
+++ apmd.8      25 Jan 2020 04:50:09 -0000
@@ -111,7 +111,7 @@ periodically polls the APM driver for th
 If the battery charge level changes substantially or the external power
 status changes, the new status is logged.
 The polling rate defaults to
-once per 10 minutes, but may be specified using the
+once per 1 minute, but may be specified using the
 .Fl t
 command-line flag.
 .It Fl Z Ar percent
Index: apmd.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/apmd/apmd.c,v
retrieving revision 1.91
diff -u -p -r1.91 apmd.c
--- apmd.c      2 Nov 2019 00:41:36 -0000       1.91
+++ apmd.c      25 Jan 2020 04:49:54 -0000
@@ -366,7 +366,7 @@ resumed(int ctl_fd)
        power_status(ctl_fd, 1, NULL);
 }
 
-#define TIMO (10*60)                   /* 10 minutes */
+#define TIMO (1*60)                    /* 1 minute */
 
 int
 main(int argc, char *argv[])

Reply via email to