Create a pidfile even in the case where ndhc never backgrounds.
This commit is contained in:
parent
ac6f60c4fe
commit
0b1a3b4c14
@ -564,6 +564,14 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
log_line("ndhc client " VERSION " started.");
|
log_line("ndhc client " VERSION " started.");
|
||||||
|
|
||||||
|
if (client_config.foreground && !client_config.background_if_no_lease) {
|
||||||
|
if (file_exists(pidfile, "w") == -1) {
|
||||||
|
log_line("FATAL - cannot open pidfile for write!");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
write_pid(pidfile);
|
||||||
|
}
|
||||||
|
|
||||||
if (read_interface(client_config.interface, &client_config.ifindex,
|
if (read_interface(client_config.interface, &client_config.ifindex,
|
||||||
NULL, client_config.arp) < 0)
|
NULL, client_config.arp) < 0)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
Loading…
Reference in New Issue
Block a user