Subsequent dhcpcd commands will start each interface.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd June 27, 2016
+.Dd July 27, 2016
.Dt DHCPCD 8
.Os
.Sh NAME
.Op Fl X , Fl Fl blacklist Ar address Ns Op Ar /cidr
.Op Fl Z , Fl Fl denyinterfaces Ar pattern
.Op Fl z , Fl Fl allowinterfaces Ar pattern
+.Op Fl Fl inactive
.Op interface
.Op ...
.Nm
.It Fl M , Fl Fl master
Start
.Nm
-in master mode even if only one interface specified on the command line.
+in Master mode even if only one interface specified on the command line.
See the Multiple Interfaces section above.
.It Fl m , Fl Fl metric Ar metric
Metrics are used to prefer an interface over another one, lowest wins.
If the same interface is matched in
.Fl Z , Fl Fl denyinterfaces
then it is still denied.
+.It Fl Fl inactive
+Don't start any interfaces other than those specified on the command line.
+This allows
+.Nm
+to be started in Master mode and then wait for subsequent
+.Nm
+commands to start each interface as required.
.It Fl Fl nodev
Don't load any
.Pa /dev
continue;
/* If running off an interface list, check it's in it. */
- if (ctx->ifc) {
+ if (ctx->ifc || ctx->options & DHCPCD_INACTIVE) {
for (i = 0; i < ctx->ifc; i++)
if (strcmp(ctx->ifv[i], ifname) == 0)
break;
}
if (ifp == NULL) {
if (ctx.ifc == 0)
- logger(&ctx, LOG_ERR, "no valid interfaces found");
+ logger(&ctx,
+ ctx.options & DHCPCD_INACTIVE ? LOG_DEBUG : LOG_ERR,
+ "no valid interfaces found");
else
goto exit_failure;
if (!(ctx.options & DHCPCD_LINK)) {
ctx.options & DHCPCD_LINK &&
!(ctx.options & DHCPCD_WAITIP))
{
- logger(&ctx, LOG_WARNING,
+ logger(&ctx,
+ ctx.options & DHCPCD_INACTIVE ?
+ LOG_DEBUG : LOG_WARNING,
"no interfaces have a carrier");
if (dhcpcd_daemonise(&ctx))
goto exit_success;
#define O_NODELAY O_BASE + 44
#define O_INFORM6 O_BASE + 45
#define O_LASTLEASE_EXTEND O_BASE + 46
+#define O_INACTIVE O_BASE + 47
const struct option cf_options[] = {
{"background", no_argument, NULL, 'b'},
{"nodelay", no_argument, NULL, O_NODELAY},
{"noup", no_argument, NULL, O_NOUP},
{"lastleaseextend", no_argument, NULL, O_LASTLEASE_EXTEND},
+ {"inactive", no_argument, NULL, O_INACTIVE},
{NULL, 0, NULL, '\0'}
};
case O_LASTLEASE_EXTEND:
ifo->options |= DHCPCD_LASTLEASE | DHCPCD_LASTLEASE_EXTEND;
break;
+ case O_INACTIVE:
+ ifo->options |= DHCPCD_INACTIVE;
+ break;
default:
return 0;
}
#define DHCPCD_INITIAL_DELAY (1ULL << 58)
#define DHCPCD_PRINT_PIDFILE (1ULL << 59)
#define DHCPCD_ONESHOT (1ULL << 60)
+#define DHCPCD_INACTIVE (1ULL << 61)
#define DHCPCD_NODROP (DHCPCD_EXITING | DHCPCD_PERSISTENT)
if (ifp)
continue;
- active = IF_ACTIVE_USER;
if (argc > 0) {
for (i = 0; i < argc; i++) {
if (strcmp(argv[i], spec.devname) == 0)
break;
}
- if (i == argc)
- active = IF_INACTIVE;
+ active = (i == argc) ? IF_INACTIVE : IF_ACTIVE_USER;
} else {
/* -1 means we're discovering against a specific
* interface, but we still need the below rules
* to apply. */
if (argc == -1 && strcmp(argv[0], spec.devname) != 0)
continue;
+ active = ctx->options & DHCPCD_INACTIVE ?
+ IF_INACTIVE: IF_ACTIVE_USER;
}
for (i = 0; i < ctx->ifdc; i++)