aboutsummaryrefslogtreecommitdiff
path: root/src/rc/rc-applets.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/rc-applets.c')
-rw-r--r--src/rc/rc-applets.c14
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 ||