Merge pull request #4635 from eworm-de/resolved

resolved: unlink /run/systemd/resolve/resolv.conf upon exit
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-11-10 18:31:46 -05:00 committed by GitHub
commit a1ef6bd1e3
2 changed files with 5 additions and 1 deletions

View file

@ -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;

View file

@ -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...");