]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
If running as a controlling daemon with link management, background earlier.
authorRoy Marples <roy@marples.name>
Tue, 17 Feb 2009 23:02:09 +0000 (23:02 +0000)
committerRoy Marples <roy@marples.name>
Tue, 17 Feb 2009 23:02:09 +0000 (23:02 +0000)
dhcpcd.8.in
dhcpcd.c

index 61df5e9034548ae281a1628fc712fc1ec9df93f0..c2494fa7bd8c70368613cacd1b8f965991cf49e7 100644 (file)
@@ -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
index 21612bdbfa740532bfd84edbee5ef02c5c810e86..ec2752661cabfc0cbe94da7664009320c3feab8e 100644 (file)
--- 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)