X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.c;h=8c115bd5482a29fdb4b972886a539ea8712362e0;hb=5430f7f2bc7330f3088b894166bf3524a067e3d8;hp=a0bcbdf06d0dd38c17e6328af5b0dbabc457dbe8;hpb=71ecc858fa91a686a050bee51804d43865ce1acc;p=elogind.git diff --git a/src/main.c b/src/main.c index a0bcbdf06..8c115bd54 100644 --- a/src/main.c +++ b/src/main.c @@ -6,16 +6,16 @@ Copyright 2010 Lennart Poettering systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Lesser General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ @@ -1343,6 +1343,12 @@ int main(int argc, char *argv[]) { unsetenv("HOME"); unsetenv("TERM"); + /* When we are invoked by a shell, these might be set, + * but make little sense to pass on */ + unsetenv("PWD"); + unsetenv("SHLVL"); + unsetenv("_"); + /* All other variables are left as is, so that clients * can still read them via /proc/1/environ */ } @@ -1625,6 +1631,11 @@ finish: assert(i <= ELEMENTSOF(args)); + /* Close and disarm the watchdog, so that the new + * instance can reinitialize it, but doesn't get + * rebooted while we do that */ + watchdog_close(true); + execv(args[0], (char* const*) args); log_error("Failed to reexecute: %m");