diff options
Diffstat (limited to 'usr.sbin/sysinstall/system.c')
-rw-r--r-- | usr.sbin/sysinstall/system.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index ce1aa4b61b2ac..91ea2b21782bd 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -59,13 +59,20 @@ static int intr_restart(dialogMenuItem *self) { int ret, fd, fdmax; + char *arg; mediaClose(); free_variables(); fdmax = getdtablesize(); for (fd = 3; fd < fdmax; fd++) close(fd); - ret = execl(StartName, StartName, "-restart", (char *)NULL); + + if (RunningAsInit) + arg = "-restart -fakeInit"; + else + arg = "-restart"; + + ret = execl(StartName, StartName, arg, NULL); msgDebug("execl failed (%s)\n", strerror(errno)); /* NOTREACHED */ return -1; @@ -148,11 +155,10 @@ systemInitialize(int argc, char **argv) variable_set2(VAR_DEBUG, "YES", 0); /* Are we running as init? */ - if (getpid() == 1) { + if (RunningAsInit) { struct ufs_args ufs_args; int fd; - RunningAsInit = 1; setsid(); close(0); fd = open("/dev/ttyv0", O_RDWR); |