running on more than one interface.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 16, 2009
+.Dd October 7, 2009
.Dt DHCPCD 8 SMM
.Os
.Sh NAME
.Nd an RFC 2131 compliant DHCP client
.Sh SYNOPSIS
.Nm
-.Op Fl bdgknpqABDEGKLTV
+.Op Fl bdgknpqwABDEGKLTV
.Op Fl c , -script Ar script
.Op Fl e , -env Ar value
.Op Fl f , -config Ar file
.D1 dhcpcd \-v 03,\e"192.168.0.2\e" eth0
Set un-encapulated vendor option to hello world.
.D1 dhcpcd \-v ,"hello world" eth0
+.It Fl w , -wait
+Wait for an address to be assigned before forking to the background.
.It Fl x , -exit
This will signal an existing
.Nm
static void
usage(void)
{
- printf("usage: "PACKAGE" [-dgknpqxyADEGHKLOTV] [-c script] [-f file]"
+ printf("usage: "PACKAGE" [-dgknpqwxyADEGHKLOTV] [-c script] [-f file]"
" [-e var=val]\n"
" [-h hostname] [-i classID ] [-l leasetime]"
" [-m metric] [-o option]\n"
{
struct if_options *ifo;
struct interface *iface;
- int opt, oi = 0, signal_fd, sig = 0, i, control_fd;
+ int opt, oi = 0, signal_fd, sig = 0, i, control_fd, wflag = 0;
size_t len;
pid_t pid;
struct timespec ts;
case 'n':
sig = SIGALRM;
break;
+ case 'w':
+ wflag = 1;
+ break;
case 'x':
sig = SIGTERM;
break;
options |= DHCPCD_TEST | DHCPCD_PERSISTENT;
options &= ~DHCPCD_DAEMONISE;
}
+ if (wflag != 0)
+ options |= DHCPCD_WAITIP;
#ifdef THERE_IS_NO_FORK
options &= ~DHCPCD_DAEMONISE;
ifc = argc - optind;
ifv = argv + optind;
if (options & DHCPCD_BACKGROUND ||
- (ifc == 0 && options & DHCPCD_LINK && options & DHCPCD_DAEMONISE))
+ (ifc == 0 &&
+ options & DHCPCD_LINK &&
+ options & DHCPCD_DAEMONISE &&
+ !(options & DHCPCD_WAITIP)))
{
daemonise();
} else if (options & DHCPCD_DAEMONISE && ifo->timeout > 0) {
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 2, 2009
+.Dd October 7, 2009
.Dt DHCPCD.CONF 5 SMM
.Os
.Sh NAME
.It Ic vendorclassid Ar string
Change the default vendorclassid sent from dhcpcd-version.
If not set then none is sent.
+.It Ic wait
+Wait for an address to be assigned before forking to the background.
.El
.Sh SEE ALSO
.Xr dhcpcd-run-hooks 8 ,
{"timeout", required_argument, NULL, 't'},
{"userclass", required_argument, NULL, 'u'},
{"vendor", required_argument, NULL, 'v'},
+ {"wait", no_argument, NULL, 'w'},
{"exit", no_argument, NULL, 'x'},
{"allowinterfaces", required_argument, NULL, 'z'},
{"reboot", required_argument, NULL, 'y'},
case 'f': /* FALLTHROUGH */
case 'g': /* FALLTHROUGH */
case 'n': /* FALLTHROUGH */
+ case 'w': /* FALLTHROUGH */
case 'x': /* FALLTHROUGH */
case 'T': /* We need to handle non interface options */
break;
/* Don't set any optional arguments here so we retain POSIX
* compatibility with getopt */
-#define IF_OPTS "bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:xy:z:ABC:DEF:GI:KLN:O:Q:TVW:X:Z:"
+#define IF_OPTS "bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:wxy:z:ABC:DEF:GI:KLN:O:Q:TVW:X:Z:"
#define DEFAULT_TIMEOUT 30
#define DEFAULT_REBOOT 10
#define DHCPCD_QUIET (1 << 21)
#define DHCPCD_BACKGROUND (1 << 22)
#define DHCPCD_VENDORRAW (1 << 23)
+#define DHCPCD_WAITIP (1 << 24)
extern const struct option cf_options[];