]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add -K, --nodaeomise option so dhcpcd can run in the foreground without debugging...
authorRoy Marples <roy@marples.name>
Mon, 30 Jun 2008 15:08:19 +0000 (15:08 +0000)
committerRoy Marples <roy@marples.name>
Mon, 30 Jun 2008 15:08:19 +0000 (15:08 +0000)
dhcpcd.8.in
dhcpcd.c

index d4d2f5622febadc462a0f3df808af0cb2cb99359..053b98064ac55d2ec6e75d46c20a45c122f0a104 100644 (file)
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd Jun 18, 2008
+.Dd Jun 30, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
 .Nd an RFC 2131 compliant DHCP client
 .Sh SYNOPSIS
 .Nm
-.Op Fl dknpADEGLSTV
+.Op Fl dknpADEGKLSTV
 .Op Fl c , -script Ar script
 .Op Fl f , -config Ar file
 .Op Fl h , -hostname Ar hostname
@@ -306,6 +306,13 @@ Matches full name, or prefixed with 2 numbers optionally ending with
 .Pp
 So to stop dhcpcd from touching your DNS or MTU settings you would do:-
 .D1 dhcpcd -C resolv.conf -C mtu eth0
+.It Fl K , -nodaemonise
+Don't daemonise when we acquire a lease.
+This disables the
+.Fl t, -timeout
+option.
+This is mainly useful for running under the control of another process, such
+as a debugger or a network manager.
 .It Fl L , -noipv4ll
 Don't use IPv4LL at all.
 .It Fl O , -nooption Ar option
index f844ad36c3c09ae6df30a4278abd305b0a0b3349..585b3d334f5d2deb28d6782bb3ae2a3a9d2b3b7d 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -51,7 +51,7 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples";
 
 /* Don't set any optional arguments here so we retain POSIX
  * compatibility with getopt */
-#define OPTS "c:df:h:i:kl:m:no:pr:s:t:u:xAC:DEF:GI:LO:TV"
+#define OPTS "c:df:h:i:kl:m:no:pr:s:t:u:xAC:DEF:GI:KLO:TV"
 
 static int doversion = 0;
 static int dohelp = 0;
@@ -79,6 +79,7 @@ static const struct option longopts[] = {
        {"fqdn",        optional_argument,  NULL, 'F'},
        {"nogateway",   no_argument,        NULL, 'G'},
        {"clientid",    optional_argument,  NULL, 'I'},
+       {"nodaemonise", no_argument,        NULL, 'K'},
        {"noipv4ll",    no_argument,        NULL, 'L'},
        {"nooption",    optional_argument,  NULL, 'O'},
        {"test",        no_argument,        NULL, 'T'},
@@ -154,7 +155,7 @@ read_pid(const char *pidfile)
 static void
 usage(void)
 {
-       printf("usage: "PACKAGE" [-dknpxADEGHLOSTV] [-c script] [-f file ] [-h hostname]\n"
+       printf("usage: "PACKAGE" [-dknpxADEGHKLOTV] [-c script] [-f file ] [-h hostname]\n"
               "              [-i classID ] [-l leasetime] [-m metric] [-o option] [-r ipaddr]\n"
               "              [-s ipaddr] [-t timeout] [-u userclass] [-F none|ptr|both]\n"
               "              [-I clientID] [-C hookscript] <interface>\n");
@@ -388,6 +389,9 @@ parse_option(int opt, char *oarg, struct options *options)
                        options->options &= ~DHCPCD_CLIENTID;
                }
                break;
+       case 'K':
+               options->options &= ~DHCPCD_DAEMONISE;
+               break;
        case 'L':
                options->options &= ~DHCPCD_IPV4LL;
                break;
@@ -739,6 +743,9 @@ main(int argc, char **argv)
                }
        }
 
+       if (!(options->options & DHCPCD_DAEMONISE))
+               options->timeout = 0;
+
        if (IN_LINKLOCAL(ntohl(options->request_address.s_addr))) {
                logger(LOG_ERR,
                       "you are not allowed to request a link local address");