SHA256
1
0
forked from pool/systemd
systemd/0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch

82 lines
2.7 KiB
Diff
Raw Normal View History

Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
---
systemd-209/src/core/shutdown.c | 4 ++++
systemd-209/src/systemctl/systemctl.c | 22 +++++++++++++++-------
2 files changed, 19 insertions(+), 7 deletions(-)
Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
--- systemd-209/src/core/shutdown.c
+++ systemd-209/src/core/shutdown.c 2014-02-28 11:17:22.000000000 +0000
@@ -449,6 +449,10 @@ int main(int argc, char *argv[]) {
Accepting request 225408 from Base:System - Add or port upstream bugfix patches: 0001-Fix-systemd-stdio-bridge-symlink.patch 0002-execute-free-directory-path-if-we-fail-to-remove-it-.patch 0003-Do-not-print-invalid-UTF-8-in-error-messages.patch 0004-man-document-missing-options-of-systemd-run.patch 0005-systemd-run-add-some-extra-safety-checks.patch 0006-journal-assume-that-next-entry-is-after-previous-ent.patch 0007-journal-forget-file-after-encountering-an-error.patch 0008-core-correctly-unregister-PIDs-from-PID-hashtables.patch 0009-logind-fix-reference-to-systemd-user-sessions.servic.patch 0010-man-update-link-to-LSB.patch 0011-man-systemd-bootchart-fix-spacing-in-command.patch 0012-man-add-missing-comma.patch 0013-units-Do-not-unescape-instance-name-in-systemd-backl.patch - Add linker scripts as place holder of the old systemd shared libraries now all included in libsystemd.so (bnc#867128) - Make patch 1006-udev-always-rename-network.patch work again and add it again. - address missing owner functionality in systemd-tmpfiles (fate#314974) 1022-systemd-tmpfiles-ownerkeep.patch - Generate the bash completion files on the fly for the case of not having the package bash-completion around - Add or port upstream bugfix patches: 0001-nspawn-fix-detection-of-missing-proc-self-loginuid.patch 0002-cdrom_id-use-the-old-MMC-fallback.patch 0003-journalctl-refuse-extra-arguments-with-verify-and-si.patch OBS-URL: https://build.opensuse.org/request/show/225408 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=177
2014-03-11 09:24:11 +01:00
}
reboot(cmd);
+
+ if (cmd == (int)RB_POWER_OFF)
Accepting request 225408 from Base:System - Add or port upstream bugfix patches: 0001-Fix-systemd-stdio-bridge-symlink.patch 0002-execute-free-directory-path-if-we-fail-to-remove-it-.patch 0003-Do-not-print-invalid-UTF-8-in-error-messages.patch 0004-man-document-missing-options-of-systemd-run.patch 0005-systemd-run-add-some-extra-safety-checks.patch 0006-journal-assume-that-next-entry-is-after-previous-ent.patch 0007-journal-forget-file-after-encountering-an-error.patch 0008-core-correctly-unregister-PIDs-from-PID-hashtables.patch 0009-logind-fix-reference-to-systemd-user-sessions.servic.patch 0010-man-update-link-to-LSB.patch 0011-man-systemd-bootchart-fix-spacing-in-command.patch 0012-man-add-missing-comma.patch 0013-units-Do-not-unescape-instance-name-in-systemd-backl.patch - Add linker scripts as place holder of the old systemd shared libraries now all included in libsystemd.so (bnc#867128) - Make patch 1006-udev-always-rename-network.patch work again and add it again. - address missing owner functionality in systemd-tmpfiles (fate#314974) 1022-systemd-tmpfiles-ownerkeep.patch - Generate the bash completion files on the fly for the case of not having the package bash-completion around - Add or port upstream bugfix patches: 0001-nspawn-fix-detection-of-missing-proc-self-loginuid.patch 0002-cdrom_id-use-the-old-MMC-fallback.patch 0003-journalctl-refuse-extra-arguments-with-verify-and-si.patch OBS-URL: https://build.opensuse.org/request/show/225408 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=177
2014-03-11 09:24:11 +01:00
+ 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-209/src/systemctl/systemctl.c
+++ systemd-209/src/systemctl/systemctl.c 2014-02-28 11:19:35.000000000 +0000
@@ -93,6 +93,7 @@ static bool arg_no_pager = false;
Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
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;
@@ -5578,6 +5579,7 @@ static int halt_parse_argv(int argc, cha
Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
{ "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 },
Accepting request 225408 from Base:System - Add or port upstream bugfix patches: 0001-Fix-systemd-stdio-bridge-symlink.patch 0002-execute-free-directory-path-if-we-fail-to-remove-it-.patch 0003-Do-not-print-invalid-UTF-8-in-error-messages.patch 0004-man-document-missing-options-of-systemd-run.patch 0005-systemd-run-add-some-extra-safety-checks.patch 0006-journal-assume-that-next-entry-is-after-previous-ent.patch 0007-journal-forget-file-after-encountering-an-error.patch 0008-core-correctly-unregister-PIDs-from-PID-hashtables.patch 0009-logind-fix-reference-to-systemd-user-sessions.servic.patch 0010-man-update-link-to-LSB.patch 0011-man-systemd-bootchart-fix-spacing-in-command.patch 0012-man-add-missing-comma.patch 0013-units-Do-not-unescape-instance-name-in-systemd-backl.patch - Add linker scripts as place holder of the old systemd shared libraries now all included in libsystemd.so (bnc#867128) - Make patch 1006-udev-always-rename-network.patch work again and add it again. - address missing owner functionality in systemd-tmpfiles (fate#314974) 1022-systemd-tmpfiles-ownerkeep.patch - Generate the bash completion files on the fly for the case of not having the package bash-completion around - Add or port upstream bugfix patches: 0001-nspawn-fix-detection-of-missing-proc-self-loginuid.patch 0002-cdrom_id-use-the-old-MMC-fallback.patch 0003-journalctl-refuse-extra-arguments-with-verify-and-si.patch OBS-URL: https://build.opensuse.org/request/show/225408 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=177
2014-03-11 09:24:11 +01:00
{}
@@ -5629,10 +5631,13 @@ static int halt_parse_argv(int argc, cha
Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
case 'i':
case 'h':
- case 'n':
/* Compatibility nops */
break;
+ case 'n':
+ arg_no_sync = true;
+ break;
+
case '?':
return -EINVAL;
@@ -6274,20 +6279,23 @@ done:
static int halt_now(enum action a) {
-/* Make sure C-A-D is handled by the kernel from this
Accepting request 225408 from Base:System - Add or port upstream bugfix patches: 0001-Fix-systemd-stdio-bridge-symlink.patch 0002-execute-free-directory-path-if-we-fail-to-remove-it-.patch 0003-Do-not-print-invalid-UTF-8-in-error-messages.patch 0004-man-document-missing-options-of-systemd-run.patch 0005-systemd-run-add-some-extra-safety-checks.patch 0006-journal-assume-that-next-entry-is-after-previous-ent.patch 0007-journal-forget-file-after-encountering-an-error.patch 0008-core-correctly-unregister-PIDs-from-PID-hashtables.patch 0009-logind-fix-reference-to-systemd-user-sessions.servic.patch 0010-man-update-link-to-LSB.patch 0011-man-systemd-bootchart-fix-spacing-in-command.patch 0012-man-add-missing-comma.patch 0013-units-Do-not-unescape-instance-name-in-systemd-backl.patch - Add linker scripts as place holder of the old systemd shared libraries now all included in libsystemd.so (bnc#867128) - Make patch 1006-udev-always-rename-network.patch work again and add it again. - address missing owner functionality in systemd-tmpfiles (fate#314974) 1022-systemd-tmpfiles-ownerkeep.patch - Generate the bash completion files on the fly for the case of not having the package bash-completion around - Add or port upstream bugfix patches: 0001-nspawn-fix-detection-of-missing-proc-self-loginuid.patch 0002-cdrom_id-use-the-old-MMC-fallback.patch 0003-journalctl-refuse-extra-arguments-with-verify-and-si.patch OBS-URL: https://build.opensuse.org/request/show/225408 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=177
2014-03-11 09:24:11 +01:00
+ if (!arg_no_sync)
+ sync();
+
+ /* Make sure C-A-D is handled by the kernel from this
* point on... */
reboot(RB_ENABLE_CAD);
switch (a) {
Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
- case ACTION_HALT:
- log_info("Halting.");
- reboot(RB_HALT_SYSTEM);
- return -errno;
-
Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
case ACTION_POWEROFF:
log_info("Powering off.");
reboot(RB_POWER_OFF);
+ /* Fall through */
+
Accepting request 215598 from Base:System - Change patch 0001-add-hdflush-for-reboot-or-hddown-for-poweroff.patch to skip already by the kernel managed devices - 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 - 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. - Make systemd-mini build - Make requires bash-completion a recommends - 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) - 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 OBS-URL: https://build.opensuse.org/request/show/215598 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=173
2014-01-31 13:36:06 +01:00
+ case ACTION_HALT:
+ log_info("Halting.");
+ reboot(RB_HALT_SYSTEM);
return -errno;
Accepting request 225408 from Base:System - Add or port upstream bugfix patches: 0001-Fix-systemd-stdio-bridge-symlink.patch 0002-execute-free-directory-path-if-we-fail-to-remove-it-.patch 0003-Do-not-print-invalid-UTF-8-in-error-messages.patch 0004-man-document-missing-options-of-systemd-run.patch 0005-systemd-run-add-some-extra-safety-checks.patch 0006-journal-assume-that-next-entry-is-after-previous-ent.patch 0007-journal-forget-file-after-encountering-an-error.patch 0008-core-correctly-unregister-PIDs-from-PID-hashtables.patch 0009-logind-fix-reference-to-systemd-user-sessions.servic.patch 0010-man-update-link-to-LSB.patch 0011-man-systemd-bootchart-fix-spacing-in-command.patch 0012-man-add-missing-comma.patch 0013-units-Do-not-unescape-instance-name-in-systemd-backl.patch - Add linker scripts as place holder of the old systemd shared libraries now all included in libsystemd.so (bnc#867128) - Make patch 1006-udev-always-rename-network.patch work again and add it again. - address missing owner functionality in systemd-tmpfiles (fate#314974) 1022-systemd-tmpfiles-ownerkeep.patch - Generate the bash completion files on the fly for the case of not having the package bash-completion around - Add or port upstream bugfix patches: 0001-nspawn-fix-detection-of-missing-proc-self-loginuid.patch 0002-cdrom_id-use-the-old-MMC-fallback.patch 0003-journalctl-refuse-extra-arguments-with-verify-and-si.patch OBS-URL: https://build.opensuse.org/request/show/225408 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=177
2014-03-11 09:24:11 +01:00
case ACTION_REBOOT: {