diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-11-18 11:08:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-18 11:08:06 +0100 |
commit | 2e6dbc0fcd45c152f15aed77cde4fd07957c150c (patch) | |
tree | f1110db4a4acf0dde5dc7f2eed58ad5eef47406b /src/core/unit.c | |
parent | 9a4550e2589bddb12cea93693b83211d805444e1 (diff) | |
parent | 539622bd8c0b425626cab8562c85a5b0e1dda502 (diff) |
Merge pull request #4538 from fbuihuu/confirm-spawn-fixes
Confirm spawn fixes/enhancements
Diffstat (limited to 'src/core/unit.c')
-rw-r--r-- | src/core/unit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/unit.c b/src/core/unit.c index fbb21e4985..cba6342eca 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1511,6 +1511,17 @@ int unit_start_limit_test(Unit *u) { return emergency_action(u->manager, u->start_limit_action, u->reboot_arg, "unit failed"); } +bool unit_shall_confirm_spawn(Unit *u) { + + if (manager_is_confirm_spawn_disabled(u->manager)) + return false; + + /* For some reasons units remaining in the same process group + * as PID 1 fail to acquire the console even if it's not used + * by any process. So skip the confirmation question for them. */ + return !unit_get_exec_context(u)->same_pgrp; +} + /* Errors: * -EBADR: This unit type does not support starting. * -EALREADY: Unit is already started. |