diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-11-10 18:31:46 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-10 18:31:46 -0500 |
commit | a1ef6bd1e3e690908f886db0cb639b0015c1b704 (patch) | |
tree | 89298a89e71e959e018a9720ebcf8b628c1ef6cf | |
parent | 6d24947638dd3922c12a3f33eecf54cb8e51b908 (diff) | |
parent | 01e1bb7f9c5adfb3afbb15f666c363b85ace9e31 (diff) |
Merge pull request #4635 from eworm-de/resolved
resolved: unlink /run/systemd/resolve/resolv.conf upon exit
-rw-r--r-- | src/resolve/resolved-resolv-conf.c | 2 | ||||
-rw-r--r-- | src/resolve/resolved.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/resolve/resolved-resolv-conf.c b/src/resolve/resolved-resolv-conf.c index 801014caf5..13f08f8a6c 100644 --- a/src/resolve/resolved-resolv-conf.c +++ b/src/resolve/resolved-resolv-conf.c @@ -60,7 +60,7 @@ int manager_read_resolv_conf(Manager *m) { return 0; /* Is it symlinked to our own file? */ - if (stat("/run/systemd/resolve/resolv.conf", &own) >= 0 && + if (stat(PRIVATE_RESOLV_CONF, &own) >= 0 && st.st_dev == own.st_dev && st.st_ino == own.st_ino) return 0; diff --git a/src/resolve/resolved.c b/src/resolve/resolved.c index deb75f9ae5..8d5a5c6b79 100644 --- a/src/resolve/resolved.c +++ b/src/resolve/resolved.c @@ -112,6 +112,10 @@ int main(int argc, char *argv[]) { sd_event_get_exit_code(m->event, &r); finish: + /* systemd-nspawn checks for private resov.conf to decide whether + or not to mount it into the container. So just delete it. */ + (void) unlink(PRIVATE_RESOLV_CONF); + sd_notify(false, "STOPPING=1\n" "STATUS=Shutting down..."); |