Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 444102 Details for
Bug 592108
sys-power/apcupsd-3.14.13: after power failure, send email when starting
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to /etc/init.d/apcupsd
apcupsd.init.4.patch (text/plain), 1.77 KB, created by
denis.chancogne
on 2016-08-25 16:05:07 UTC
(
hide
)
Description:
Patch to /etc/init.d/apcupsd
Filename:
MIME Type:
Creator:
denis.chancogne
Created:
2016-08-25 16:05:07 UTC
Size:
1.77 KB
patch
obsolete
>--- org/apcupsd.init.4 2016-08-24 21:45:16.762802491 +0200 >+++ new/apcupsd.init.4 2016-08-25 00:18:55.221622606 +0200 >@@ -3,47 +3,37 @@ > # Distributed under the terms of the GNU General Public License v2 > # $Id$ > >-INSTANCE="${SVCNAME#*.}" >-if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "apcupsd" ]; then >- INSTANCE="apcupsd" >-fi >+INSTANCE="${RC_SVCNAME#*.}" > >-dir="/run/apcupsd" >+APCUPSD_RUN_DIR="/run/apcupsd" >+POWERFAIL_FILE="/etc/apcupsd/powerfail" >+INSTANCE_CONF_FILE="/etc/apcupsd/${INSTANCE}.conf" >+ >+description="APC UPS daemon" >+name="${description}" >+command="/sbin/apcupsd" >+pidfile="${APCUPSD_RUN_DIR}/${RC_SVCNAME}.pid" >+command_args="-f ${INSTANCE_CONF_FILE} -P ${pidfile}" > > depend() { >- use net >+ use net mta > } > >-start_pre() { >- checkpath -d -m 0775 -o root:uucp ${dir} >+_mng_powerfail() { >+ local UPSNAME=$(awk '{if($1 == "UPSNAME"){print $2}}' ${INSTANCE_CONF_FILE}) >+ [ -z "${UPSNAME}" ] && UPSNAME=$(hostname) >+ /etc/apcupsd/apccontrol offbattery ${UPSNAME} >+ rm -f ${POWERFAIL_FILE} > } > >-start() { >- rm -f /etc/apcupsd/powerfail >- >- export SERVICE="${SVCNAME}" >- >- if [ ! -d "${dir}" ]; then >- einfo " Creating ${dir}" >- /bin/mkdir -p "${dir}" >- /bin/chown root:uucp "${dir}" >- fi >- >- ebegin "Starting APC UPS daemon" >- start-stop-daemon \ >- --start --pidfile "${dir}/${SVCNAME}.pid" \ >- --exec /sbin/apcupsd -- \ >- -f "/etc/apcupsd/${INSTANCE}.conf" \ >- -P "${dir}/${SVCNAME}.pid" >- eend $? >+start_pre() { >+ checkpath -d -m 0775 -o root:uucp ${APCUPSD_RUN_DIR} > } > >-stop() { >- ebegin "Stopping APC UPS daemon" >- start-stop-daemon \ >- --stop --pidfile "${dir}/${SVCNAME}.pid" \ >- --retry TERM/5/TERM/5 \ >- --exec /sbin/apcupsd >- eend $? >+start_post() { >+ if [ "${INSTANCE}" = "apcupsd" -a -f ${POWERFAIL_FILE} ] >+ then >+ sleep 2 >+ _mng_powerfail >+ fi > } >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 592108
: 444102 |
444104