From 715098eb6a380f490a6f5fea946b44d492bcc112e1e4ae5dad6104d2ed5556d6 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 14 Jan 2014 18:31:08 +0000 Subject: [PATCH 01/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=482 --- support-powerfail-with-powerstatus.patch | 90 ++++++++++++++++++++++++ systemd-mini.spec | 2 +- systemd-powerfail | 28 ++++++++ systemd-rpm-macros.spec | 2 +- systemd.changes | 7 ++ systemd.spec | 11 ++- 6 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 support-powerfail-with-powerstatus.patch create mode 100644 systemd-powerfail diff --git a/support-powerfail-with-powerstatus.patch b/support-powerfail-with-powerstatus.patch new file mode 100644 index 00000000..9a058619 --- /dev/null +++ b/support-powerfail-with-powerstatus.patch @@ -0,0 +1,90 @@ +--- 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) ++BindTo=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 ++BindTo=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) diff --git a/systemd-mini.spec b/systemd-mini.spec index cdf81be0..a35884ef 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -1,7 +1,7 @@ # # spec file for package systemd-mini # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/systemd-powerfail b/systemd-powerfail new file mode 100644 index 00000000..797fb7d2 --- /dev/null +++ b/systemd-powerfail @@ -0,0 +1,28 @@ +#!/bin/bash +# +# /usr/lib/systemd/systemd-powerfail +# +# Copyright (c) 2014 SUSE LINUX Products GmbH, Germany. +# Author: Werner Fink +# Please send feedback to http://www.suse.de/feedback +# +# Description: +# +# Used to evaluate the status of /var/run/powerstatus +# + +trap "echo" SIGINT SIGSEGV SIGTERM + + POWERFAIL='THE POWER IS FAILED! SYSTEM GOING DOWN! PLEASE LOG OFF NOW!' +POWERFAILNOW='THE POWER IS FAILED! LOW BATTERY - EMERGENCY SYSTEM SHUTDOWN!' + POWERISBACK='THE POWER IS BACK' + +typeset pwrstat=0 +test -s /var/run/powerstatus && read pwrstat < /var/run/powerstatus +rm -f /var/run/powerstatus + +case "$pwrstat" in +O*) exec /sbin/shutdown -c +0 "$POWERISBACK" ;; +L*) exec /sbin/shutdown -P +0 "$POWERFAILNOW" ;; +*) exec /sbin/shutdown -P +2 "$POWERFAIL" ;; +esac diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec index 4c7b714f..c8e0234c 100644 --- a/systemd-rpm-macros.spec +++ b/systemd-rpm-macros.spec @@ -1,7 +1,7 @@ # # spec file for package systemd-rpm-macros # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/systemd.changes b/systemd.changes index a9766b37..5b0b8538 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jan 14 18:28:09 UTC 2014 - werner@suse.de + +- Add patch support-powerfail-with-powerstatus.patch and source + file systemd-powerfail to implement SIGPWR support with evaluation + of the file /var/run/powerstatus (bnc#737690) + ------------------------------------------------------------------- Fri Dec 20 12:06:18 UTC 2013 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index c66ec723..6573788a 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1,7 +1,7 @@ # # spec file for package systemd # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -112,6 +112,7 @@ Source8: systemd-journald.init Source9: nss-myhostname-config Source10: macros.systemd.upstream Source11: after-local.service +Source12: systemd-powerfail Source1060: boot.udev Source1061: write_dev_root_rule @@ -271,6 +272,8 @@ Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch Patch1014: 1014-journald-with-journaling-FS.patch # PATCH-FIX-UPSTREAM build-sys-make-multi-seat-x-optional.patch Patch1015: build-sys-make-multi-seat-x-optional.patch +# PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch +Patch1016: support-powerfail-with-powerstatus.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -553,6 +556,7 @@ cp %{SOURCE7} m4/ %patch1013 -p1 %patch1014 -p1 %patch1015 -p1 +%patch1016 -p1 # ensure generate files are removed rm -f units/emergency.service @@ -730,6 +734,11 @@ EOF install -m 644 %{S:11} %{buildroot}/%{_prefix}/lib/systemd/system/ ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-user.target.wants/ +# support for SIGPWR handling with /var/run/powerstatus of e.g. powerd +install -m 755 %{S:12} %{buildroot}/%{_prefix}/lib/systemd/ +install -m 644 units/powerfail.service %{buildroot}/%{_prefix}/lib/systemd/system/ +install -m 644 man/systemd-powerfail.service.8 %{buildroot}/%{_mandir}/man8/ + %fdupes -s %{buildroot}%{_mandir} # packaged in systemd-rpm-macros From a7db0bbb7f86192771c9776f010c10ce1a7918244cacb43d23e7550172492506 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 15 Jan 2014 12:43:26 +0000 Subject: [PATCH 02/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=483 --- ...enforce-sufficient-shutdown-warnings.patch | 24 +++++++++++++++++++ systemd.changes | 8 +++++++ systemd.spec | 3 +++ 3 files changed, 35 insertions(+) create mode 100644 1017-enforce-sufficient-shutdown-warnings.patch diff --git a/1017-enforce-sufficient-shutdown-warnings.patch b/1017-enforce-sufficient-shutdown-warnings.patch new file mode 100644 index 00000000..036ff622 --- /dev/null +++ b/1017-enforce-sufficient-shutdown-warnings.patch @@ -0,0 +1,24 @@ +Simple fix for bnc#750845. Maybe the original values are broken as the +delay of the first two entries in when_wall() are less then the warning +intervall. Now we warn once per hour in the first 3 hours, then all +30 minutes in last hour, all 15 minutes in the last 45 minutes, all 10 +minutes in the last 15 minutes, and then all minute in the last 10 minutes. + +--- + shutdownd.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- systemd-208/src/shutdownd/shutdownd.c ++++ systemd-208/src/shutdownd/shutdownd.c 2014-01-15 12:11:23.206235784 +0000 +@@ -156,8 +156,9 @@ _const_ static usec_t when_wall(usec_t n + usec_t delay; + usec_t interval; + } table[] = { +- { 0, USEC_PER_MINUTE }, +- { 10 * USEC_PER_MINUTE, 15 * USEC_PER_MINUTE }, ++ { 10 * USEC_PER_MINUTE, USEC_PER_MINUTE }, ++ { 15 * USEC_PER_MINUTE, 10 * USEC_PER_MINUTE }, ++ { 45 * USEC_PER_MINUTE, 15 * USEC_PER_MINUTE }, + { USEC_PER_HOUR, 30 * USEC_PER_MINUTE }, + { 3 * USEC_PER_HOUR, USEC_PER_HOUR }, + }; diff --git a/systemd.changes b/systemd.changes index 5b0b8538..e6fb6d34 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Jan 15 12:34:53 UTC 2014 - werner@suse.de + +- Add patch 1017-enforce-sufficient-shutdown-warnings.patch + Warn once per hour in the last 3 hours, then all 30 minutes in last + hour, all 15 minutes in the last 45 minutes, all 10 minutes in the + last 15 minutes, and then all minute in the last 10 minutes (bnc#750845) + ------------------------------------------------------------------- Tue Jan 14 18:28:09 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 6573788a..376b81d1 100644 --- a/systemd.spec +++ b/systemd.spec @@ -274,6 +274,8 @@ Patch1014: 1014-journald-with-journaling-FS.patch Patch1015: build-sys-make-multi-seat-x-optional.patch # PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch Patch1016: support-powerfail-with-powerstatus.patch +# PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch +Patch1017: support-powerfail-with-powerstatus.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -557,6 +559,7 @@ cp %{SOURCE7} m4/ %patch1014 -p1 %patch1015 -p1 %patch1016 -p1 +%patch1017 -p1 # ensure generate files are removed rm -f units/emergency.service From a5fb21e7572fca022648b09697fcf6bba50b531ec5bc197bbf763f2246bd27f5 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 15 Jan 2014 13:16:15 +0000 Subject: [PATCH 03/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=484 --- systemd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemd.spec b/systemd.spec index 376b81d1..8be17063 100644 --- a/systemd.spec +++ b/systemd.spec @@ -274,8 +274,8 @@ Patch1014: 1014-journald-with-journaling-FS.patch Patch1015: build-sys-make-multi-seat-x-optional.patch # PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch Patch1016: support-powerfail-with-powerstatus.patch -# PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch -Patch1017: support-powerfail-with-powerstatus.patch +# PATCH-FIX-SUSE 1017-enforce-sufficient-shutdown-warnings.patch +Patch1017: 1017-enforce-sufficient-shutdown-warnings.patch %description Systemd is a system and service manager, compatible with SysV and LSB From 1bf6d7082787d75b60c95e8a578c5782750dc4c8099c2b899b2838d88ef7df66 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 15 Jan 2014 14:11:36 +0000 Subject: [PATCH 04/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=485 --- support-powerfail-with-powerstatus.patch | 4 ++-- systemd.changes | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/support-powerfail-with-powerstatus.patch b/support-powerfail-with-powerstatus.patch index 9a058619..c59f6828 100644 --- a/support-powerfail-with-powerstatus.patch +++ b/support-powerfail-with-powerstatus.patch @@ -4,7 +4,7 @@ [Unit] Description=Power Failure Documentation=man:systemd.special(7) -+BindTo=powerfail.service ++BindsTo=powerfail.service +DefaultDependencies=no +RefuseManualStart=yes --- systemd-208/units/powerfail.service @@ -23,7 +23,7 @@ + +[Unit] +Description=powerfail handling -+BindTo=sigpwr.target ++BindsTo=sigpwr.target +DefaultDependencies=no +RefuseManualStart=yes + diff --git a/systemd.changes b/systemd.changes index e6fb6d34..60b685cf 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jan 15 14:11:02 UTC 2014 - werner@suse.de + +- Change support-powerfail-with-powerstatus.patch to use BindsTo + instead of BindTo + ------------------------------------------------------------------- Wed Jan 15 12:34:53 UTC 2014 - werner@suse.de From 82629e4dd0616e1d3a57a39b9a8129daad29b50803dd187a1469f95c8cf5204a Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 17 Jan 2014 12:31:10 +0000 Subject: [PATCH 05/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=486 --- ...ripts-know-about-Required-and-Should.patch | 51 +++++++++++++++++++ systemd.changes | 9 ++++ systemd.spec | 3 ++ 3 files changed, 63 insertions(+) create mode 100644 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch diff --git a/1018-Make-LSB-Skripts-know-about-Required-and-Should.patch b/1018-Make-LSB-Skripts-know-about-Required-and-Should.patch new file mode 100644 index 00000000..81a26925 --- /dev/null +++ b/1018-Make-LSB-Skripts-know-about-Required-and-Should.patch @@ -0,0 +1,51 @@ +--- systemd-208/src/core/service.c ++++ systemd-208/src/core/service.c 2014-01-17 12:15:52.527311588 +0000 +@@ -380,6 +380,8 @@ static int sysv_translate_facility(const + "remote_fs", SPECIAL_REMOTE_FS_TARGET, + "syslog", NULL, + "time", SPECIAL_TIME_SYNC_TARGET, ++ "all", SPECIAL_DEFAULT_TARGET, ++ "null", NULL, + }; + + unsigned i; +@@ -389,7 +391,7 @@ static int sysv_translate_facility(const + assert(name); + assert(_r); + +- n = *name == '$' ? name + 1 : name; ++ n = (*name == '$' || *name == '+') ? name + 1 : name; + + for (i = 0; i < ELEMENTSOF(table); i += 2) { + +@@ -816,10 +818,13 @@ static int service_load_sysv_path(Servic + startswith_no_case(t, "Should-Start:") || + startswith_no_case(t, "X-Start-Before:") || + startswith_no_case(t, "X-Start-After:")) { ++ UnitDependency d, e; + char *i, *w; + size_t z; + + state = LSB; ++ d = startswith_no_case(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER; ++ e = startswith_no_case(t, "Required-Start:") ? UNIT_REQUIRES_OVERRIDABLE : UNIT_WANTS; + + FOREACH_WORD_QUOTED(w, z, strchr(t, ':')+1, i) { + char *n, *m; +@@ -838,12 +843,15 @@ static int service_load_sysv_path(Servic + continue; + } + ++ if (*n == '+') ++ e = UNIT_WANTS; ++ + free(n); + + if (r == 0) + continue; + +- r = unit_add_dependency_by_name(u, startswith_no_case(t, "X-Start-Before:") ? UNIT_BEFORE : UNIT_AFTER, m, NULL, true); ++ r = unit_add_two_dependencies_by_name(u, d, e, m, NULL, true); + + if (r < 0) + log_error_unit(u->id, "[%s:%u] Failed to add dependency on %s, ignoring: %s", diff --git a/systemd.changes b/systemd.changes index 60b685cf..a95a9224 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Jan 17 12:24:13 UTC 2014 - werner@suse.de + +- Add patch + 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch + to support the "+" to tag wanted dependencies as well as make + sure that required dependencies are handles as required ones. + This should fix bnc#858864 and bnc#857204. + ------------------------------------------------------------------- Wed Jan 15 14:11:02 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 8be17063..c3325832 100644 --- a/systemd.spec +++ b/systemd.spec @@ -276,6 +276,8 @@ Patch1015: build-sys-make-multi-seat-x-optional.patch Patch1016: support-powerfail-with-powerstatus.patch # PATCH-FIX-SUSE 1017-enforce-sufficient-shutdown-warnings.patch Patch1017: 1017-enforce-sufficient-shutdown-warnings.patch +# PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch +Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -560,6 +562,7 @@ cp %{SOURCE7} m4/ %patch1015 -p1 %patch1016 -p1 %patch1017 -p1 +%patch1018 -p1 # ensure generate files are removed rm -f units/emergency.service From 08d4442bb59adc5c7d649cc8d98b1c0a5ed6c9522661f05efd17811d82339287 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 17 Jan 2014 16:12:43 +0000 Subject: [PATCH 06/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=487 --- ...pletion-smart-to-be-able-to-redirect.patch | 236 ++++++++++++++++++ systemd.changes | 8 + systemd.spec | 21 ++ 3 files changed, 265 insertions(+) create mode 100644 1019-make-completion-smart-to-be-able-to-redirect.patch diff --git a/1019-make-completion-smart-to-be-able-to-redirect.patch b/1019-make-completion-smart-to-be-able-to-redirect.patch new file mode 100644 index 00000000..d1425d83 --- /dev/null +++ b/1019-make-completion-smart-to-be-able-to-redirect.patch @@ -0,0 +1,236 @@ +--- systemd-208/shell-completion/bash/hostnamectl ++++ systemd-208/shell-completion/bash/hostnamectl 2014-01-17 14:27:16.183272019 +0000 +@@ -30,6 +30,10 @@ _hostnamectl() { + local OPTS='-h --help --version --transient --static --pretty + --no-ask-password -H --host' + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + if [[ $cur = -* ]]; then + COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) + return 0 +@@ -58,4 +62,4 @@ _hostnamectl() { + return 0 + } + +-complete -F _hostnamectl hostnamectl ++complete -o default -o bashdefault -F _hostnamectl hostnamectl +--- systemd-208/shell-completion/bash/journalctl ++++ systemd-208/shell-completion/bash/journalctl 2014-01-17 14:34:30.338737694 +0000 +@@ -49,6 +49,10 @@ _journalctl() { + --verify-key' + ) + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + if __contains_word "$prev" ${OPTS[ARG]} ${OPTS[ARGUNKNOWN]}; then + case $prev in + --boot|--this-boot|-b) +@@ -107,4 +111,4 @@ _journalctl() { + fi + } + +-complete -F _journalctl journalctl ++complete -o default -o bashdefault -F _journalctl journalctl +--- systemd-208/shell-completion/bash/kernel-install ++++ systemd-208/shell-completion/bash/kernel-install 2014-01-17 14:34:41.982255874 +0000 +@@ -18,11 +18,22 @@ + # You should have received a copy of the GNU Lesser General Public License + # along with systemd; If not, see . + ++__contains_word () { ++ local w word=$1; shift ++ for w in "$@"; do ++ [[ $w = "$word" ]] && return ++ done ++} ++ + _kernel_install() { + local comps + local MACHINE_ID + local cur=${COMP_WORDS[COMP_CWORD]} + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + case $COMP_CWORD in + 1) + comps="add remove" +@@ -47,4 +58,4 @@ _kernel_install() { + return 0 + } + +-complete -F _kernel_install kernel-install ++complete -o default -o bashdefault -F _kernel_install kernel-install +--- systemd-208/shell-completion/bash/localectl ++++ systemd-208/shell-completion/bash/localectl 2014-01-17 14:34:52.546235747 +0000 +@@ -30,6 +30,10 @@ _localectl() { + local OPTS='-h --help --version --no-convert --no-pager --no-ask-password + -H --host' + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + if __contains_word "$prev" $OPTS; then + case $prev in + --host|-H) +@@ -73,4 +77,4 @@ _localectl() { + return 0 + } + +-complete -F _localectl localectl ++complete -o default -o bashdefault -F _localectl localectl +--- systemd-208/shell-completion/bash/loginctl ++++ systemd-208/shell-completion/bash/loginctl 2014-01-17 14:35:03.386245699 +0000 +@@ -37,6 +37,10 @@ _loginctl () { + [ARG]='--host -H --kill-who --property -p --signal -s' + ) + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + if __contains_word "$prev" ${OPTS[ARG]}; then + case $prev in + --signal|-s) +@@ -106,4 +110,4 @@ _loginctl () { + return 0 + } + +-complete -F _loginctl loginctl ++complete -o default -o bashdefault -F _loginctl loginctl +--- systemd-208/shell-completion/bash/systemctl ++++ systemd-208/shell-completion/bash/systemctl 2014-01-17 14:35:26.506235666 +0000 +@@ -77,6 +77,10 @@ _systemctl () { + [ARG]='--host -H --kill-mode --kill-who --property -p --signal -s --type -t --state --root' + ) + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + if __contains_word "--user" ${COMP_WORDS[*]}; then + mode=--user + else +@@ -226,4 +230,4 @@ _systemctl () { + return 0 + } + +-complete -F _systemctl systemctl ++complete -o default -o bashdefault -F _systemctl systemctl +--- systemd-208/shell-completion/bash/systemd-analyze ++++ systemd-208/shell-completion/bash/systemd-analyze 2014-01-17 14:35:38.366736021 +0000 +@@ -37,6 +37,10 @@ _systemd_analyze() { + [LOG_LEVEL]='set-log-level' + ) + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + _init_completion || return + + for ((i=0; $i <= $COMP_CWORD; i++)); do +@@ -83,4 +87,4 @@ _systemd_analyze() { + return 0 + } + +-complete -F _systemd_analyze systemd-analyze ++complete -o default -o bashdefault -F _systemd_analyze systemd-analyze +--- systemd-208/shell-completion/bash/systemd-coredumpctl ++++ systemd-208/shell-completion/bash/systemd-coredumpctl 2014-01-17 14:35:46.434235632 +0000 +@@ -44,6 +44,10 @@ _coredumpctl() { + [DUMP]='dump gdb' + ) + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + if __contains_word "$prev" '--output -o'; then + comps=$( compgen -A file -- "$cur" ) + compopt -o filenames +@@ -82,4 +86,4 @@ _coredumpctl() { + return 0 + } + +-complete -F _coredumpctl systemd-coredumpctl ++complete -o default -o bashdefault -F _coredumpctl systemd-coredumpctl +--- systemd-208/shell-completion/bash/systemd-run ++++ systemd-208/shell-completion/bash/systemd-run 2014-01-17 14:35:55.938236298 +0000 +@@ -17,6 +17,13 @@ + # You should have received a copy of the GNU Lesser General Public License + # along with systemd; If not, see . + ++__contains_word () { ++ local w word=$1; shift ++ for w in "$@"; do ++ [[ $w = "$word" ]] && return ++ done ++} ++ + __systemctl() { + local mode=$1; shift 1 + systemctl $mode --full --no-legend "$@" +@@ -31,6 +38,11 @@ _systemd_run() { + + local mode=--system + local i ++ ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + for (( i=1; i <= COMP_CWORD; i++ )); do + if [[ ${COMP_WORDS[i]} != -* ]]; then + local root_command=${COMP_WORDS[i]} +@@ -60,4 +72,4 @@ _systemd_run() { + return 0 + } + +-complete -F _systemd_run systemd-run ++complete -o default -o bashdefault -F _systemd_run systemd-run +--- systemd-208/shell-completion/bash/timedatectl ++++ systemd-208/shell-completion/bash/timedatectl 2014-01-17 14:36:06.182735466 +0000 +@@ -30,6 +30,10 @@ _timedatectl() { + local OPTS='-h --help --version --adjust-system-clock --no-pager + --no-ask-password -H --host' + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + if __contains_word "$prev" $OPTS; then + case $prev in + --host|-H) +@@ -73,4 +77,4 @@ _timedatectl() { + return 0 + } + +-complete -F _timedatectl timedatectl ++complete -o default -o bashdefault -F _timedatectl timedatectl +--- systemd-208/shell-completion/bash/udevadm ++++ systemd-208/shell-completion/bash/udevadm 2014-01-17 14:36:16.406236120 +0000 +@@ -36,6 +36,10 @@ _udevadm() { + + local verbs=(info trigger settle control monitor hwdb test-builtin test) + ++ if __contains_word ">" ${COMP_WORDS[*]:0:COMP_CWORD}; then ++ return 0 ++ fi ++ + for ((i=0; i <= COMP_CWORD; i++)); do + if __contains_word "${COMP_WORDS[i]}" "${verbs[@]}" && + ! __contains_word "${COMP_WORDS[i-1]}" ${OPTS[ARG]}; then +@@ -94,4 +98,4 @@ _udevadm() { + return 0 + } + +-complete -F _udevadm udevadm ++complete -o default -o bashdefault -F _udevadm udevadm diff --git a/systemd.changes b/systemd.changes index a95a9224..7540da07 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jan 17 16:09:24 UTC 2014 - werner@suse.de + +- Add patch + 1019-make-completion-smart-to-be-able-to-redirect.patch + to make redirections work with the bash command completions for + for systemd command tools (bnc#856858, bnc#859072) + ------------------------------------------------------------------- Fri Jan 17 12:24:13 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index c3325832..fedb177b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -21,6 +21,11 @@ %define udevpkgname udev %define udev_major 1 +%if 0%{?sles_version} == 0 +%global with_bash_completion 1 +%endif +%bcond_with bash_completion + Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 208 @@ -84,6 +89,9 @@ Conflicts: kiwi # the buildignore is important for bootstrapping #!BuildIgnore: udev Requires: %{udevpkgname} >= 172 +%if %{with bash_completion} +Requires: bash-completion +%endif Requires: dbus-1 >= 1.4.0 Requires: kbd Requires: kmod >= 14 @@ -278,6 +286,8 @@ Patch1016: support-powerfail-with-powerstatus.patch Patch1017: 1017-enforce-sufficient-shutdown-warnings.patch # PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch +# PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch +Patch1019: 1019-make-completion-smart-to-be-able-to-redirect.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -563,6 +573,7 @@ cp %{SOURCE7} m4/ %patch1016 -p1 %patch1017 -p1 %patch1018 -p1 +%patch1019 -p1 # ensure generate files are removed rm -f units/emergency.service @@ -745,6 +756,16 @@ install -m 755 %{S:12} %{buildroot}/%{_prefix}/lib/systemd/ install -m 644 units/powerfail.service %{buildroot}/%{_prefix}/lib/systemd/system/ install -m 644 man/systemd-powerfail.service.8 %{buildroot}/%{_mandir}/man8/ +# clean out some completions which requires bash-completion package +%if %{without bash_completion} +for c in %{buildroot}/%{_datadir}/bash-completion/completions/* +do + test -e "$c" || continue + grep -q _init_completion "$c" || continue + rm -vf "$c" +done +%endif + %fdupes -s %{buildroot}%{_mandir} # packaged in systemd-rpm-macros From b8e4153dce6297c55f846852d228d320ca3342fdfd18817f4d91619a5044aa05 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 17 Jan 2014 16:20:51 +0000 Subject: [PATCH 07/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=488 --- macros.systemd | 14 ++++++++++++++ systemd.changes | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/macros.systemd b/macros.systemd index dc70ceb7..1a003957 100644 --- a/macros.systemd +++ b/macros.systemd @@ -46,6 +46,13 @@ if [ $FIRST_ARG -eq 1 ]; then \ touch "/var/lib/systemd/migrated/$sysv_service" || : \ done \ else \ + if [ $FIRST_ARG -gt 1 ]; then \ + for service in %{?*} ; do \ + if [ ! -e "/usr/lib/systemd/system/$service" ]; then \ + touch "/run/rpm-%{name}-update-$service-new-in-upgrade" \ + fi \ + done \ + fi \ for service in %{?*} ; do \ sysv_service=${service%.*} \ if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \ @@ -74,6 +81,13 @@ if [ -n "$services_to_migrate" ]; then \ /usr/sbin/systemd-sysv-convert --apply $services_to_migrate >/dev/null 2>&1 || : \ elif [ $FIRST_ARG -eq 1 ]; then \ /usr/bin/systemctl preset %{?*} >/dev/null 2>&1 || : \ +elif [ $FIRST_ARG -gt 1 ]; then \ + for service in %{?*} ; do \ + if [ -e "/run/rpm-%{name}-update-$service-new-in-upgrade" ]; then \ + rm -f "/run/rpm-%{name}-update-$service-new-in-upgrade" \ + /usr/bin/systemctl preset "$service" >/dev/null 2>&1 || : \ + fi \ + done \ fi \ %{nil} diff --git a/systemd.changes b/systemd.changes index 7540da07..620dfd30 100644 --- a/systemd.changes +++ b/systemd.changes @@ -15,6 +15,11 @@ Fri Jan 17 12:24:13 UTC 2014 - werner@suse.de sure that required dependencies are handles as required ones. This should fix bnc#858864 and bnc#857204. +------------------------------------------------------------------- +Thu Jan 16 16:08:00 UTC 2014 - lnussel@suse.de + +- apply preset also to service files that are new in upgrade + ------------------------------------------------------------------- Wed Jan 15 14:11:02 UTC 2014 - werner@suse.de From 1b6c2309400012f24c326ea05b4f640df9f92ae957b020bdb36d72000add917f Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Mon, 20 Jan 2014 12:22:10 +0000 Subject: [PATCH 08/19] Accepting request 214486 from home:fcrozat:branches:Base:System - Add analyze-fix-crash-in-command-line-parsing.patch: fix crash in systemd-analyze (bnc#859365) OBS-URL: https://build.opensuse.org/request/show/214486 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=489 --- ...ze-fix-crash-in-command-line-parsing.patch | 35 ++++++++ systemd-mini.changes | 82 +++++++++++++++++++ systemd-mini.spec | 39 +++++++++ systemd.changes | 6 ++ systemd.spec | 3 + 5 files changed, 165 insertions(+) create mode 100644 analyze-fix-crash-in-command-line-parsing.patch diff --git a/analyze-fix-crash-in-command-line-parsing.patch b/analyze-fix-crash-in-command-line-parsing.patch new file mode 100644 index 00000000..f76266ec --- /dev/null +++ b/analyze-fix-crash-in-command-line-parsing.patch @@ -0,0 +1,35 @@ +From da6de8a55784115451582051c8da620056994a05 Mon Sep 17 00:00:00 2001 +From: Frederic Crozat +Date: Mon, 20 Jan 2014 11:05:22 +0100 +Subject: [PATCH] analyze: fix crash in command line parsing + +Ensure DBusError is set before it can possibly be freed on return. +Fix crash when calling set-log-level without any parameter. + +Fix https://bugzilla.novell.com/show_bug.cgi?id=859365 +--- + src/analyze/systemd-analyze.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/analyze/systemd-analyze.c b/src/analyze/systemd-analyze.c +index 27d063c..cdfae93 100644 +--- a/src/analyze/systemd-analyze.c ++++ b/src/analyze/systemd-analyze.c +@@ -1226,13 +1226,13 @@ static int set_log_level(DBusConnection *bus, char **args) { + assert(bus); + assert(args); + ++ dbus_error_init(&error); + if (strv_length(args) != 1) { + log_error("This command expects one argument only."); + return -E2BIG; + } + + value = args[0]; +- dbus_error_init(&error); + + m = dbus_message_new_method_call("org.freedesktop.systemd1", + "/org/freedesktop/systemd1", +-- +1.8.4 + diff --git a/systemd-mini.changes b/systemd-mini.changes index ba215dd6..5342df35 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,85 @@ +------------------------------------------------------------------- +Mon Jan 20 10:18:20 UTC 2014 - fcrozat@suse.com + +- Add analyze-fix-crash-in-command-line-parsing.patch: fix crash in + systemd-analyze (bnc#859365) + +------------------------------------------------------------------- +Fri Jan 17 16:09:24 UTC 2014 - werner@suse.de + +- Add patch + 1019-make-completion-smart-to-be-able-to-redirect.patch + to make redirections work with the bash command completions for + for systemd command tools (bnc#856858, bnc#859072) + +------------------------------------------------------------------- +Fri Jan 17 12:24:13 UTC 2014 - werner@suse.de + +- Add patch + 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch + to support the "+" to tag wanted dependencies as well as make + sure that required dependencies are handles as required ones. + This should fix bnc#858864 and bnc#857204. + +------------------------------------------------------------------- +Thu Jan 16 16:08:00 UTC 2014 - lnussel@suse.de + +- apply preset also to service files that are new in upgrade + +------------------------------------------------------------------- +Wed Jan 15 14:11:02 UTC 2014 - werner@suse.de + +- Change support-powerfail-with-powerstatus.patch to use BindsTo + instead of BindTo + +------------------------------------------------------------------- +Wed Jan 15 12:34:53 UTC 2014 - werner@suse.de + +- Add patch 1017-enforce-sufficient-shutdown-warnings.patch + Warn once per hour in the last 3 hours, then all 30 minutes in last + hour, all 15 minutes in the last 45 minutes, all 10 minutes in the + last 15 minutes, and then all minute in the last 10 minutes (bnc#750845) + +------------------------------------------------------------------- +Tue Jan 14 18:28:09 UTC 2014 - werner@suse.de + +- Add patch support-powerfail-with-powerstatus.patch and source + file systemd-powerfail to implement SIGPWR support with evaluation + of the file /var/run/powerstatus (bnc#737690) + +------------------------------------------------------------------- +Fri Dec 20 12:06:18 UTC 2013 - werner@suse.de + +- Adapt patch + 1011-check-4-valid-kmsg-device.patch + to fit current upstream version maybe related to bnc#854884 +- Change patch + 1012-pam_systemd_do_override_XDG_RUNTIME_DIR_of_the_original_user.patch + to check if XDG_RUNTIME_DIR is set before the call of pam_putenv() + may fix bnc#855160 + +------------------------------------------------------------------- +Fri Dec 20 09:40:01 UTC 2013 - lbsousajr@gmail.com + +- Disable multi-seat-x build, since package xorg-x11-server + currently in Factory no longer needs it. + +------------------------------------------------------------------- +Wed Dec 18 18:56:01 UTC 2013 - hrvoje.senjan@gmail.com + +- Added 0001-logind-garbage-collect-stale-users.patch: Don't stop a + running user manager from garbage-collecting the user. Original + behavior caused bnc#849870 + +------------------------------------------------------------------- +Mon Dec 16 11:08:33 UTC 2013 - lbsousajr@gmail.com + +- Add build-sys-make-multi-seat-x-optional.patch + * See: http://cgit.freedesktop.org/systemd/systemd/commit/?id=bd441fa27a22b7c6e11d9330560e0622fb69f297 + * Now systemd-multi-seat-x build can be disabled with configure option + --disable-multi-seat-x. It should be done when xorg-x11-server + no longer needs it (work in progress). + ------------------------------------------------------------------- Mon Dec 16 09:43:29 UTC 2013 - fcrozat@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index a35884ef..7c40f350 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -23,6 +23,11 @@ %define udevpkgname udev-mini %define udev_major 1 +%if 0%{?sles_version} == 0 +%global with_bash_completion 1 +%endif +%bcond_with bash_completion + Name: systemd-mini Url: http://www.freedesktop.org/wiki/Software/systemd Version: 208 @@ -89,6 +94,9 @@ Conflicts: kiwi # the buildignore is important for bootstrapping #!BuildIgnore: udev Requires: %{udevpkgname} >= 172 +%if %{with bash_completion} +Requires: bash-completion +%endif Requires: dbus-1 >= 1.4.0 Requires: kbd Requires: kmod >= 14 @@ -117,6 +125,7 @@ Source8: systemd-journald.init Source9: nss-myhostname-config Source10: macros.systemd.upstream Source11: after-local.service +Source12: systemd-powerfail Source1060: boot.udev Source1061: write_dev_root_rule @@ -246,6 +255,8 @@ Patch79: 0001-analyze-set-white-background.patch Patch80: 0001-analyze-set-text-on-side-with-most-space.patch # PATCH-FIX-UPSTREAM 0001-logind-garbage-collect-stale-users.patch -- Don't stop a running user manager from garbage-collecting the user. Patch81: 0001-logind-garbage-collect-stale-users.patch +# PATCH-FIX-UPSTREAM analyze-fix-crash-in-command-line-parsing.patch fcrozat@suse.com bnc#859365 -- Fix crash in systemd-analyze +Patch82: analyze-fix-crash-in-command-line-parsing.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -276,6 +287,14 @@ Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch Patch1014: 1014-journald-with-journaling-FS.patch # PATCH-FIX-UPSTREAM build-sys-make-multi-seat-x-optional.patch Patch1015: build-sys-make-multi-seat-x-optional.patch +# PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch +Patch1016: support-powerfail-with-powerstatus.patch +# PATCH-FIX-SUSE 1017-enforce-sufficient-shutdown-warnings.patch +Patch1017: 1017-enforce-sufficient-shutdown-warnings.patch +# PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch +Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch +# PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch +Patch1019: 1019-make-completion-smart-to-be-able-to-redirect.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -539,6 +558,7 @@ cp %{SOURCE7} m4/ %patch79 -p1 %patch80 -p1 %patch81 -p1 +%patch82 -p1 # udev patches %patch1001 -p1 @@ -558,6 +578,10 @@ cp %{SOURCE7} m4/ %patch1013 -p1 %patch1014 -p1 %patch1015 -p1 +%patch1016 -p1 +%patch1017 -p1 +%patch1018 -p1 +%patch1019 -p1 # ensure generate files are removed rm -f units/emergency.service @@ -735,6 +759,21 @@ EOF install -m 644 %{S:11} %{buildroot}/%{_prefix}/lib/systemd/system/ ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-user.target.wants/ +# support for SIGPWR handling with /var/run/powerstatus of e.g. powerd +install -m 755 %{S:12} %{buildroot}/%{_prefix}/lib/systemd/ +install -m 644 units/powerfail.service %{buildroot}/%{_prefix}/lib/systemd/system/ +install -m 644 man/systemd-powerfail.service.8 %{buildroot}/%{_mandir}/man8/ + +# clean out some completions which requires bash-completion package +%if %{without bash_completion} +for c in %{buildroot}/%{_datadir}/bash-completion/completions/* +do + test -e "$c" || continue + grep -q _init_completion "$c" || continue + rm -vf "$c" +done +%endif + %fdupes -s %{buildroot}%{_mandir} # packaged in systemd-rpm-macros diff --git a/systemd.changes b/systemd.changes index 620dfd30..5342df35 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 20 10:18:20 UTC 2014 - fcrozat@suse.com + +- Add analyze-fix-crash-in-command-line-parsing.patch: fix crash in + systemd-analyze (bnc#859365) + ------------------------------------------------------------------- Fri Jan 17 16:09:24 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index fedb177b..0a1fb50a 100644 --- a/systemd.spec +++ b/systemd.spec @@ -250,6 +250,8 @@ Patch79: 0001-analyze-set-white-background.patch Patch80: 0001-analyze-set-text-on-side-with-most-space.patch # PATCH-FIX-UPSTREAM 0001-logind-garbage-collect-stale-users.patch -- Don't stop a running user manager from garbage-collecting the user. Patch81: 0001-logind-garbage-collect-stale-users.patch +# PATCH-FIX-UPSTREAM analyze-fix-crash-in-command-line-parsing.patch fcrozat@suse.com bnc#859365 -- Fix crash in systemd-analyze +Patch82: analyze-fix-crash-in-command-line-parsing.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -551,6 +553,7 @@ cp %{SOURCE7} m4/ %patch79 -p1 %patch80 -p1 %patch81 -p1 +%patch82 -p1 # udev patches %patch1001 -p1 From 4f574e1e4c0cb260f83c5e19d0b2988fda3a59450f01e668f6564fc2d4aca492 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 21 Jan 2014 12:55:52 +0000 Subject: [PATCH 09/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=490 --- 1016-support-powerfail-with-powerstatus.patch | 90 +++++++++++++++++++ ...enforce-sufficient-shutdown-warnings.patch | 24 ----- systemd-mini.changes | 9 ++ systemd-mini.spec | 7 +- systemd.changes | 9 ++ systemd.spec | 7 +- 6 files changed, 112 insertions(+), 34 deletions(-) create mode 100644 1016-support-powerfail-with-powerstatus.patch delete mode 100644 1017-enforce-sufficient-shutdown-warnings.patch diff --git a/1016-support-powerfail-with-powerstatus.patch b/1016-support-powerfail-with-powerstatus.patch new file mode 100644 index 00000000..c59f6828 --- /dev/null +++ b/1016-support-powerfail-with-powerstatus.patch @@ -0,0 +1,90 @@ +--- 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) diff --git a/1017-enforce-sufficient-shutdown-warnings.patch b/1017-enforce-sufficient-shutdown-warnings.patch deleted file mode 100644 index 036ff622..00000000 --- a/1017-enforce-sufficient-shutdown-warnings.patch +++ /dev/null @@ -1,24 +0,0 @@ -Simple fix for bnc#750845. Maybe the original values are broken as the -delay of the first two entries in when_wall() are less then the warning -intervall. Now we warn once per hour in the first 3 hours, then all -30 minutes in last hour, all 15 minutes in the last 45 minutes, all 10 -minutes in the last 15 minutes, and then all minute in the last 10 minutes. - ---- - shutdownd.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- systemd-208/src/shutdownd/shutdownd.c -+++ systemd-208/src/shutdownd/shutdownd.c 2014-01-15 12:11:23.206235784 +0000 -@@ -156,8 +156,9 @@ _const_ static usec_t when_wall(usec_t n - usec_t delay; - usec_t interval; - } table[] = { -- { 0, USEC_PER_MINUTE }, -- { 10 * USEC_PER_MINUTE, 15 * USEC_PER_MINUTE }, -+ { 10 * USEC_PER_MINUTE, USEC_PER_MINUTE }, -+ { 15 * USEC_PER_MINUTE, 10 * USEC_PER_MINUTE }, -+ { 45 * USEC_PER_MINUTE, 15 * USEC_PER_MINUTE }, - { USEC_PER_HOUR, 30 * USEC_PER_MINUTE }, - { 3 * USEC_PER_HOUR, USEC_PER_HOUR }, - }; diff --git a/systemd-mini.changes b/systemd-mini.changes index 5342df35..b1df88a4 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jan 21 12:51:20 UTC 2014 - werner@suse.de + +- Drop patch 1017-enforce-sufficient-shutdown-warnings.patch + as the original code behaves exactly as the shutdown code of + the old SysVinit (bnc#750845) +- Rename support-powerfail-with-powerstatus.patch to + 1016-support-powerfail-with-powerstatus.patch + ------------------------------------------------------------------- Mon Jan 20 10:18:20 UTC 2014 - fcrozat@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 7c40f350..95113a41 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -287,10 +287,8 @@ Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch Patch1014: 1014-journald-with-journaling-FS.patch # PATCH-FIX-UPSTREAM build-sys-make-multi-seat-x-optional.patch Patch1015: build-sys-make-multi-seat-x-optional.patch -# PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch -Patch1016: support-powerfail-with-powerstatus.patch -# PATCH-FIX-SUSE 1017-enforce-sufficient-shutdown-warnings.patch -Patch1017: 1017-enforce-sufficient-shutdown-warnings.patch +# PATCH-FIX-SUSE 1016-support-powerfail-with-powerstatus.patch +Patch1016: 1016-support-powerfail-with-powerstatus.patch # PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch # PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch @@ -579,7 +577,6 @@ cp %{SOURCE7} m4/ %patch1014 -p1 %patch1015 -p1 %patch1016 -p1 -%patch1017 -p1 %patch1018 -p1 %patch1019 -p1 diff --git a/systemd.changes b/systemd.changes index 5342df35..b1df88a4 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jan 21 12:51:20 UTC 2014 - werner@suse.de + +- Drop patch 1017-enforce-sufficient-shutdown-warnings.patch + as the original code behaves exactly as the shutdown code of + the old SysVinit (bnc#750845) +- Rename support-powerfail-with-powerstatus.patch to + 1016-support-powerfail-with-powerstatus.patch + ------------------------------------------------------------------- Mon Jan 20 10:18:20 UTC 2014 - fcrozat@suse.com diff --git a/systemd.spec b/systemd.spec index 0a1fb50a..a27e22c8 100644 --- a/systemd.spec +++ b/systemd.spec @@ -282,10 +282,8 @@ Patch1013: U_logind_revert_lazy_session_activation_on_non_vt_seats.patch Patch1014: 1014-journald-with-journaling-FS.patch # PATCH-FIX-UPSTREAM build-sys-make-multi-seat-x-optional.patch Patch1015: build-sys-make-multi-seat-x-optional.patch -# PATCH-FIX-SUSE support-powerfail-with-powerstatus.patch -Patch1016: support-powerfail-with-powerstatus.patch -# PATCH-FIX-SUSE 1017-enforce-sufficient-shutdown-warnings.patch -Patch1017: 1017-enforce-sufficient-shutdown-warnings.patch +# PATCH-FIX-SUSE 1016-support-powerfail-with-powerstatus.patch +Patch1016: 1016-support-powerfail-with-powerstatus.patch # PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch # PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch @@ -574,7 +572,6 @@ cp %{SOURCE7} m4/ %patch1014 -p1 %patch1015 -p1 %patch1016 -p1 -%patch1017 -p1 %patch1018 -p1 %patch1019 -p1 From cb13447e309608d68bf35fd48b357b469793529c131e3e76ba2895c37eb92567 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 21 Jan 2014 13:08:47 +0000 Subject: [PATCH 10/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=491 --- ...nit-handling-if-sysv-already-handled.patch | 20 +++++++++++++++++++ systemd.changes | 7 +++++++ systemd.spec | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 1017-skip-native-unit-handling-if-sysv-already-handled.patch diff --git a/1017-skip-native-unit-handling-if-sysv-already-handled.patch b/1017-skip-native-unit-handling-if-sysv-already-handled.patch new file mode 100644 index 00000000..e21e14eb --- /dev/null +++ b/1017-skip-native-unit-handling-if-sysv-already-handled.patch @@ -0,0 +1,20 @@ +For bnc#818044 +Based on http://cgit.freedesktop.org/systemd/systemd/patch/?id=67d6621059085963a2a908a3ea99ced3b0ca789e +--- + systemctl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- systemd-208/src/systemctl/systemctl.c ++++ systemd-208/src/systemctl/systemctl.c 2014-01-21 13:00:52.910736187 +0000 +@@ -4453,6 +4453,11 @@ static int enable_unit(DBusConnection *b + if (r < 0) + return r; + ++ /* If the operation was fully executed by the SysV compat, ++ * let's finish early */ ++ if (strv_isempty(names)) ++ return 0; ++ + if (!bus || avoid_bus()) { + if (streq(verb, "enable")) { + r = unit_file_enable(arg_scope, arg_runtime, arg_root, mangled_names, arg_force, &changes, &n_changes); diff --git a/systemd.changes b/systemd.changes index b1df88a4..920ab0fb 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jan 21 13:05:59 UTC 2014 - werner@suse.de + +- Add patch 1017-skip-native-unit-handling-if-sysv-already-handled.patch + to avoid that enabled boot scripts will be handled as unit files + by systemctl status command (bnc#818044) + ------------------------------------------------------------------- Tue Jan 21 12:51:20 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index a27e22c8..625998a5 100644 --- a/systemd.spec +++ b/systemd.spec @@ -284,6 +284,8 @@ Patch1014: 1014-journald-with-journaling-FS.patch Patch1015: build-sys-make-multi-seat-x-optional.patch # PATCH-FIX-SUSE 1016-support-powerfail-with-powerstatus.patch Patch1016: 1016-support-powerfail-with-powerstatus.patch +# PATCH-FIX-UPSTREAM 1017-skip-native-unit-handling-if-sysv-already-handled.patch +Patch1017: 1017-skip-native-unit-handling-if-sysv-already-handled.patch # PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch # PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch @@ -572,6 +574,7 @@ cp %{SOURCE7} m4/ %patch1014 -p1 %patch1015 -p1 %patch1016 -p1 +%patch1017 -p1 %patch1018 -p1 %patch1019 -p1 From dfbbff74f58e818e990f7961b914b1b64006b67df45ea9471a7d384cc2496e0f Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 21 Jan 2014 13:16:14 +0000 Subject: [PATCH 11/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=492 --- 1017-skip-native-unit-handling-if-sysv-already-handled.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1017-skip-native-unit-handling-if-sysv-already-handled.patch b/1017-skip-native-unit-handling-if-sysv-already-handled.patch index e21e14eb..9390c42a 100644 --- a/1017-skip-native-unit-handling-if-sysv-already-handled.patch +++ b/1017-skip-native-unit-handling-if-sysv-already-handled.patch @@ -12,7 +12,7 @@ Based on http://cgit.freedesktop.org/systemd/systemd/patch/?id=67d6621059085963a + /* If the operation was fully executed by the SysV compat, + * let's finish early */ -+ if (strv_isempty(names)) ++ if (strv_isempty(mangled_names)) + return 0; + if (!bus || avoid_bus()) { From 0d775ff9bc01619d58bcd383dd759a8170bda724e559d746c56292edaec3c2af Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 23 Jan 2014 12:56:59 +0000 Subject: [PATCH 12/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=493 --- ...ailureIsolate-setting-by-a-more-gene.patch | 329 ++++++++++++++++++ ....service-conflict-with-syslog.socket.patch | 22 ++ systemd.changes | 13 + systemd.spec | 6 + 4 files changed, 370 insertions(+) create mode 100644 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch create mode 100644 make-emergency.service-conflict-with-syslog.socket.patch diff --git a/0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch b/0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch new file mode 100644 index 00000000..40479ead --- /dev/null +++ b/0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch @@ -0,0 +1,329 @@ +From d420282b28f50720e233ccb1c02547c562195653 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 26 Nov 2013 01:39:53 +0100 +Subject: [PATCH] core: replace OnFailureIsolate= setting by a more generic + OnFailureJobMode= setting and make use of it where applicable + +--- + man/systemd.unit.xml | 40 +++++++++++++++++++++++++---------- + src/core/dbus-unit.c | 3 ++- + src/core/job.h | 3 +-- + src/core/load-fragment-gperf.gperf.m4 | 3 ++- + src/core/load-fragment.c | 31 +++++++++++++++++++++++++++ + src/core/load-fragment.h | 2 ++ + src/core/unit.c | 11 +++++----- + src/core/unit.h | 4 ++-- + units/initrd-cleanup.service.in | 1 + + units/initrd-fs.target | 2 +- + units/initrd-parse-etc.service.in | 1 + + units/initrd-root-fs.target | 2 +- + units/initrd-switch-root.service.in | 1 + + units/initrd.target | 2 +- + units/local-fs.target | 2 +- + 15 files changed, 82 insertions(+), 26 deletions(-) + +Index: systemd-208/man/systemd.unit.xml +=================================================================== +--- systemd-208.orig/man/systemd.unit.xml ++++ systemd-208/man/systemd.unit.xml +@@ -669,19 +669,37 @@ + + + +- OnFailureIsolate= ++ OnFailureJobMode= + +- Takes a boolean +- argument. If , the +- unit listed in ++ Takes a value of ++ fail, ++ replace, ++ replace-irreversibly ++ or ++ isolate. Defaults ++ to ++ replace. Specifies ++ how the units listed in + OnFailure= will be +- enqueued in isolation mode, i.e. all +- units that are not its dependency will +- be stopped. If this is set, only a ++ enqueued. If set to ++ fail and ++ contradicting jobs are already queued, ++ cause the activation to fail. If set ++ to replace and ++ contradicting jobs area already ++ queued, replace ++ those. replace-irreversibly ++ is similar to ++ replace, however, ++ creates jobs that cannot be reversed ++ unless they finished or are explicitly ++ canceled. isolate ++ may be used to terminate all other ++ units but the specified one. If ++ this is set to ++ isolate, only a + single unit may be listed in +- OnFailure=. Defaults +- to +- . ++ OnFailure=.. + + + +Index: systemd-208/src/core/dbus-unit.c +=================================================================== +--- systemd-208.orig/src/core/dbus-unit.c ++++ systemd-208/src/core/dbus-unit.c +@@ -133,6 +133,7 @@ static int bus_unit_append_description(D + } + + static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_unit_append_load_state, unit_load_state, UnitLoadState); ++static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_unit_append_job_mode, job_mode, JobMode); + + static int bus_unit_append_active_state(DBusMessageIter *i, const char *property, void *data) { + Unit *u = data; +@@ -1079,7 +1080,7 @@ const BusProperty bus_unit_properties[] + { "RefuseManualStop", bus_property_append_bool, "b", offsetof(Unit, refuse_manual_stop) }, + { "AllowIsolate", bus_property_append_bool, "b", offsetof(Unit, allow_isolate) }, + { "DefaultDependencies", bus_property_append_bool, "b", offsetof(Unit, default_dependencies) }, +- { "OnFailureIsolate", bus_property_append_bool, "b", offsetof(Unit, on_failure_isolate) }, ++ { "OnFailureJobMode", bus_unit_append_job_mode, "s", offsetof(Unit, on_failure_job_mode) }, + { "IgnoreOnIsolate", bus_property_append_bool, "b", offsetof(Unit, ignore_on_isolate) }, + { "IgnoreOnSnapshot", bus_property_append_bool, "b", offsetof(Unit, ignore_on_snapshot) }, + { "NeedDaemonReload", bus_unit_append_need_daemon_reload, "b", 0 }, +Index: systemd-208/src/core/job.h +=================================================================== +--- systemd-208.orig/src/core/job.h ++++ systemd-208/src/core/job.h +@@ -83,7 +83,7 @@ enum JobState { + enum JobMode { + JOB_FAIL, /* Fail if a conflicting job is already queued */ + JOB_REPLACE, /* Replace an existing conflicting job */ +- JOB_REPLACE_IRREVERSIBLY, /* Like JOB_REPLACE + produce irreversible jobs */ ++ JOB_REPLACE_IRREVERSIBLY,/* Like JOB_REPLACE + produce irreversible jobs */ + JOB_ISOLATE, /* Start a unit, and stop all others */ + JOB_IGNORE_DEPENDENCIES, /* Ignore both requirement and ordering dependencies */ + JOB_IGNORE_REQUIREMENTS, /* Ignore requirement dependencies */ +Index: systemd-208/src/core/load-fragment-gperf.gperf.m4 +=================================================================== +--- systemd-208.orig/src/core/load-fragment-gperf.gperf.m4 ++++ systemd-208/src/core/load-fragment-gperf.gperf.m4 +@@ -122,7 +122,8 @@ Unit.RefuseManualStart, config_ + Unit.RefuseManualStop, config_parse_bool, 0, offsetof(Unit, refuse_manual_stop) + Unit.AllowIsolate, config_parse_bool, 0, offsetof(Unit, allow_isolate) + Unit.DefaultDependencies, config_parse_bool, 0, offsetof(Unit, default_dependencies) +-Unit.OnFailureIsolate, config_parse_bool, 0, offsetof(Unit, on_failure_isolate) ++Unit.OnFailureJobMode, config_parse_job_mode, 0, offsetof(Unit, on_failure_job_mode) ++Unit.OnFailureIsolate, config_parse_job_mode_isolate, 0, offsetof(Unit, on_failure_job_mode) + Unit.IgnoreOnIsolate, config_parse_bool, 0, offsetof(Unit, ignore_on_isolate) + Unit.IgnoreOnSnapshot, config_parse_bool, 0, offsetof(Unit, ignore_on_snapshot) + Unit.JobTimeoutSec, config_parse_sec, 0, offsetof(Unit, job_timeout) +Index: systemd-208/src/core/load-fragment.c +=================================================================== +--- systemd-208.orig/src/core/load-fragment.c ++++ systemd-208/src/core/load-fragment.c +@@ -2314,6 +2314,36 @@ int config_parse_blockio_bandwidth( + return 0; + } + ++DEFINE_CONFIG_PARSE_ENUM(config_parse_job_mode, job_mode, JobMode, "Failed to parse job mode"); ++ ++int config_parse_job_mode_isolate( ++ const char *unit, ++ const char *filename, ++ unsigned line, ++ const char *section, ++ const char *lvalue, ++ int ltype, ++ const char *rvalue, ++ void *data, ++ void *userdata) { ++ ++ JobMode *m = data; ++ int r; ++ ++ assert(filename); ++ assert(lvalue); ++ assert(rvalue); ++ ++ r = parse_boolean(rvalue); ++ if (r < 0) { ++ log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Failed to parse boolean, ignoring: %s", rvalue); ++ return 0; ++ } ++ ++ *m = r ? JOB_ISOLATE : JOB_REPLACE; ++ return 0; ++} ++ + #define FOLLOW_MAX 8 + + static int open_follow(char **filename, FILE **_f, Set *names, char **_final) { +Index: systemd-208/src/core/load-fragment.h +=================================================================== +--- systemd-208.orig/src/core/load-fragment.h ++++ systemd-208/src/core/load-fragment.h +@@ -83,6 +83,8 @@ int config_parse_device_allow(const char + int config_parse_blockio_weight(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_blockio_device_weight(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + int config_parse_blockio_bandwidth(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); ++int config_parse_job_mode(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); ++int config_parse_job_mode_isolate(const char *unit, const char *filename, unsigned line, const char *section, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); + + /* gperf prototypes */ + const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, unsigned length); +Index: systemd-208/src/core/unit.c +=================================================================== +--- systemd-208.orig/src/core/unit.c ++++ systemd-208/src/core/unit.c +@@ -85,6 +85,7 @@ Unit *unit_new(Manager *m, size_t size) + u->deserialized_job = _JOB_TYPE_INVALID; + u->default_dependencies = true; + u->unit_file_state = _UNIT_FILE_STATE_INVALID; ++ u->on_failure_job_mode = JOB_REPLACE; + + return u; + } +@@ -807,14 +808,14 @@ void unit_dump(Unit *u, FILE *f, const c + "%s\tRefuseManualStart: %s\n" + "%s\tRefuseManualStop: %s\n" + "%s\tDefaultDependencies: %s\n" +- "%s\tOnFailureIsolate: %s\n" ++ "%s\tOnFailureJobMode: %s\n" + "%s\tIgnoreOnIsolate: %s\n" + "%s\tIgnoreOnSnapshot: %s\n", + prefix, yes_no(u->stop_when_unneeded), + prefix, yes_no(u->refuse_manual_start), + prefix, yes_no(u->refuse_manual_stop), + prefix, yes_no(u->default_dependencies), +- prefix, yes_no(u->on_failure_isolate), ++ prefix, job_mode_to_string(u->on_failure_job_mode), + prefix, yes_no(u->ignore_on_isolate), + prefix, yes_no(u->ignore_on_snapshot)); + +@@ -985,11 +986,11 @@ int unit_load(Unit *u) { + if (r < 0) + goto fail; + +- if (u->on_failure_isolate && ++ if (u->on_failure_job_mode == JOB_ISOLATE && + set_size(u->dependencies[UNIT_ON_FAILURE]) > 1) { + + log_error_unit(u->id, +- "More than one OnFailure= dependencies specified for %s but OnFailureIsolate= enabled. Refusing.", u->id); ++ "More than one OnFailure= dependencies specified for %s but OnFailureJobMode=isolate set. Refusing.", u->id); + + r = -EINVAL; + goto fail; +@@ -1394,7 +1395,7 @@ void unit_start_on_failure(Unit *u) { + SET_FOREACH(other, u->dependencies[UNIT_ON_FAILURE], i) { + int r; + +- r = manager_add_job(u->manager, JOB_START, other, u->on_failure_isolate ? JOB_ISOLATE : JOB_REPLACE, true, NULL, NULL); ++ r = manager_add_job(u->manager, JOB_START, other, u->on_failure_job_mode, true, NULL, NULL); + if (r < 0) + log_error_unit(u->id, "Failed to enqueue OnFailure= job: %s", strerror(-r)); + } +Index: systemd-208/src/core/unit.h +=================================================================== +--- systemd-208.orig/src/core/unit.h ++++ systemd-208/src/core/unit.h +@@ -228,8 +228,8 @@ struct Unit { + /* Allow isolation requests */ + bool allow_isolate; + +- /* Isolate OnFailure unit */ +- bool on_failure_isolate; ++ /* How to start OnFailure units */ ++ JobMode on_failure_job_mode; + + /* Ignore this unit when isolating */ + bool ignore_on_isolate; +Index: systemd-208/units/initrd-cleanup.service.in +=================================================================== +--- systemd-208.orig/units/initrd-cleanup.service.in ++++ systemd-208/units/initrd-cleanup.service.in +@@ -10,6 +10,7 @@ Description=Cleaning Up and Shutting Dow + DefaultDependencies=no + ConditionPathExists=/etc/initrd-release + OnFailure=emergency.target ++OnFailureJobMode=replace-irreversibly + After=initrd-root-fs.target initrd-fs.target initrd.target + + [Service] +Index: systemd-208/units/initrd-fs.target +=================================================================== +--- systemd-208.orig/units/initrd-fs.target ++++ systemd-208/units/initrd-fs.target +@@ -9,7 +9,7 @@ + Description=Initrd File Systems + Documentation=man:systemd.special(7) + OnFailure=emergency.target +-OnFailureIsolate=yes ++OnFailureJobMode=replace-irreversibly + ConditionPathExists=/etc/initrd-release + After=initrd-parse-etc.service + DefaultDependencies=no +Index: systemd-208/units/initrd-parse-etc.service.in +=================================================================== +--- systemd-208.orig/units/initrd-parse-etc.service.in ++++ systemd-208/units/initrd-parse-etc.service.in +@@ -11,6 +11,7 @@ DefaultDependencies=no + Requires=initrd-root-fs.target + After=initrd-root-fs.target + OnFailure=emergency.target ++OnFailureJobMode=replace-irreversibly + ConditionPathExists=/etc/initrd-release + + [Service] +Index: systemd-208/units/initrd-root-fs.target +=================================================================== +--- systemd-208.orig/units/initrd-root-fs.target ++++ systemd-208/units/initrd-root-fs.target +@@ -10,6 +10,6 @@ Description=Initrd Root File System + Documentation=man:systemd.special(7) + ConditionPathExists=/etc/initrd-release + OnFailure=emergency.target +-OnFailureIsolate=yes ++OnFailureJobMode=replace-irreversibly + DefaultDependencies=no + Conflicts=shutdown.target +Index: systemd-208/units/initrd-switch-root.service.in +=================================================================== +--- systemd-208.orig/units/initrd-switch-root.service.in ++++ systemd-208/units/initrd-switch-root.service.in +@@ -10,6 +10,7 @@ Description=Switch Root + DefaultDependencies=no + ConditionPathExists=/etc/initrd-release + OnFailure=emergency.target ++OnFailureJobMode=replace-irreversibly + AllowIsolate=yes + + [Service] +Index: systemd-208/units/initrd.target +=================================================================== +--- systemd-208.orig/units/initrd.target ++++ systemd-208/units/initrd.target +@@ -9,7 +9,7 @@ + Description=Initrd Default Target + Documentation=man:systemd.special(7) + OnFailure=emergency.target +-OnFailureIsolate=yes ++OnFailureJobMode=replace-irreversibly + ConditionPathExists=/etc/initrd-release + Requires=basic.target + Wants=initrd-root-fs.target initrd-fs.target initrd-parse-etc.service +Index: systemd-208/units/local-fs.target +=================================================================== +--- systemd-208.orig/units/local-fs.target ++++ systemd-208/units/local-fs.target +@@ -12,4 +12,4 @@ After=local-fs-pre.target + DefaultDependencies=no + Conflicts=shutdown.target + OnFailure=emergency.target +-OnFailureIsolate=no ++OnFailureJobMode=replace-irreversibly diff --git a/make-emergency.service-conflict-with-syslog.socket.patch b/make-emergency.service-conflict-with-syslog.socket.patch new file mode 100644 index 00000000..63e513cc --- /dev/null +++ b/make-emergency.service-conflict-with-syslog.socket.patch @@ -0,0 +1,22 @@ +If after emergency service had been started there is incoming +traffic on syslog.socket emergency.service gets killed due to +implicit dependencies on basic.target => sysinit.target which in +turn conflict with emergency.target. + +As a workaround explicitly stop syslog.socket when entering +emergency.service. + +Reference: bnc#852232 +Index: systemd-208/units/emergency.service.in +=================================================================== +--- systemd-208/units/emergency.service.in ++++ systemd-208/units/emergency.service.in +@@ -9,7 +9,7 @@ + Description=Emergency Shell + Documentation=man:sulogin(8) + DefaultDependencies=no +-Conflicts=shutdown.target ++Conflicts=shutdown.target syslog.socket + Before=shutdown.target + + [Service] diff --git a/systemd.changes b/systemd.changes index 920ab0fb..cf1ad2e1 100644 --- a/systemd.changes +++ b/systemd.changes @@ -114,6 +114,19 @@ Fri Dec 6 13:30:19 UTC 2013 - werner@suse.de the systemd-journald (bnc#838475) - Let us build require the package config for libpcre (bnc#853293) +------------------------------------------------------------------- +Sat Nov 30 08:16:02 UTC 2013 - arvidjaar@gmail.com + +- Add patch + 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch + Make sure emergency shell is not killed by attempt to start another unit + (bnc#852021). Backported from d420282b28f50720e233ccb1c02547c562195653. +- Add patch + make-emergency.service-conflict-with-syslog.socket.patch + Previous patch did not fix problem if syslog connection request came + after emergency shell was already started. So forcibly stop syslog.socket + when starting emergency.service. (bnc#852232) + ------------------------------------------------------------------- Thu Nov 28 10:25:58 UTC 2013 - lbsousajr@gmail.com diff --git a/systemd.spec b/systemd.spec index 625998a5..1b4aa078 100644 --- a/systemd.spec +++ b/systemd.spec @@ -252,6 +252,10 @@ Patch80: 0001-analyze-set-text-on-side-with-most-space.patch Patch81: 0001-logind-garbage-collect-stale-users.patch # PATCH-FIX-UPSTREAM analyze-fix-crash-in-command-line-parsing.patch fcrozat@suse.com bnc#859365 -- Fix crash in systemd-analyze Patch82: analyze-fix-crash-in-command-line-parsing.patch +# PATCH-FIX-UPSTREAM 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch -- Prevent accidental kill of emergency shell (bnc#852021) +Patch83: 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch +# PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232) +Patch84: make-emergency.service-conflict-with-syslog.socket.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -554,6 +558,8 @@ cp %{SOURCE7} m4/ %patch80 -p1 %patch81 -p1 %patch82 -p1 +%patch83 -p1 +%patch84 -p1 # udev patches %patch1001 -p1 From ecca94508785078e5a7ce39cab4a0212c802efe8e66898f036fa320cfd4359cc Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 23 Jan 2014 13:19:16 +0000 Subject: [PATCH 13/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=494 --- systemd.changes | 5 +++++ systemd.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/systemd.changes b/systemd.changes index cf1ad2e1..d8486cd9 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 23 13:18:39 UTC 2014 - werner@suse.de + +- Make requires bash-completion a recommends + ------------------------------------------------------------------- Tue Jan 21 13:05:59 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 1b4aa078..4a1e8abe 100644 --- a/systemd.spec +++ b/systemd.spec @@ -90,7 +90,7 @@ Conflicts: kiwi #!BuildIgnore: udev Requires: %{udevpkgname} >= 172 %if %{with bash_completion} -Requires: bash-completion +Recommends: bash-completion %endif Requires: dbus-1 >= 1.4.0 Requires: kbd From 78a5ddca0afb3f79295d1b4406513da42ea8be2cfe36d19d7a7852e04e5f50de Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 23 Jan 2014 13:25:13 +0000 Subject: [PATCH 14/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=495 --- systemd.changes | 5 +++++ systemd.spec | 2 ++ 2 files changed, 7 insertions(+) diff --git a/systemd.changes b/systemd.changes index d8486cd9..60444215 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 23 13:24:53 UTC 2014 - werner@suse.de + +- Make systemd-mini build + ------------------------------------------------------------------- Thu Jan 23 13:18:39 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 4a1e8abe..370a2614 100644 --- a/systemd.spec +++ b/systemd.spec @@ -763,7 +763,9 @@ ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-us # support for SIGPWR handling with /var/run/powerstatus of e.g. powerd install -m 755 %{S:12} %{buildroot}/%{_prefix}/lib/systemd/ install -m 644 units/powerfail.service %{buildroot}/%{_prefix}/lib/systemd/system/ +%if ! 0%{?bootstrap} install -m 644 man/systemd-powerfail.service.8 %{buildroot}/%{_mandir}/man8/ +%endif # clean out some completions which requires bash-completion package %if %{without bash_completion} From 6d6585e2397cd1b3936bcadcd5f4e05729ab38465396bc080a69969d2d336235 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 23 Jan 2014 13:37:13 +0000 Subject: [PATCH 15/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=496 --- systemd-mini.changes | 30 ++++++++++++++++++++++++++++++ systemd-mini.spec | 13 ++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/systemd-mini.changes b/systemd-mini.changes index b1df88a4..60444215 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Thu Jan 23 13:24:53 UTC 2014 - werner@suse.de + +- Make systemd-mini build + +------------------------------------------------------------------- +Thu Jan 23 13:18:39 UTC 2014 - werner@suse.de + +- Make requires bash-completion a recommends + +------------------------------------------------------------------- +Tue Jan 21 13:05:59 UTC 2014 - werner@suse.de + +- Add patch 1017-skip-native-unit-handling-if-sysv-already-handled.patch + to avoid that enabled boot scripts will be handled as unit files + by systemctl status command (bnc#818044) + ------------------------------------------------------------------- Tue Jan 21 12:51:20 UTC 2014 - werner@suse.de @@ -107,6 +124,19 @@ Fri Dec 6 13:30:19 UTC 2013 - werner@suse.de the systemd-journald (bnc#838475) - Let us build require the package config for libpcre (bnc#853293) +------------------------------------------------------------------- +Sat Nov 30 08:16:02 UTC 2013 - arvidjaar@gmail.com + +- Add patch + 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch + Make sure emergency shell is not killed by attempt to start another unit + (bnc#852021). Backported from d420282b28f50720e233ccb1c02547c562195653. +- Add patch + make-emergency.service-conflict-with-syslog.socket.patch + Previous patch did not fix problem if syslog connection request came + after emergency shell was already started. So forcibly stop syslog.socket + when starting emergency.service. (bnc#852232) + ------------------------------------------------------------------- Thu Nov 28 10:25:58 UTC 2013 - lbsousajr@gmail.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 95113a41..eb3c19c3 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -95,7 +95,7 @@ Conflicts: kiwi #!BuildIgnore: udev Requires: %{udevpkgname} >= 172 %if %{with bash_completion} -Requires: bash-completion +Recommends: bash-completion %endif Requires: dbus-1 >= 1.4.0 Requires: kbd @@ -257,6 +257,10 @@ Patch80: 0001-analyze-set-text-on-side-with-most-space.patch Patch81: 0001-logind-garbage-collect-stale-users.patch # PATCH-FIX-UPSTREAM analyze-fix-crash-in-command-line-parsing.patch fcrozat@suse.com bnc#859365 -- Fix crash in systemd-analyze Patch82: analyze-fix-crash-in-command-line-parsing.patch +# PATCH-FIX-UPSTREAM 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch -- Prevent accidental kill of emergency shell (bnc#852021) +Patch83: 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch +# PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232) +Patch84: make-emergency.service-conflict-with-syslog.socket.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -289,6 +293,8 @@ Patch1014: 1014-journald-with-journaling-FS.patch Patch1015: build-sys-make-multi-seat-x-optional.patch # PATCH-FIX-SUSE 1016-support-powerfail-with-powerstatus.patch Patch1016: 1016-support-powerfail-with-powerstatus.patch +# PATCH-FIX-UPSTREAM 1017-skip-native-unit-handling-if-sysv-already-handled.patch +Patch1017: 1017-skip-native-unit-handling-if-sysv-already-handled.patch # PATCH-FIX-SUSE 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch Patch1018: 1018-Make-LSB-Skripts-know-about-Required-and-Should.patch # PATCH-FIX-SUSE 1019-make-completion-smart-to-be-able-to-redirect.patch @@ -557,6 +563,8 @@ cp %{SOURCE7} m4/ %patch80 -p1 %patch81 -p1 %patch82 -p1 +%patch83 -p1 +%patch84 -p1 # udev patches %patch1001 -p1 @@ -577,6 +585,7 @@ cp %{SOURCE7} m4/ %patch1014 -p1 %patch1015 -p1 %patch1016 -p1 +%patch1017 -p1 %patch1018 -p1 %patch1019 -p1 @@ -759,7 +768,9 @@ ln -s ../after-local.service %{buildroot}/%{_prefix}/lib/systemd/system/multi-us # support for SIGPWR handling with /var/run/powerstatus of e.g. powerd install -m 755 %{S:12} %{buildroot}/%{_prefix}/lib/systemd/ install -m 644 units/powerfail.service %{buildroot}/%{_prefix}/lib/systemd/system/ +%if ! 0%{?bootstrap} install -m 644 man/systemd-powerfail.service.8 %{buildroot}/%{_mandir}/man8/ +%endif # clean out some completions which requires bash-completion package %if %{without bash_completion} From e2b9a86f31484a599a11faf0316e0debcc2fe2c7a5d583e1461036e6edfdb61d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 28 Jan 2014 12:57:54 +0000 Subject: [PATCH 16/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=497 --- ...sh-for-reboot-or-hddown-for-poweroff.patch | 537 ++++++++++++++++++ ...systemctl-halt-reboot-error-handling.patch | 85 +++ systemd-mini.changes | 13 + systemd-mini.spec | 6 + systemd.changes | 13 + systemd.spec | 6 + 6 files changed, 660 insertions(+) create mode 100644 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch create mode 100644 0001-upstream-systemctl-halt-reboot-error-handling.patch diff --git a/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch b/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch new file mode 100644 index 00000000..0e0466f5 --- /dev/null +++ b/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch @@ -0,0 +1,537 @@ +This seems to be a SUSE specific patch. Here we add the check for unmaintained +disk like devices to be able to flush and maybe shut them down. Also we add the +missing sync() system call for the direct halt/reboot systemctl command. Then we +use the system halt as gfallback if poweroff fails for both the direct poweroff +systemctl command as well as for the systemd-shutdown utility. + +--- + Makefile.am | 2 + Makefile.in | 7 + src/core/shutdown.c | 8 - + src/shared/hdflush.c | 365 ++++++++++++++++++++++++++++++++++++++++++++++ + src/shared/hdflush.h | 25 +++ + src/systemctl/systemctl.c | 17 +- + 6 files changed, 416 insertions(+), 8 deletions(-) + +--- systemd-208/Makefile.am ++++ systemd-208/Makefile.am 2014-01-28 11:06:55.638238060 +0000 +@@ -680,6 +680,8 @@ libsystemd_shared_la_SOURCES = \ + src/shared/strbuf.h \ + src/shared/strxcpyx.c \ + src/shared/strxcpyx.h \ ++ src/shared/hdflush.c \ ++ src/shared/hdflush.h \ + src/shared/conf-parser.c \ + src/shared/conf-parser.h \ + src/shared/log.c \ +--- systemd-208/Makefile.in ++++ systemd-208/Makefile.in 2014-01-28 11:06:33.942246196 +0000 +@@ -1509,7 +1509,7 @@ am_libsystemd_shared_la_OBJECTS = src/sh + src/shared/hashmap.lo src/shared/set.lo src/shared/fdset.lo \ + src/shared/prioq.lo src/shared/sleep-config.lo \ + src/shared/strv.lo src/shared/env-util.lo src/shared/strbuf.lo \ +- src/shared/strxcpyx.lo src/shared/conf-parser.lo \ ++ src/shared/strxcpyx.lo src/shared/hdflush.lo src/shared/conf-parser.lo \ + src/shared/log.lo src/shared/ratelimit.lo \ + src/shared/exit-status.lo src/shared/utf8.lo \ + src/shared/pager.lo src/shared/socket-util.lo \ +@@ -4137,6 +4137,8 @@ libsystemd_shared_la_SOURCES = \ + src/shared/strbuf.h \ + src/shared/strxcpyx.c \ + src/shared/strxcpyx.h \ ++ src/shared/hdflush.c \ ++ src/shared/hdflush.h \ + src/shared/conf-parser.c \ + src/shared/conf-parser.h \ + src/shared/log.c \ +@@ -7073,6 +7075,8 @@ src/shared/strbuf.lo: src/shared/$(am__d + src/shared/$(DEPDIR)/$(am__dirstamp) + src/shared/strxcpyx.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) ++src/shared/hdflush.lo: src/shared/$(am__dirstamp) \ ++ src/shared/$(DEPDIR)/$(am__dirstamp) + src/shared/conf-parser.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) + src/shared/log.lo: src/shared/$(am__dirstamp) \ +@@ -9236,6 +9240,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/strbuf.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/strv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/strxcpyx.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/hdflush.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/time-dst.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/time-util.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/unit-name.Plo@am__quote@ +--- systemd-208/src/shared/hdflush.c ++++ systemd-208/src/shared/hdflush.c 2014-01-28 10:58:56.490735704 +0000 +@@ -0,0 +1,365 @@ ++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ ++ ++/*** ++ This file is part of systemd. ++ ++ Copyright 2014 Werner Fink ++ ++ systemd is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2.1 of the License, or ++ (at your option) any later version. ++ ++ systemd is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with systemd; If not, see . ++***/ ++ ++/* ++ * Find all disks on the system, list out IDE, unmanaged ATA disks, and ++ * USB sticks flush the cache of those and optional shut them down. ++ */ ++ ++#include ++#include ++#ifdef LIST_DEBUG ++# include ++#endif ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#ifdef WORDS_BIGENDIAN ++# include ++#endif ++ ++/* Used in flush_cache_ext(), compare with */ ++#define IDBYTES 512 ++#define MASK_EXT 0xE000 /* Bit 15 shall be zero, bit 14 shall be one, bit 13 flush cache ext */ ++#define TEST_EXT 0x6000 ++ ++/* Maybe set in list_disks() and used in do_standby_disk() */ ++#define DISK_IS_IDE 0x00000001 ++#define DISK_IS_SATA 0x00000002 ++#define DISK_EXTFLUSH 0x00000004 ++#define DISK_REMOVABLE 0x00000008 ++#define DISK_MANAGED 0x00000010 ++#define DISK_FLUSHONLY 0x00000020 ++ ++struct sysfs { ++ struct udev *udev; ++ struct udev_enumerate *num; ++ struct udev_list_entry *item; ++ char *devnode; ++ size_t size; ++}; ++ ++static int flush_cache_ext(const struct sysfs *sysfs); ++ ++static struct sysfs * open_sysfs(void) ++{ ++ static struct sysfs sysfs; ++ sysfs.udev = udev_new(); ++ if (!sysfs.udev) ++ goto err; ++ sysfs.num = udev_enumerate_new(sysfs.udev); ++ if (!sysfs.num) ++ goto err; ++ if (udev_enumerate_add_match_subsystem(sysfs.num, "block") < 0) ++ goto err; ++ if (udev_enumerate_add_match_sysname(sysfs.num, "sd?") < 0) ++ goto err; ++ if (udev_enumerate_add_match_sysname(sysfs.num, "hd?") < 0) ++ goto err; ++ if (udev_enumerate_scan_devices(sysfs.num) < 0) ++ goto err; ++ sysfs.item = udev_enumerate_get_list_entry(sysfs.num); ++ sysfs.devnode = NULL; ++ sysfs.size = 0; ++ return &sysfs; ++err: ++ if (sysfs.num) ++ udev_unref(sysfs.udev); ++ if (sysfs.udev) ++ udev_unref(sysfs.udev); ++ return NULL; ++} ++ ++static void close_sysfs(struct sysfs *sysfs) ++{ ++ if (sysfs->num) ++ udev_enumerate_unref(sysfs->num); ++ if (sysfs->udev) ++ udev_unref(sysfs->udev); ++ if (sysfs->devnode) ++ free(sysfs->devnode); ++ sysfs->devnode = NULL; ++} ++ ++ ++static char *list_disks(struct sysfs *sysfs, unsigned int* flags) ++{ ++ struct udev_device *device, *parent; ++ struct udev_list_entry *item; ++ const char *devnode; ++ char path[PATH_MAX]; ++ ++ device = NULL; ++next: ++ if (device) ++ udev_device_unref(device); ++ if (sysfs->devnode) ++ free(sysfs->devnode); ++ sysfs->devnode = NULL; ++ sysfs->size = 0; ++ *flags = 0; ++ ++ if (!sysfs->item) ++ goto empty; ++ item = sysfs->item; ++ sysfs->item = udev_list_entry_get_next(sysfs->item); ++ ++ if (!(device = udev_device_new_from_syspath(sysfs->udev, udev_list_entry_get_name(item)))) ++ goto out; ++ if (!(devnode = udev_device_get_devnode(device))) ++ goto out; ++ if (!(sysfs->devnode = strdup(devnode))) ++ goto out; ++ ++ path[0] = '\0'; ++ parent = udev_device_get_parent(device); ++ if (parent) { ++ const char *sysname, *devpath; ++ struct udev_device *disk; ++ const char *value; ++ int ret; ++ ++ sysname = udev_device_get_sysname(parent); ++ devpath = udev_device_get_devpath(parent); ++ ++ strcpy(path, "/sys"); ++ strcat(path, devpath); ++ strcat(path, "/scsi_disk/"); ++ strcat(path, sysname); ++ ++ disk = udev_device_new_from_syspath(sysfs->udev, path); ++ if (disk) { ++ value = udev_device_get_sysattr_value(disk, "manage_start_stop"); ++ udev_device_unref(disk); ++ ++ if (value && *value != '0') { ++ *flags = DISK_MANAGED; ++#ifdef LIST_DEBUG ++ goto next; /* Device managed by the kernel */ ++#endif ++ } ++ } ++ ++ value = udev_device_get_sysattr_value(device, "size"); ++ if (value && *value) ++ sysfs->size = (size_t)atoll(value); ++ ++ value = udev_device_get_sysattr_value(device, "removable"); ++ if (value && *value != '0') { ++ *flags |= DISK_REMOVABLE; ++ ++ if ((ret = flush_cache_ext(sysfs))) { ++ if (ret < 0) ++ goto next; ++ *flags |= DISK_EXTFLUSH; ++ } ++ goto out; /* Removable disk like USB stick */ ++ } ++ ++ value = udev_device_get_sysname(device); ++ if (value && *value == 'h') { ++ *flags |= DISK_IS_IDE; ++ ++ if ((ret = flush_cache_ext(sysfs))) { ++ if (ret < 0) ++ goto next; ++ *flags |= DISK_EXTFLUSH; ++ } ++ goto out; /* IDE disk found */ ++ } ++ ++ value = udev_device_get_sysattr_value(parent, "vendor"); ++ if (value && strncmp(value, "ATA", 3) == 0) { ++ *flags |= (DISK_IS_IDE|DISK_IS_SATA); ++ ++ if ((ret = flush_cache_ext(sysfs))) { ++ if (ret < 0) ++ goto next; ++ *flags |= DISK_EXTFLUSH; ++ } ++ goto out; /* SATA disk to shutdown */ ++ } ++ goto next; ++ } ++out: ++ udev_device_unref(device); ++empty: ++ return sysfs->devnode; ++} ++ ++/* ++ * Check IDE/(S)ATA hard disk identity for ++ * the FLUSH CACHE EXT bit set. ++ */ ++static int flush_cache_ext(const struct sysfs *sysfs) ++{ ++#ifndef WIN_IDENTIFY ++#define WIN_IDENTIFY 0xEC ++#endif ++ unsigned char args[4+IDBYTES]; ++ unsigned short *id = (unsigned short*)(&args[4]); ++ int fd = -1, ret = 0; ++ ++ if (sysfs->size < (1<<28)) ++ goto out; /* small disk */ ++ ++ if ((fd = open(sysfs->devnode, O_RDONLY|O_NONBLOCK|O_CLOEXEC)) < 0) ++ goto out; ++ ++ memset(&args[0], 0, sizeof(args)); ++ args[0] = WIN_IDENTIFY; ++ args[3] = 1; ++ if (ioctl(fd, HDIO_DRIVE_CMD, &args)) ++ goto out; ++#ifdef WORDS_BIGENDIAN ++# if 0 ++ { ++ const unsigned short *end = id + IDBYTES/2; ++ const unsigned short *from = id; ++ unsigned short *to = id; ++ ++ while (from < end) ++ *to++ = bswap_16(*from++); ++ } ++# else ++ id[83] = bswap_16(id[83]); ++# endif ++#endif ++ if ((id[83] & MASK_EXT) == TEST_EXT) ++ ret = 1; ++out: ++ if (fd >= 0) ++ close(fd); ++ return ret; ++} ++ ++/* ++ * Put an IDE/SCSI/SATA disk in standby mode. ++ * Code stolen from hdparm.c ++ */ ++static int do_standby_disk(struct sysfs *sysfs, unsigned int flags) ++{ ++#ifndef WIN_STANDBYNOW1 ++#define WIN_STANDBYNOW1 0xE0 ++#endif ++#ifndef WIN_STANDBYNOW2 ++#define WIN_STANDBYNOW2 0x94 ++#endif ++#ifndef WIN_FLUSH_CACHE_EXT ++#define WIN_FLUSH_CACHE_EXT 0xEA ++#endif ++#ifndef WIN_FLUSH_CACHE ++#define WIN_FLUSH_CACHE 0xE7 ++#endif ++ unsigned char flush1[4] = {WIN_FLUSH_CACHE_EXT,0,0,0}; ++ unsigned char flush2[4] = {WIN_FLUSH_CACHE,0,0,0}; ++ unsigned char stdby1[4] = {WIN_STANDBYNOW1,0,0,0}; ++ unsigned char stdby2[4] = {WIN_STANDBYNOW2,0,0,0}; ++ int fd, ret; ++ ++ if ((fd = open(sysfs->devnode, O_RDWR|O_NONBLOCK|O_CLOEXEC)) < 0) ++ return -1; ++ ++ switch (flags & DISK_EXTFLUSH) { ++ case DISK_EXTFLUSH: ++ if ((ret = ioctl(fd, HDIO_DRIVE_CMD, &flush1)) == 0) ++ break; ++ /* Extend flush rejected, try standard flush */ ++ default: ++ ret = ioctl(fd, HDIO_DRIVE_CMD, &flush2) && ++ ioctl(fd, BLKFLSBUF); ++ break; ++ } ++ ++ if ((flags & DISK_FLUSHONLY) == 0x0) { ++ ret = ioctl(fd, HDIO_DRIVE_CMD, &stdby1) && ++ ioctl(fd, HDIO_DRIVE_CMD, &stdby2); ++ } ++ ++ close(fd); ++ ++ if (ret) ++ return -1; ++ return 0; ++} ++ ++#ifdef LIST_DEBUG ++int main() ++{ ++ char *disk; ++ unsigned int flags; ++ struct sysfs *sysfs = open_sysfs(); ++ if (!sysfs) ++ goto err; ++ while ((disk = list_disks(sysfs, &flags))) ++ fprintf(stdout, "%s\n", sysfs->devnode); ++ close_sysfs(sysfs); ++err: ++ return 0; ++} ++#else ++/* ++ * List all disks and put them in standby mode. ++ * This has the side-effect of flushing the writecache, ++ * which is exactly what we want on poweroff. ++ */ ++void hddown(void) ++{ ++ struct sysfs *sysfs; ++ unsigned int flags; ++ char *disk; ++ ++ if (!(sysfs = open_sysfs())) ++ return; ++ ++ while ((disk = list_disks(sysfs, &flags))) ++ do_standby_disk(sysfs, flags); ++ ++ close_sysfs(sysfs); ++} ++ ++/* ++ * List all disks and cause them to flush their buffers. ++ */ ++void hdflush(void) ++{ ++ struct sysfs *sysfs; ++ unsigned int flags; ++ char *disk; ++ ++ if (!(sysfs = open_sysfs())) ++ return; ++ ++ while ((disk = list_disks(sysfs, &flags))) ++ do_standby_disk(sysfs, (flags|DISK_FLUSHONLY)); ++ ++ close_sysfs(sysfs); ++} ++#endif +--- systemd-208/src/shared/hdflush.h ++++ systemd-208/src/shared/hdflush.h 2014-01-28 11:00:08.286235696 +0000 +@@ -0,0 +1,25 @@ ++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ ++ ++#pragma once ++ ++/*** ++ This file is part of systemd. ++ ++ Copyright 2014 Werner Fink ++ ++ systemd is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2.1 of the License, or ++ (at your option) any later version. ++ ++ systemd is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with systemd; If not, see . ++***/ ++ ++void hdflush(void); ++void hddown(void); +--- systemd-208/src/core/shutdown.c ++++ systemd-208/src/core/shutdown.c 2014-01-28 11:14:15.722235591 +0000 +@@ -40,6 +40,7 @@ + #include "missing.h" + #include "log.h" + #include "fileio.h" ++#include "hdflush.h" + #include "umount.h" + #include "util.h" + #include "mkdir.h" +@@ -302,8 +303,13 @@ int main(int argc, char *argv[]) { + * on reboot(), but the file systems need to be synce'd + * explicitly in advance. So let's do this here, but not + * needlessly slow down containers. */ +- if (!in_container) ++ if (!in_container) { + sync(); ++ if (cmd == RB_POWER_OFF || cmd == RB_HALT_SYSTEM) ++ hddown(); ++ else ++ hdflush(); ++ } + + if (cmd == LINUX_REBOOT_CMD_KEXEC) { + +--- systemd-208/src/systemctl/systemctl.c ++++ systemd-208/src/systemctl/systemctl.c 2014-01-28 11:31:27.150735613 +0000 +@@ -87,6 +87,7 @@ static bool arg_no_pager = false; + static bool arg_no_wtmp = false; + static bool arg_no_wall = false; + static bool arg_no_reload = false; ++static bool arg_no_sync = false; + static bool arg_show_types = false; + static bool arg_ignore_inhibitors = false; + static bool arg_dry = false; +@@ -5272,6 +5273,7 @@ static int halt_parse_argv(int argc, cha + { "reboot", no_argument, NULL, ARG_REBOOT }, + { "force", no_argument, NULL, 'f' }, + { "wtmp-only", no_argument, NULL, 'w' }, ++ { "no-sync", no_argument, NULL, 'n' }, + { "no-wtmp", no_argument, NULL, 'd' }, + { "no-wall", no_argument, NULL, ARG_NO_WALL }, + { NULL, 0, NULL, 0 } +@@ -5324,10 +5326,13 @@ static int halt_parse_argv(int argc, cha + + case 'i': + case 'h': +- case 'n': + /* Compatibility nops */ + break; + ++ case 'n': ++ arg_no_sync = true; ++ break; ++ + case '?': + return -EINVAL; + +@@ -5981,14 +5986,14 @@ static int halt_now(enum action a) { + + switch (a) { + +- case ACTION_HALT: +- log_info("Halting."); +- reboot(RB_HALT_SYSTEM); +- return -errno; +- + case ACTION_POWEROFF: + log_info("Powering off."); + reboot(RB_POWER_OFF); ++ /* Fall through */ ++ ++ case ACTION_HALT: ++ log_info("Halting."); ++ reboot(RB_HALT_SYSTEM); + return -errno; + + case ACTION_REBOOT: diff --git a/0001-upstream-systemctl-halt-reboot-error-handling.patch b/0001-upstream-systemctl-halt-reboot-error-handling.patch new file mode 100644 index 00000000..110b866b --- /dev/null +++ b/0001-upstream-systemctl-halt-reboot-error-handling.patch @@ -0,0 +1,85 @@ +--- systemd-208/src/core/shutdown.c ++++ systemd-208/src/core/shutdown.c 2014-01-27 11:31:38.486235816 +0000 +@@ -329,6 +329,9 @@ int main(int argc, char *argv[]) { + + reboot(cmd); + ++ if (cmd == RB_POWER_OFF) ++ reboot(RB_HALT_SYSTEM); ++ + if (errno == EPERM && in_container) { + /* If we are in a container, and we lacked + * CAP_SYS_BOOT just exit, this will kill our + +--- systemd-208/src/systemctl/systemctl.c ++++ systemd-208/src/systemctl/systemctl.c 2014-01-27 11:05:18.298236035 +0000 +@@ -138,7 +138,7 @@ static bool arg_plain = false; + static bool private_bus = false; + + static int daemon_reload(DBusConnection *bus, char **args); +-static void halt_now(enum action a); ++static int halt_now(enum action a); + + static void pager_open_if_enabled(void) { + +@@ -2227,7 +2227,7 @@ static int start_special(DBusConnection + (a == ACTION_HALT || + a == ACTION_POWEROFF || + a == ACTION_REBOOT)) +- halt_now(a); ++ return halt_now(a); + + if (arg_force >= 1 && + (a == ACTION_HALT || +@@ -5973,7 +5973,7 @@ done: + return 0; + } + +-static _noreturn_ void halt_now(enum action a) { ++static int halt_now(enum action a) { + + /* Make sure C-A-D is handled by the kernel from this + * point on... */ +@@ -5984,23 +5984,22 @@ static _noreturn_ void halt_now(enum act + case ACTION_HALT: + log_info("Halting."); + reboot(RB_HALT_SYSTEM); +- break; ++ return -errno; + + case ACTION_POWEROFF: + log_info("Powering off."); + reboot(RB_POWER_OFF); +- break; ++ return -errno; + + case ACTION_REBOOT: + log_info("Rebooting."); + reboot(RB_AUTOBOOT); +- break; ++ return -errno; + + default: +- assert_not_reached("Unknown halt action."); ++ assert_not_reached("Unknown action."); ++ return -ENOSYS; + } +- +- assert_not_reached("Uh? This shouldn't happen."); + } + + static int halt_main(DBusConnection *bus) { +@@ -6069,9 +6068,10 @@ static int halt_main(DBusConnection *bus + if (arg_dry) + return 0; + +- halt_now(arg_action); +- /* We should never reach this. */ +- return -ENOSYS; ++ r = halt_now(arg_action); ++ log_error("Failed to reboot: %s", strerror(-r)); ++ ++ return r; + } + + static int runlevel_main(void) { diff --git a/systemd-mini.changes b/systemd-mini.changes index 60444215..85a6b035 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de + +- Add patch 0001-upstream-systemctl-halt-reboot-error-handling.patch + to be able to detect if the sysctl reboot() returns. +- Add patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch + A check for unmaintained disk like devices is added to be able to + flush and maybe shut them down. Also the missing sync() system + call is added for the direct halt/reboot systemctl command. Then + the system halt is used as fallback if poweroff fails for both + the direct poweroff systemctl command as well as for the + systemd-shutdown utility. + ------------------------------------------------------------------- Thu Jan 23 13:24:53 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index eb3c19c3..736ac29f 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -261,6 +261,10 @@ Patch82: analyze-fix-crash-in-command-line-parsing.patch Patch83: 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch # PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232) Patch84: make-emergency.service-conflict-with-syslog.socket.patch +# PATCH-FIX-UPSTREAM 0001-upstream-systemctl-halt-reboot-error-handling.patch +Patch85: 0001-upstream-systemctl-halt-reboot-error-handling.patch +# PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch +Patch86: 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -565,6 +569,8 @@ cp %{SOURCE7} m4/ %patch82 -p1 %patch83 -p1 %patch84 -p1 +%patch85 -p1 +%patch86 -p1 # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index 60444215..85a6b035 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de + +- Add patch 0001-upstream-systemctl-halt-reboot-error-handling.patch + to be able to detect if the sysctl reboot() returns. +- Add patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch + A check for unmaintained disk like devices is added to be able to + flush and maybe shut them down. Also the missing sync() system + call is added for the direct halt/reboot systemctl command. Then + the system halt is used as fallback if poweroff fails for both + the direct poweroff systemctl command as well as for the + systemd-shutdown utility. + ------------------------------------------------------------------- Thu Jan 23 13:24:53 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 370a2614..f2bab5c0 100644 --- a/systemd.spec +++ b/systemd.spec @@ -256,6 +256,10 @@ Patch82: analyze-fix-crash-in-command-line-parsing.patch Patch83: 0001-core-replace-OnFailureIsolate-setting-by-a-more-gene.patch # PATCH-FIX-OPENSUSE make-emergency.service-conflict-with-syslog.socket.patch (bnc#852232) Patch84: make-emergency.service-conflict-with-syslog.socket.patch +# PATCH-FIX-UPSTREAM 0001-upstream-systemctl-halt-reboot-error-handling.patch +Patch85: 0001-upstream-systemctl-halt-reboot-error-handling.patch +# PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch +Patch86: 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -560,6 +564,8 @@ cp %{SOURCE7} m4/ %patch82 -p1 %patch83 -p1 %patch84 -p1 +%patch85 -p1 +%patch86 -p1 # udev patches %patch1001 -p1 From b140810e1a0691bcc9b248febd988f5144fe006c8cdd14f9ab15e7d811ac7d2f Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 28 Jan 2014 12:59:05 +0000 Subject: [PATCH 17/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=498 --- support-powerfail-with-powerstatus.patch | 90 ------------------------ 1 file changed, 90 deletions(-) delete mode 100644 support-powerfail-with-powerstatus.patch diff --git a/support-powerfail-with-powerstatus.patch b/support-powerfail-with-powerstatus.patch deleted file mode 100644 index c59f6828..00000000 --- a/support-powerfail-with-powerstatus.patch +++ /dev/null @@ -1,90 +0,0 @@ ---- 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) From fb858fdc9056eb05893eef540a717c551fa40658de62520d7ca3a9609be58b7c Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 30 Jan 2014 08:30:23 +0000 Subject: [PATCH 18/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=499 --- 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch | 6 +++--- systemd-mini.changes | 6 ++++++ systemd.changes | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch b/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch index 0e0466f5..2d48b38a 100644 --- a/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch +++ b/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch @@ -227,7 +227,7 @@ systemctl command as well as for the systemd-shutdown utility. + + if (value && *value != '0') { + *flags = DISK_MANAGED; -+#ifdef LIST_DEBUG ++#ifndef LIST_DEBUG + goto next; /* Device managed by the kernel */ +#endif + } @@ -279,7 +279,7 @@ systemctl command as well as for the systemd-shutdown utility. +empty: + return sysfs->devnode; +} -+ ++#ifndef LIST_DEBUG +/* + * Check IDE/(S)ATA hard disk identity for + * the FLUSH CACHE EXT bit set. @@ -375,7 +375,7 @@ systemctl command as well as for the systemd-shutdown utility. + return -1; + return 0; +} -+ ++#endif +#ifdef LIST_DEBUG +int main() +{ diff --git a/systemd-mini.changes b/systemd-mini.changes index 85a6b035..0bafb0b2 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de + +- Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch + to skip already by the kernel managed devices + ------------------------------------------------------------------- Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de diff --git a/systemd.changes b/systemd.changes index 85a6b035..0bafb0b2 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de + +- Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch + to skip already by the kernel managed devices + ------------------------------------------------------------------- Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de From b6a8c3c72aebf19174652606b03072416c4780e24e27ab900938326c55bb906e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 30 Jan 2014 08:59:45 +0000 Subject: [PATCH 19/19] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=500 --- ...ew-KillMode-mixed-which-sends-SIGTER.patch | 225 ++++++++++++++++++ ...llMode-mixed-in-conjunction-with-PAM.patch | 62 +++++ ...o-always-go-through-both-SIGTERM-and.patch | 128 ++++++++++ systemd-mini.changes | 8 + systemd-mini.spec | 9 + systemd.changes | 8 + systemd.spec | 9 + 7 files changed, 449 insertions(+) create mode 100644 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch create mode 100644 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch create mode 100644 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch diff --git a/0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch b/0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch new file mode 100644 index 00000000..37291988 --- /dev/null +++ b/0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch @@ -0,0 +1,225 @@ +From 6fa7e1a944a2dbb89e794ad0f9da5d0fda5dc4a9 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 29 Jan 2014 13:38:55 +0100 +Subject: [PATCH 1/3] core: introduce new KillMode=mixed which sends SIGTERM + only to the main process, but SIGKILL to all daemon processes + +This should fix some race with terminating systemd --user, where the +system systemd instance might race against the user systemd instance +when sending SIGTERM. +--- + man/systemd.kill.xml | 77 +++++++++++++++++++++++++++++++++----------------- + src/core/kill.c | 1 + + src/core/kill.h | 1 + + src/core/unit.c | 3 +- + units/user@.service.in | 1 + + 5 files changed, 56 insertions(+), 27 deletions(-) + +diff --git a/man/systemd.kill.xml b/man/systemd.kill.xml +index 1b10fba..a4009aa 100644 +--- a/man/systemd.kill.xml ++++ b/man/systemd.kill.xml +@@ -44,39 +44,44 @@ + + + systemd.kill +- Kill environment configuration ++ Process killing procedure ++ configuration + + + + service.service, + socket.socket, + mount.mount, +- swap.swap ++ swap.swap, ++ scope.scope + + + + Description + + Unit configuration files for services, sockets, +- mount points and swap devices share a subset of +- configuration options which define the process killing +- parameters of spawned processes. ++ mount points, swap devices and scopes share a subset ++ of configuration options which define the ++ killing procedure of processes belonging to the unit. + + This man page lists the configuration options +- shared by these four unit types. See ++ shared by these five unit types. See + systemd.unit5 +- for the common options of all unit configuration +- files, and ++ for the common options shared by all unit ++ configuration files, and + systemd.service5, + systemd.socket5, +- systemd.swap5 +- and ++ systemd.swap5, + systemd.mount5 +- for more information on the specific unit +- configuration files. The execution specific ++ and ++ systemd.scope5 ++ for more information on the configuration file options ++ specific to each unit type. ++ ++ The kill procedure + configuration options are configured in the [Service], +- [Socket], [Mount], or [Swap] section, depending on the unit +- type. ++ [Socket], [Mount] or [Swap] section, depending on the ++ unit type. + + + +@@ -87,32 +92,40 @@ + + KillMode= + Specifies how +- processes of this service shall be ++ processes of this unit shall be + killed. One of + , + , ++ , + . + + If set to + , all + remaining processes in the control +- group of this unit will be terminated +- on unit stop (for services: after the ++ group of this unit will be killed on ++ unit stop (for services: after the + stop command is executed, as + configured with + ExecStop=). If set + to , only the + main process itself is killed. If set +- to , no process is ++ to the ++ SIGTERM signal ++ (see below) is sent to the main ++ process while the subsequent ++ SIGKILL signal ++ (see below) is sent to all remaining ++ processes of the unit's control ++ group. If set to ++ , no process is + killed. In this case only the stop +- command will be executed on unit +- stop, but no process be killed ++ command will be executed on unit stop, ++ but no process be killed + otherwise. Processes remaining alive + after stop are left in their control + group and the control group continues + to exist after stop unless it is +- empty. Defaults to +- . ++ empty. + + Processes will first be + terminated via +@@ -133,14 +146,24 @@ + option). See + kill2 + for more +- information. ++ information. ++ ++ Defaults to ++ . + + + + KillSignal= + Specifies which signal +- to use when killing a +- service. Defaults to SIGTERM. ++ to use when killing a service. This ++ controls the signal that is sent as ++ first step of shutting down a unit ++ (see above), and is usually followed ++ by SIGKILL (see ++ above and below). For a list of valid ++ signals, see ++ signal7. Defaults ++ to SIGTERM. + + + +@@ -184,7 +207,9 @@ + systemd.swap5, + systemd.mount5, + systemd.exec5, +- systemd.directives7 ++ systemd.directives7, ++ kill2, ++ signal7 + + + +diff --git a/src/core/kill.c b/src/core/kill.c +index ea947c2..4271346 100644 +--- a/src/core/kill.c ++++ b/src/core/kill.c +@@ -52,6 +52,7 @@ void kill_context_dump(KillContext *c, FILE *f, const char *prefix) { + static const char* const kill_mode_table[_KILL_MODE_MAX] = { + [KILL_CONTROL_GROUP] = "control-group", + [KILL_PROCESS] = "process", ++ [KILL_MIXED] = "mixed", + [KILL_NONE] = "none" + }; + +diff --git a/src/core/kill.h b/src/core/kill.h +index 41773f0..d5f125f 100644 +--- a/src/core/kill.h ++++ b/src/core/kill.h +@@ -32,6 +32,7 @@ typedef enum KillMode { + /* The kill mode is a property of a unit. */ + KILL_CONTROL_GROUP = 0, + KILL_PROCESS, ++ KILL_MIXED, + KILL_NONE, + _KILL_MODE_MAX, + _KILL_MODE_INVALID = -1 +diff --git a/src/core/unit.c b/src/core/unit.c +index 4b97710..0b10e57 100644 +--- a/src/core/unit.c ++++ b/src/core/unit.c +@@ -3007,7 +3007,7 @@ int unit_kill_context( + } + } + +- if (c->kill_mode == KILL_CONTROL_GROUP && u->cgroup_path) { ++ if ((c->kill_mode == KILL_CONTROL_GROUP || (c->kill_mode == KILL_MIXED && sigkill)) && u->cgroup_path) { + _cleanup_set_free_ Set *pid_set = NULL; + + /* Exclude the main/control pids from being killed via the cgroup */ +@@ -3021,6 +3021,7 @@ int unit_kill_context( + log_warning_unit(u->id, "Failed to kill control group: %s", strerror(-r)); + } else if (r > 0) { + wait_for_exit = true; ++ + if (c->send_sighup) { + set_free(pid_set); + +diff --git a/units/user@.service.in b/units/user@.service.in +index 3718a57..3bb8696 100644 +--- a/units/user@.service.in ++++ b/units/user@.service.in +@@ -17,3 +17,4 @@ Environment=SHELL=%s + ExecStart=-@rootlibexecdir@/systemd --user + Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket + Slice=user-%i.slice ++KillMode=mixed +-- +1.8.4 + diff --git a/0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch b/0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch new file mode 100644 index 00000000..76624f92 --- /dev/null +++ b/0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch @@ -0,0 +1,62 @@ +From 95d57e7b631a2d78b9b5d841125194052895470f Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 29 Jan 2014 13:49:54 +0100 +Subject: [PATCH 2/3] service: allow KillMode=mixed in conjunction with + PAMName= + +--- + src/core/service.c | 20 +++++++------------- + 1 file changed, 7 insertions(+), 13 deletions(-) + +diff --git a/src/core/service.c b/src/core/service.c +index 6792024..e7f03e1 100644 +--- a/src/core/service.c ++++ b/src/core/service.c +@@ -1105,37 +1105,31 @@ static int service_verify(Service *s) { + return 0; + + if (!s->exec_command[SERVICE_EXEC_START]) { +- log_error_unit(UNIT(s)->id, +- "%s lacks ExecStart setting. Refusing.", UNIT(s)->id); ++ log_error_unit(UNIT(s)->id, "%s lacks ExecStart setting. Refusing.", UNIT(s)->id); + return -EINVAL; + } + + if (s->type != SERVICE_ONESHOT && + s->exec_command[SERVICE_EXEC_START]->command_next) { +- log_error_unit(UNIT(s)->id, +- "%s has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.", UNIT(s)->id); ++ log_error_unit(UNIT(s)->id, "%s has more than one ExecStart setting, which is only allowed for Type=oneshot services. Refusing.", UNIT(s)->id); + return -EINVAL; + } + + if (s->type == SERVICE_ONESHOT && s->restart != SERVICE_RESTART_NO) { +- log_error_unit(UNIT(s)->id, +- "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id); ++ log_error_unit(UNIT(s)->id, "%s has Restart setting other than no, which isn't allowed for Type=oneshot services. Refusing.", UNIT(s)->id); + return -EINVAL; + } + + if (s->type == SERVICE_DBUS && !s->bus_name) { +- log_error_unit(UNIT(s)->id, +- "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id); ++ log_error_unit(UNIT(s)->id, "%s is of type D-Bus but no D-Bus service name has been specified. Refusing.", UNIT(s)->id); + return -EINVAL; + } + + if (s->bus_name && s->type != SERVICE_DBUS) +- log_warning_unit(UNIT(s)->id, +- "%s has a D-Bus service name specified, but is not of type dbus. Ignoring.", UNIT(s)->id); ++ log_warning_unit(UNIT(s)->id, "%s has a D-Bus service name specified, but is not of type dbus. Ignoring.", UNIT(s)->id); + +- if (s->exec_context.pam_name && s->kill_context.kill_mode != KILL_CONTROL_GROUP) { +- log_error_unit(UNIT(s)->id, +- "%s has PAM enabled. Kill mode must be set to 'control-group'. Refusing.", UNIT(s)->id); ++ if (s->exec_context.pam_name && !(s->kill_context.kill_mode == KILL_CONTROL_GROUP || s->kill_context.kill_mode == KILL_MIXED)) { ++ log_error_unit(UNIT(s)->id, "%s has PAM enabled. Kill mode must be set to 'control-group' or 'mixed'. Refusing.", UNIT(s)->id); + return -EINVAL; + } + +-- +1.8.4 + diff --git a/0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch b/0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch new file mode 100644 index 00000000..e6423f54 --- /dev/null +++ b/0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch @@ -0,0 +1,128 @@ +From b2ffdc8da536cd88a305f97517f356e2c5383a52 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Wed, 29 Jan 2014 14:58:04 +0100 +Subject: [PATCH 3/3] core: make sure to always go through both SIGTERM and + SIGKILL states of units + +Given that we now have KillMode=mixed where SIGTERM might kill a smaller +set than SIGKILL we need to make sure to always go explicitly throught +the SIGKILL state to get the right end result. +--- + src/core/mount.c | 8 +++++++- + src/core/scope.c | 4 +++- + src/core/service.c | 10 +++++++--- + src/core/socket.c | 6 +++++- + src/core/swap.c | 6 +++++- + 5 files changed, 27 insertions(+), 7 deletions(-) + +diff --git a/src/core/mount.c b/src/core/mount.c +index 3d46557..e418d09 100644 +--- a/src/core/mount.c ++++ b/src/core/mount.c +@@ -854,8 +854,14 @@ static void mount_enter_signal(Mount *m, MountState state, MountResult f) { + goto fail; + + mount_set_state(m, state); +- } else if (state == MOUNT_REMOUNTING_SIGTERM || state == MOUNT_REMOUNTING_SIGKILL) ++ } else if (state == MOUNT_REMOUNTING_SIGTERM) ++ mount_enter_signal(m, MOUNT_REMOUNTING_SIGKILL, MOUNT_SUCCESS); ++ else if (state == MOUNT_REMOUNTING_SIGKILL) + mount_enter_mounted(m, MOUNT_SUCCESS); ++ else if (state == MOUNT_MOUNTING_SIGTERM) ++ mount_enter_signal(m, MOUNT_MOUNTING_SIGKILL, MOUNT_SUCCESS); ++ else if (state == MOUNT_UNMOUNTING_SIGTERM) ++ mount_enter_signal(m, MOUNT_UNMOUNTING_SIGKILL, MOUNT_SUCCESS); + else + mount_enter_dead(m, MOUNT_SUCCESS); + +diff --git a/src/core/scope.c b/src/core/scope.c +index 50e5dba..3a5c95e 100644 +--- a/src/core/scope.c ++++ b/src/core/scope.c +@@ -221,7 +221,9 @@ static void scope_enter_signal(Scope *s, ScopeState state, ScopeResult f) { + } + + scope_set_state(s, state); +- } else ++ } else if (state == SCOPE_STOP_SIGTERM) ++ scope_enter_signal(s, SCOPE_STOP_SIGKILL, SCOPE_SUCCESS); ++ else + scope_enter_dead(s, SCOPE_SUCCESS); + + return; +diff --git a/src/core/service.c b/src/core/service.c +index e7f03e1..4b481c2 100644 +--- a/src/core/service.c ++++ b/src/core/service.c +@@ -1964,10 +1964,9 @@ static void service_enter_stop_post(Service *s, ServiceResult f) { + if (r < 0) + goto fail; + +- + service_set_state(s, SERVICE_STOP_POST); + } else +- service_enter_dead(s, SERVICE_SUCCESS, true); ++ service_enter_signal(s, SERVICE_FINAL_SIGTERM, SERVICE_SUCCESS); + + return; + +@@ -1993,6 +1992,7 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f + s->main_pid, + s->control_pid, + s->main_pid_alien); ++ + if (r < 0) + goto fail; + +@@ -2005,8 +2005,12 @@ static void service_enter_signal(Service *s, ServiceState state, ServiceResult f + } + + service_set_state(s, state); +- } else if (state == SERVICE_STOP_SIGTERM || state == SERVICE_STOP_SIGKILL) ++ } else if (state == SERVICE_STOP_SIGTERM) ++ service_enter_signal(s, SERVICE_STOP_SIGKILL, SERVICE_SUCCESS); ++ else if (state == SERVICE_STOP_SIGKILL) + service_enter_stop_post(s, SERVICE_SUCCESS); ++ else if (state == SERVICE_FINAL_SIGTERM) ++ service_enter_signal(s, SERVICE_FINAL_SIGKILL, SERVICE_SUCCESS); + else + service_enter_dead(s, SERVICE_SUCCESS, true); + +diff --git a/src/core/socket.c b/src/core/socket.c +index 6c0ac1a..831876f 100644 +--- a/src/core/socket.c ++++ b/src/core/socket.c +@@ -1298,8 +1298,12 @@ static void socket_enter_signal(Socket *s, SocketState state, SocketResult f) { + goto fail; + + socket_set_state(s, state); +- } else if (state == SOCKET_STOP_PRE_SIGTERM || state == SOCKET_STOP_PRE_SIGKILL) ++ } else if (state == SOCKET_STOP_PRE_SIGTERM) ++ socket_enter_signal(s, SOCKET_STOP_PRE_SIGKILL, SOCKET_SUCCESS); ++ else if (state == SOCKET_STOP_PRE_SIGKILL) + socket_enter_stop_post(s, SOCKET_SUCCESS); ++ else if (state == SOCKET_FINAL_SIGTERM) ++ socket_enter_signal(s, SOCKET_FINAL_SIGKILL, SOCKET_SUCCESS); + else + socket_enter_dead(s, SOCKET_SUCCESS); + +diff --git a/src/core/swap.c b/src/core/swap.c +index a68ab7c..8886fe8 100644 +--- a/src/core/swap.c ++++ b/src/core/swap.c +@@ -655,7 +655,11 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) { + goto fail; + + swap_set_state(s, state); +- } else ++ } else if (state == SWAP_ACTIVATING_SIGTERM) ++ swap_enter_signal(s, SWAP_ACTIVATING_SIGKILL, SWAP_SUCCESS); ++ else if (state == SWAP_DEACTIVATING_SIGTERM) ++ swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, SWAP_SUCCESS); ++ else + swap_enter_dead(s, SWAP_SUCCESS); + + return; +-- +1.8.4 + diff --git a/systemd-mini.changes b/systemd-mini.changes index 0bafb0b2..39675682 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -4,6 +4,14 @@ Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices +------------------------------------------------------------------- +Wed Jan 29 18:03:39 UTC 2014 - arvidjaar@gmail.com + +- fix timeout stopping user@.service (bnc#841544) + * 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch + * 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch + * 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch + ------------------------------------------------------------------- Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index 736ac29f..33ae73a6 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -265,6 +265,12 @@ Patch84: make-emergency.service-conflict-with-syslog.socket.patch Patch85: 0001-upstream-systemctl-halt-reboot-error-handling.patch # PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch Patch86: 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch +# PATCH-FIX-UPSTREAM 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch -- Allow sending SIGTERM to main PID only (bnc#841544) +Patch87: 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch +# PATCH-FIX-UPSTREAM 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch -- Allow using it with PAM enabled services (bnc#841544) +Patch88: 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch +# PATCH-FIX-UPSTREAM 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch -- Make sure final SIGKILL actually kills everything (bnc#841544) +Patch89: 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -571,6 +577,9 @@ cp %{SOURCE7} m4/ %patch84 -p1 %patch85 -p1 %patch86 -p1 +%patch87 -p1 +%patch88 -p1 +%patch89 -p1 # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index 0bafb0b2..39675682 100644 --- a/systemd.changes +++ b/systemd.changes @@ -4,6 +4,14 @@ Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices +------------------------------------------------------------------- +Wed Jan 29 18:03:39 UTC 2014 - arvidjaar@gmail.com + +- fix timeout stopping user@.service (bnc#841544) + * 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch + * 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch + * 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch + ------------------------------------------------------------------- Tue Jan 28 12:44:07 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index f2bab5c0..07823db2 100644 --- a/systemd.spec +++ b/systemd.spec @@ -260,6 +260,12 @@ Patch84: make-emergency.service-conflict-with-syslog.socket.patch Patch85: 0001-upstream-systemctl-halt-reboot-error-handling.patch # PATCH-FIX-SUSE 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch Patch86: 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch +# PATCH-FIX-UPSTREAM 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch -- Allow sending SIGTERM to main PID only (bnc#841544) +Patch87: 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch +# PATCH-FIX-UPSTREAM 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch -- Allow using it with PAM enabled services (bnc#841544) +Patch88: 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch +# PATCH-FIX-UPSTREAM 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch -- Make sure final SIGKILL actually kills everything (bnc#841544) +Patch89: 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -566,6 +572,9 @@ cp %{SOURCE7} m4/ %patch84 -p1 %patch85 -p1 %patch86 -p1 +%patch87 -p1 +%patch88 -p1 +%patch89 -p1 # udev patches %patch1001 -p1