• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.\" Copyright 2006-2008 Roy Marples
2.\" All rights reserved
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd August 14, 2008
26.Dt DHCPCD.SH 8 SMM
27.Sh NAME
28.Nm dhcpcd-run-hooks
29.Nd DHCP client configuration script
30.Sh DESCRIPTION
31.Nm
32is used by
33.Xr dhcpcd 8
34to run any system and user defined hook scripts.
35System hook scripts are found in
36.Pa /system/etc/dhcpcd/dhcpcd-hooks
37and the user defined hooks are
38.Pa /system/etc/dhcpcd/dhcpcd.enter-hook .
39and
40.Pa /system/etc/dhcpcd/dhcpcd.exit-hook .
41The default install supplies hook scripts for configuring
42.Pa /etc/resolv.conf
43and the hostname.
44Your distribution may have included other hook scripts to say configure
45ntp or ypbind.
46A test hook is also supplied that simply echos the dhcp variables to the
47console from DISCOVER message.
48.Pp
49Each time
50.Nm
51is invoked,
52.Ev $interface
53is set to the interface that
54.Nm dhcpcd
55is run on and
56.Ev $reason
57is to the reason why
58.Nm
59was invoked.
60DHCP information to be configured is held in variables starting with the word
61new_ and old DHCP information to be removed is held in variables starting with
62the word old_.
63.Nm dhcpcd
64can display the full list of variables it knows how about by using the
65.Fl V , -variables
66argument.
67.Pp
68Here's a list of reasons why
69.Nm
70could be invoked:
71.Bl -tag -width indent
72.It Dv PREINIT
73dhcpcd is starting up and any pre-initialisation should be done.
74.It Dv INFORM
75dhcpcd informed a DHCP server about it's address and obtained other
76configuration details.
77.It Dv BOUND
78dhcpcd obtained a new lease from a DHCP server.
79.It Dv RENEW
80dhcpcd renewed it's lease.
81.It Dv REBIND
82dhcpcd has rebound to a new DHCP server.
83.It Dv REBOOT
84dhcpcd successfully requested a lease from a DHCP server.
85.It Dv EXPIRE
86dhcpcd's lease expired and it failed to obtain a new one.
87.It Dv IPV4LL
88dhcpcd failed to contact any DHCP servers but did obtain an IPV4LL address.
89.It Dv FAIL
90dhcpcd failed to contact any DHCP servers or use an old lease.
91.It Dv TIMEOUT
92dhcpcd failed to contact any DHCP servers but was able to use an old lease.
93.It Dv TEST
94dhcpcd received an OFFER from a DHCP server but will not configure the
95interface.
96This is primarily used to test the variables are filled correctly for the
97script to process them.
98.El
99.Sh FILES
100When
101.Nm
102runs, it loads
103.Pa /system/etc/dhcpcd/dhcpcd.enter-hook
104and any scripts found in
105.Pa /system/etc/dhcpcd/dhcpcd-hooks
106in a lexical order and then finally
107.Pa /system/etc/dhcpcd/dhcpcd.exit-hook
108.Sh SEE ALSO
109.Xr dhcpcd 8
110.Sh AUTHORS
111.An Roy Marples <roy@marples.name>
112.Sh BUGS
113Please report them to http://bugs.marples.name
114