more test and vagrant for nginx checks

This commit is contained in:
Olof hagsand 2020-11-25 19:48:42 +01:00
parent 4f5b0178cc
commit f69daf773e
5 changed files with 38 additions and 27 deletions

View file

@ -161,7 +161,11 @@ pidfile_zapold(pid_t pid)
clicon_log(LOG_NOTICE, "Killing old daemon with pid: %d", pid);
killpg(pid, SIGTERM);
kill(pid, SIGTERM);
sleep(1); /* check again */
/* Need to sleep process properly and then check again */
if (usleep(100000) < 0){
clicon_err(OE_UNIX, errno, "usleep");
return -1;
}
if ((kill (pid, 0)) != 0 && errno == ESRCH) /* Nothing there */
;
else{ /* problem: couldnt kill it */