Summary: | sys-power/apcupsd-3.14.13: after power failure, send email when starting | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | denis.chancogne |
Component: | Current packages | Assignee: | John Einar Reitan <john.einar> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | base-system, jstein, mgorny |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Patch to /etc/init.d/apcupsd
New file (patched) /etc/init.d/apcupsd |
Created attachment 444104 [details]
New file (patched) /etc/init.d/apcupsd
|
Created attachment 444102 [details, diff] Patch to /etc/init.d/apcupsd Hello, I use apcupsd to manage my APC BR900GI. I saw a problem on util power loss so I send you this patch. The problem is : - on util power loss, apcupsd (by apccontrol) send a email, then when util power return, it send another email - but when there is a long power fail and the computer is stopped, there is a mail to say that power is lost, but when the power comes back and so computer start again there is no email to say that power returned. So I have added a fonction to call "apccontrol offbattery" if the powerfail file is present on startup. My patch is joined, and so the new init.d apcupsd script. In the same time, I used last features of openrc to manage daemon start-stop ... I did the following tests : - /etc/init.d/apcupsd stop => OK - /etc/init.d/apcupsd start => OK - /etc/init.d/apcupsd restart => OK - touch /etc/apcupsd/powerfail; /etc/init.d/apcupsd restart => OK (email is well sent) Best regards, Denis Chancogne NB: before to call "apccontrol", I have added "sleep 2" because without this, output of "apcaccess" command wasn't full, I think apcupsd needs time (some seconds) to start fully.