summaryrefslogtreecommitdiff
path: root/src/rc/runscript.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/runscript.c')
-rw-r--r--src/rc/runscript.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index f3f0517..1c60c24 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -596,8 +596,10 @@ svc_start_check(void)
fcntl(exclusive_fd, F_SETFD,
fcntl(exclusive_fd, F_GETFD, 0) | FD_CLOEXEC);
- if (state & RC_SERVICE_STARTED)
- ewarnx("WARNING: %s has already been started", applet);
+ if (state & RC_SERVICE_STARTED) {
+ ewarn("WARNING: %s has already been started", applet);
+ exit(EXIT_SUCCESS);
+ }
else if (state & RC_SERVICE_INACTIVE && !in_background)
ewarnx("WARNING: %s has already started, but is inactive",
applet);
@@ -845,8 +847,10 @@ svc_stop_check(RC_SERVICE *state)
fcntl(exclusive_fd, F_SETFD,
fcntl(exclusive_fd, F_GETFD, 0) | FD_CLOEXEC);
- if (*state & RC_SERVICE_STOPPED)
- ewarnx("WARNING: %s is already stopped", applet);
+ if (*state & RC_SERVICE_STOPPED) {
+ ewarn("WARNING: %s is already stopped", applet);
+ exit(EXIT_SUCCESS);
+ }
rc_service_mark(service, RC_SERVICE_STOPPING);
hook_out = RC_HOOK_SERVICE_STOP_OUT;