diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-08-08 15:27:49 +0200 |
---|---|---|
committer | Sven Eden <sven.eden@prydeworx.com> | 2018-10-29 10:18:38 +0100 |
commit | 675752d11fd2fd1708d42a90b618a9556688a20a (patch) | |
tree | 315c0c3c3e92c901cb8d493e74607593b57a5af1 /src/login/logind-dbus.c | |
parent | a6538e8d3030067b01ae436c59d7fc70559a40ac (diff) |
logind: add a RequiresMountsFor= dependency from the session scope unit to the home directory of the user
This is useful so that during shutdown scope units are always terminated
before the mounts necessary for the home directory.
(Ideally we'd also add a similar dependency from the user@.service
instance to the home directory, but this isn't as easy as that service
is defined statically and not dynamically, and hence not easy to modify
dynamically, in particular when it comes to deps)
(cherry picked from commit d5ac9d060267820aabdf9af509a54a1830b27b7d)
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r-- | src/login/logind-dbus.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 98228c74b..872bcf881 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -3110,6 +3110,7 @@ int manager_start_scope( const char *description, char **wants, char **after, + const char *requires_mounts_for, sd_bus_message *more_properties, sd_bus_error *error, char **job) { @@ -3165,6 +3166,12 @@ int manager_start_scope( return r; } + if (!empty_or_root(requires_mounts_for)) { + r = sd_bus_message_append(m, "(sv)", "RequiresMountsFor", "as", 1, requires_mounts_for); + if (r < 0) + return r; + } + /* Make sure that the session shells are terminated with SIGHUP since bash and friends tend to ignore * SIGTERM */ r = sd_bus_message_append(m, "(sv)", "SendSIGHUP", "b", true); |