-.\" $OpenBSD: dhclient.8,v 1.24 2013/08/22 19:15:41 jmc Exp $
+.\" $OpenBSD: dhclient.8,v 1.25 2014/04/20 21:25:07 krw Exp $
.\"
.\" Copyright (c) 1997 The Internet Software Consortium.
.\" All rights reserved.
.\" Enterprises. To learn more about the Internet Software Consortium,
.\" see ``http://www.isc.org/isc''. To learn more about Vixie
.\" Enterprises, see ``http://www.vix.com''.
-.Dd $Mdocdate: August 22 2013 $
+.Dd $Mdocdate: April 20 2014 $
.Dt DHCLIENT 8
.Os
.Sh NAME
and
.Dq effective ,
to the specified file.
-The offered block will contain the lease offered by the DHCP server;
-the effective block will contain the modified lease used to configure the
-interface.
+.Dq offered
+will be the lease offered by the DHCP server;
+.Dq effective
+will be the modified lease bound to the interface.
+.Ar file
+will be truncated when a lease is no longer bound to the interface or the
+link goes down.
.It Fl l Ar file
Specify an alternate location to
.Pa /var/db/dhclient.leases. Ns Aq Ar IFNAME
-/* $OpenBSD: dhclient.c,v 1.297 2014/04/17 13:46:48 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.298 2014/04/20 21:25:07 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
client->state = S_REBOOTING;
state_reboot();
} else {
+ /* Let monitoring programs see link loss. */
+ write_file(path_option_db,
+ O_WRONLY | O_CREAT | O_TRUNC | O_SYNC |
+ O_EXLOCK | O_NOFOLLOW, S_IRUSR | S_IWUSR |
+ S_IRGRP, 0, 0, "", 0);
/* No need to wait for anything but link. */
cancel_timeout();
}
close(fd);
if (strlen(path_option_db)) {
- rslt = unlink(path_option_db);
+ /* Truncate the file so monitoring process see exit. */
+ rslt = truncate(path_option_db, 0);
if (rslt == -1)
- warning("Could not unlink '%s': %s",
- path_option_db, strerror(errno));
+ warning("Unable to truncate '%s': %s", path_option_db,
+ strerror(errno));
}
/*