summaryrefslogtreecommitdiffstats
path: root/loader2/loader.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-06-21 22:40:03 +0000
committerJeremy Katz <katzj@redhat.com>2004-06-21 22:40:03 +0000
commit3c60d32a1b5bc689e60a4d4aa325dc2bd1d8ceeb (patch)
treed298f63e3517030143c86ea4a449f1e2b9db290e /loader2/loader.c
parent33bf9726e7baa89b15f400cc44802e6deb69128e (diff)
downloadanaconda-3c60d32a1b5bc689e60a4d4aa325dc2bd1d8ceeb.tar.gz
anaconda-3c60d32a1b5bc689e60a4d4aa325dc2bd1d8ceeb.tar.xz
anaconda-3c60d32a1b5bc689e60a4d4aa325dc2bd1d8ceeb.zip
kickstart commands to control doing reboot/poweroff/halt at the end of an
install (#116414)
Diffstat (limited to 'loader2/loader.c')
-rw-r--r--loader2/loader.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/loader2/loader.c b/loader2/loader.c
index a29fcf86b..33d1657ed 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -574,8 +574,6 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData,
loaderData->wepkey = strdup(argv[i] + 7);
else if (!strncasecmp(argv[i], "linksleep=", 10))
num_link_checks = atoi(argv[i] + 10);
- else if (!strncasecmp(argv[i], "allowcddma", 10))
- flags |= LOADER_FLAGS_ENABLECDDMA;
else if (!strncasecmp(argv[i], "selinux=0", 9))
flags &= ~LOADER_FLAGS_SELINUX;
else if (!strncasecmp(argv[i], "selinux", 7))
@@ -1501,6 +1499,18 @@ int main(int argc, char ** argv) {
else
rc = 0;
+ if ((rc == 0) && (FL_POWEROFF(flags) || FL_HALT(flags))) {
+ if (!(pid = fork())) {
+ char * cmd = (FL_POWEROFF(flags) ? strdup("/sbin/poweroff") :
+ strdup("/sbin/halt"));
+ execl(cmd, cmd, NULL);
+ fprintf(stderr, "exec of poweroff failed: %s",
+ strerror(errno));
+ exit(1);
+ }
+ waitpid(pid, &status, 0);
+ }
+
#if defined(__s390__) || defined(__s390x__)
/* FIXME: we have to send a signal to linuxrc on s390 so that shutdown
* can happen. this is ugly */