diff options
author | Franck Bui <fbui@suse.com> | 2016-11-14 17:37:40 +0100 |
---|---|---|
committer | Franck Bui <fbui@suse.com> | 2016-11-17 18:16:51 +0100 |
commit | c891efaf8a37aa13d91835fb8d194f6dd750a78f (patch) | |
tree | 1753c3cfdea38a982f8fe866dc11fddb1925ae42 /src/core/unit.c | |
parent | 63d77c9254aee1f965df5574c98c2fa83b50567c (diff) |
core: confirm_spawn: always accept units with same_pgrp set for now
For some reasons units remaining in the same process group as PID 1
(same_pgrp=true) fail to acquire the console even if it's not taken by anyone.
So always accept for units with same_pgrp set for now.
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 bba0f5d357..7b78ba9a9e 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -1515,6 +1515,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. |