aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin English <austinenglish@gmail.com>2017-03-31 13:59:38 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-04-03 10:43:40 -0500
commit9eb669591e16c5ee0ca07babe058d0b7b2396077 (patch)
treeaed476d84a2b657087f918804b84fd2713c02316
parentinit.d/agetty.in: add -prefix keyword (diff)
downloadopenrc-9eb669591e16c5ee0ca07babe058d0b7b2396077.zip
openrc-9eb669591e16c5ee0ca07babe058d0b7b2396077.tar.gz
openrc-9eb669591e16c5ee0ca07babe058d0b7b2396077.tar.bz2
start-stop-daemon: warn if calling --start with --retry or --stop with --wait
This fixes #122
-rw-r--r--src/rc/start-stop-daemon.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index e9f9848..c88bc96 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -960,6 +960,9 @@ int main(int argc, char **argv)
if (redirect_stdout || redirect_stderr)
eerrorx("%s: --stdout and --stderr are only relevant"
" with --start", applet);
+ if (start_wait)
+ ewarn("using --wait with --stop has no effect,"
+ " use --retry instead");
} else {
if (!exec)
eerrorx("%s: nothing to start", applet);
@@ -1012,7 +1015,11 @@ int main(int argc, char **argv)
eerror("%s: %s does not exist", applet,
*exec_file ? exec_file : exec);
exit(EXIT_FAILURE);
+
}
+ if (start && retry)
+ ewarn("using --retry with --start has no effect,"
+ " use --wait instead");
/* If we don't have a pidfile we should check if it's interpreted
* or not. If it we, we need to pass the interpreter through