Created attachment 220293 [details] proposed patch I configured battmond to suspend instead of shutting down the system. In line 197 exec is used to invoke suspend: execl("/usr/sbin/acpiconf", "acpiconf", "-s3", NULL); As exec will replace the current process image with the new process, battmond is no longer running when the system resumes after battmond suspended for the first time. To make sure that battmond is running after resume, I see two possible solutions: 1.) Replace exec with system or 2.) Restart battmond on resume using rc-scripts I attached a patch for solution #1
Comment on attachment 220293 [details] proposed patch >--- battmond.c.orig 2020-12-05 20:19:13 UTC >+++ battmond.c >@@ -194,8 +194,7 @@ int main(int argc, char ** argv) > if (dosuspend) { // Suspend > syslog(LOG_EMERG, BATT_SUSP); > close(acpifd); >- execl("/usr/sbin/acpiconf", "acpiconf", "-s3", NULL); >- oops("execl"); >+ system("/usr/sbin/acpiconf -s3"); > } else { // Halt > syslog(LOG_EMERG, BATT_HALT); > close(acpifd);
Created attachment 220296 [details] proposed patch