Exit with failure if "--stop" fails. Also give the daemon a couple more seconds to clean up.

This commit is contained in:
casey langen 2018-02-01 19:13:21 -08:00
parent 27d4696971
commit e44d24e8c8

View File

@ -148,7 +148,7 @@ static void stopDaemon() {
kill(pid, SIGTERM);
int count = 0;
bool dead = false;
while (!dead && count++ < 5) { /* try for 5 seconds */
while (!dead && count++ < 7) { /* try for 7 seconds */
if (kill(pid, 0) == 0) {
std::cout << ".";
std::cout.flush();
@ -159,6 +159,9 @@ static void stopDaemon() {
}
}
std::cout << (dead ? " success" : " failed") << "\n\n";
if (!dead) {
exit(EXIT_FAILURE);
}
}
}