summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-20 17:39:13 +0000
committerRoy Marples <roy@marples.name>2007-12-20 17:39:13 +0000
commitcbea91cae5ab8ff97f4d534181c0b0ea7c743d38 (patch)
treedadf7fb380bffd9694f42e0c202ece10eaa5b1f9 /src
parente4575849bee50b0cd7bb6a18bc41071b1b05138a (diff)
downloadopenrc-cbea91cae5ab8ff97f4d534181c0b0ea7c743d38.tar.gz
openrc-cbea91cae5ab8ff97f4d534181c0b0ea7c743d38.tar.bz2
openrc-cbea91cae5ab8ff97f4d534181c0b0ea7c743d38.tar.xz
Remove rc-help.sh and replace with a man page for runscript 8.
Diffstat (limited to 'src')
-rw-r--r--src/runscript.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/runscript.c b/src/runscript.c
index aed254d..1385bb0 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -60,7 +60,6 @@
#include "rc-plugin.h"
#include "strlist.h"
-#define RCSCRIPT_HELP RC_LIBDIR "/sh/rc-help.sh"
#define SELINUX_LIB RC_LIBDIR "/runscript_selinux.so"
#define PREFIX_LOCK RC_SVCDIR "/prefix.lock"
@@ -1221,17 +1220,15 @@ int runscript (int argc, char **argv)
doneone = true;
- if (strcmp (optarg, "describe") == 0) {
+ if (strcmp (optarg, "describe") == 0 ||
+ strcmp (optarg, "help") == 0)
+ {
char *save = prefix;
eprefix (NULL);
prefix = NULL;
svc_exec (optarg, NULL);
eprefix (save);
- } else if (strcmp (optarg, "help") == 0) {
- execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
- eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
- applet, strerror (errno));
} else if (strcmp (optarg, "ineed") == 0 ||
strcmp (optarg, "iuse") == 0 ||
strcmp (optarg, "needsme") == 0 ||
@@ -1260,10 +1257,6 @@ int runscript (int argc, char **argv)
retval = (int) r;
if (retval & RC_SERVICE_STARTED)
retval = 0;
- } else if (strcmp (optarg, "help") == 0) {
- execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
- eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
- applet, strerror (errno));
} else {
if (geteuid () != 0)
eerrorx ("%s: root access required", applet);
@@ -1310,11 +1303,8 @@ int runscript (int argc, char **argv)
restart_services = NULL;
}
- if (! doneone) {
- execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, (char *) NULL);
- eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
- applet, strerror (errno));
- }
+ if (! doneone)
+ usage (EXIT_FAILURE);
}
return (retval);