Re: "dhcpcd not running"
Shahid Mahmood
Wed Apr 27 15:03:24 2016
On Wed, Apr 27, 2016 at 10:44 AM, Roy Marples <roy@xxxxxxxxxxxx> wrote:
>
>
> On 27/04/2016 15:11, Shahid Mahmood wrote:
> >
> > On Wed, Apr 27, 2016 at 9:50 AM, Roy Marples <roy@xxxxxxxxxxxx
> > <mailto:roy@xxxxxxxxxxxx>> wrote:
> >
> > Hi
> >
> > On 26/04/2016 21:45, Shahid Mahmood wrote:
> > > I am trying "dhcpcd -k" and "dhcpcd -x" options on a running
> > instance of
> > > dhcpcd, without specifying interface. As per man page, "If no
> > interface
> > > is specified, then the above is applied to all interfaces.".
> Instead I
> > > am getting:
> > >
> > > "dhcpcd not running"
> > >
> > > Instead, "dhcpcd -k eth0" or "dhcpcd -x eth0" works fine.
> > >
> > > Note, dhcpcd was started with interface supplied at command line.
> > >
> > > dhcpcd -c <xx> eth0
> >
> > Suggestions on how to improve the man page are welcome :)
> >
> > If dhcpcd is started on a single interface without the -M switch
> then it
> > will ONLY operate on that interface and all calls that send signals
> (-k,
> > -x, -n, -N) if subsequent dhcpcd invocations ONLY specify that
> > interface.
> >
> > If none or more than one interfaces are given, or the -M switch is
> > given, then dhcpcd will operate on the global context for the listed
> > interfaces, or all if none specified.
> >
> > Roy
> >
> >
> > Thanks. Yes, that's how it seems to operate. My challenge is that I need
> > to start dhcpcd on exactly on one interface. The name of that interface
> > would change as and when a vlan is configured on it (e.g eth0.123). The
> > previous instance must release the lease and exit.
> > I needed to accomplish this without needing to keep the interface name
> > in a local variable.
>
> This all sounds very odd.
> dhcpcd is designed to work on >1 interface.
> Why must it operate like so, what is your use case?
>
> You can set metrics for each interface, lowest wins.
>
> interface eth0
> metric 99999 #nice and high so vlans win
>
> interface eth0.123
> metric 4 #nice and low so it beats eth0
>
> That means eth0.123 will always be preferred over eth0
>
> Otherwise, you'll have to dervice which interface dhcpcd was started for
> based on the pidfile it creates.
>
> Roy
>
> This will only work if vlan id was know beforehand. Which is not.
Use case is a multiple vlan environment. At start, the device obtains a
lease on a no-vlan (eth0) dhcp server. The lease informs us (using a custom
option) to switch to another vlan, say 345 (as supplied). We will first
need to release the old eth0 lease and then request new lease using the
provided vlan id.
Basically we cant hard code the vlan id (and consequently adaptor name) in
the .conf file because it is not known.
Can you suggest why my approach would not work? (ie putting desired
interface name in .conf file).
(I want to avoid having to deal with pidfile).
Thanks once again.
-shahid
Archive administrator: postmaster@marples.name