Drop the pid file after we call the final daemon call. w/o -n would
give the wrong pid. Submitted by: ru and Lukas Ertl PR: 54113
This commit is contained in:
parent
b215f4334a
commit
fd6a8f23ef
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117246
@ -596,6 +596,7 @@ event_loop(void)
|
|||||||
if (Dflag)
|
if (Dflag)
|
||||||
fprintf(stderr, "Calling daemon\n");
|
fprintf(stderr, "Calling daemon\n");
|
||||||
daemon(0, 0);
|
daemon(0, 0);
|
||||||
|
cfg.drop_pidfile();
|
||||||
once++;
|
once++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -743,9 +744,10 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cfg.parse();
|
cfg.parse();
|
||||||
if (!dflag && nflag)
|
if (!dflag && nflag) {
|
||||||
daemon(0, 0);
|
daemon(0, 0);
|
||||||
cfg.drop_pidfile();
|
cfg.drop_pidfile();
|
||||||
|
}
|
||||||
signal(SIGHUP, gensighand);
|
signal(SIGHUP, gensighand);
|
||||||
signal(SIGINT, gensighand);
|
signal(SIGINT, gensighand);
|
||||||
signal(SIGTERM, gensighand);
|
signal(SIGTERM, gensighand);
|
||||||
|
Loading…
Reference in New Issue
Block a user