start-stop-daemon: do not use do_stop to verify whether a daemon is running
X-Gentoo-Bug: 636574 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=636574
This commit is contained in:
parent
a3d1c8a0e7
commit
90d9ea656f
@ -279,6 +279,7 @@ int main(int argc, char **argv)
|
|||||||
int stdout_fd;
|
int stdout_fd;
|
||||||
int stderr_fd;
|
int stderr_fd;
|
||||||
pid_t pid, spid;
|
pid_t pid, spid;
|
||||||
|
RC_PIDLIST *pids;
|
||||||
int i;
|
int i;
|
||||||
char *svcname = getenv("RC_SVCNAME");
|
char *svcname = getenv("RC_SVCNAME");
|
||||||
RC_STRINGLIST *env_list;
|
RC_STRINGLIST *env_list;
|
||||||
@ -683,10 +684,14 @@ int main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
pid = 0;
|
pid = 0;
|
||||||
|
|
||||||
if (do_stop(applet, exec, (const char * const *)margv, pid, uid,
|
if (pid)
|
||||||
0, test, false) > 0)
|
pids = rc_find_pids(NULL, NULL, 0, pid);
|
||||||
|
else
|
||||||
|
pids = rc_find_pids(exec, (const char * const *) argv, uid, 0);
|
||||||
|
if (pids)
|
||||||
eerrorx("%s: %s is already running", applet, exec);
|
eerrorx("%s: %s is already running", applet, exec);
|
||||||
|
|
||||||
|
free(pids);
|
||||||
if (test) {
|
if (test) {
|
||||||
if (rc_yesno(getenv("EINFO_QUIET")))
|
if (rc_yesno(getenv("EINFO_QUIET")))
|
||||||
exit (EXIT_SUCCESS);
|
exit (EXIT_SUCCESS);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user