From: Roy Marples Date: Tue, 17 Feb 2009 23:02:09 +0000 (+0000) Subject: If running as a controlling daemon with link management, background earlier. X-Git-Tag: v5.0.0~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9fc4ec4b90fb8a029a16ccc934368b68c2a51c3;p=thirdparty%2Fdhcpcd.git If running as a controlling daemon with link management, background earlier. --- diff --git a/dhcpcd.8.in b/dhcpcd.8.in index 61df5e90..c2494fa7 100644 --- a/dhcpcd.8.in +++ b/dhcpcd.8.in @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 28, 2009 +.Dd February 17, 2009 .Dt DHCPCD 8 SMM .Sh NAME .Nm dhcpcd @@ -111,10 +111,12 @@ option. can be run per interface or as a single instance to manage all interfaces. If a list of interfaces are given on the command line, then .Nm -only works with those interfaces. -If no interfaces are given then +only works with those interfaces, otherwise .Nm -discovers available interfaces and attempts to configure them. +discovers available interfaces. +If link management is enabled and none or more than one interfaces are given, +.Nm +forks to the background right away. .Pp Interfaces are preferred by carrier, DHCP lease/IPv4LL and then lowest metric. For systems that support route metrics, each route will be tagged with the diff --git a/dhcpcd.c b/dhcpcd.c index 21612bdb..ec275266 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -1460,6 +1460,11 @@ main(int argc, char **argv) ifc = argc - optind; ifv = argv + optind; + if (ifc != 1) { + if (options & (DHCPCD_LINK | DHCPCD_DAEMONISE)) + daemonise(); + } + ifaces = discover_interfaces(ifc, ifv); for (i = 0; i < ifc; i++) { for (iface = ifaces; iface; iface = iface->next)