diff options
author | Roy Marples <roy@marples.name> | 2008-03-19 17:11:50 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-03-19 17:11:50 +0000 |
commit | d9ec62b22a8ccfebda4af34d8319b33a8a5e3bbb (patch) | |
tree | 1ee06a122011bd5347ed1dac292e1408178cceb0 /src/rc/rc-applets.c | |
parent | 089caec283e1e1b39767abf9cb355f47ee6daca6 (diff) |
Add rc-service and update all softlevel refs to runlevel.
Diffstat (limited to 'src/rc/rc-applets.c')
-rw-r--r-- | src/rc/rc-applets.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rc/rc-applets.c b/src/rc/rc-applets.c index 96b392d8..821832cd 100644 --- a/src/rc/rc-applets.c +++ b/src/rc/rc-applets.c @@ -362,6 +362,18 @@ static int do_shell_var(int argc, char **argv) return EXIT_SUCCESS; } +static int rc_service(_unused int argc, char **argv) +{ + char *service = rc_service_resolve(argv[1]); + + if (!service) + eerrorx("%s: service `%s' does not exist", applet, optarg); + + *++argv = service; + execv(*argv, argv); + eerrorx("%s: %s", applet, strerror(errno)); + /* NOTREACHED */ +} void run_applets(int argc, char **argv) { @@ -377,6 +389,8 @@ void run_applets(int argc, char **argv) exit(mountinfo(argc, argv)); else if (strcmp(applet, "rc-depend") == 0) exit(rc_depend(argc, argv)); + else if (strcmp(applet, "rc-service") == 0) + exit(rc_service(argc, argv)); else if (strcmp(applet, "rc-status") == 0) exit(rc_status(argc, argv)); else if (strcmp(applet, "rc-update") == 0 || |