systemd/support-powerfail-with-powerstatus.patch

91 lines
2.8 KiB
Diff

--- systemd-208/units/sigpwr.target
+++ systemd-208/units/sigpwr.target 2014-01-14 15:53:32.878735762 +0000
@@ -8,3 +8,5 @@
[Unit]
Description=Power Failure
Documentation=man:systemd.special(7)
+BindsTo=powerfail.service
+DefaultDependencies=no
+RefuseManualStart=yes
--- systemd-208/units/powerfail.service
+++ systemd-208/units/powerfail.service 2014-01-14 16:11:41.802235712 +0000
@@ -0,0 +1,21 @@
+# This file is part of systemd.
+#
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Germany.
+# Author: Werner Fink
+# Please send feedback to http://www.suse.de/feedback
+#
+# Description:
+#
+# Used to start the systemd-powerfail.service
+#
+
+[Unit]
+Description=powerfail handling
+BindsTo=sigpwr.target
+DefaultDependencies=no
+RefuseManualStart=yes
+
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/systemd/systemd-powerfail
+RemainAfterExit=false
--- systemd-208/man/systemd-powerfail.service.8
+++ systemd-208/man/systemd-powerfail.service.8 2014-01-14 18:22:21.286735810 +0000
@@ -0,0 +1,54 @@
+'\" t
+.TH "SYSTEMD\-POWERFAIL\&.SERVICE" "8" "" "systemd 208" "systemd-powerfail.service"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+systemd-powerfail.service, systemd-powerfail \- Power Fail signal handling
+.SH "SYNOPSIS"
+.PP
+systemd\-powerfail\&.service
+.PP
+/usr/lib/systemd/systemd\-powerfail
+.SH "DESCRIPTION"
+.PP
+systemd\-powerfail
+is a system service that is used to evaulate the content of
+\fI/var/run/powerstatus\fR. Based on the content of this
+file:
+.IP F(AIL)
+Power is failing, UPS is providing the power. The
+systemd\-powerfail
+is now doing a timed shutdown.
+.IP O(K)
+The power has been restored, and pending shutdown
+will be cancled.
+.IP L(OW)
+The power is failing and the UPS has a low battery.
+The
+systemd\-powerfail
+is doing an immediate shutdown.
+.PP
+If \fI/var/run/powerstatus\fR doesn't exist or contains anything else then the letters
+F, O or L, systemd\-powerfail will behave as if it has read the letter F.
+.PP
+.SH "SEE ALSO"
+.PP
+\fBshutdown\fR(8),
+\fBpowerd\fR(8)