]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/failure-action: Set job-modes to replace-irreversibly 2795/head
authorJoel Holdsworth <joel.holdsworth@vcatechnology.com>
Thu, 3 Mar 2016 20:40:01 +0000 (20:40 +0000)
committerJoel Holdsworth <joel.holdsworth@vcatechnology.com>
Fri, 4 Mar 2016 15:13:40 +0000 (15:13 +0000)
Up until now, the failure action has launched reboot.target and
poweroff.target with a less aggressive job mode than
"systemctl reboot" does. This has meant that the reboot and power-
off operations can stall if there are any conflicts with the target
during rebooting.

src/core/failure-action.c

index 39f5519ca1cd0ce83e089b533d3d7a12247848a0..bb2bc3f399fc5c4cc0db4f9f03c995fa7398e51f 100644 (file)
@@ -62,7 +62,8 @@ int failure_action(
                 log_and_status(m, "Rebooting as result of failure.");
 
                 update_reboot_param_file(reboot_arg);
-                (void) manager_add_job_by_name_and_warn(m, JOB_START, SPECIAL_REBOOT_TARGET, JOB_REPLACE, NULL);
+                (void) manager_add_job_by_name_and_warn(m, JOB_START, SPECIAL_REBOOT_TARGET,
+                                                        JOB_REPLACE_IRREVERSIBLY, NULL);
 
                 break;
 
@@ -89,7 +90,8 @@ int failure_action(
 
         case FAILURE_ACTION_POWEROFF:
                 log_and_status(m, "Powering off as result of failure.");
-                (void) manager_add_job_by_name_and_warn(m, JOB_START, SPECIAL_POWEROFF_TARGET, JOB_REPLACE, NULL);
+                (void) manager_add_job_by_name_and_warn(m, JOB_START, SPECIAL_POWEROFF_TARGET,
+                                                        JOB_REPLACE_IRREVERSIBLY, NULL);
                 break;
 
         case FAILURE_ACTION_POWEROFF_FORCE: