Discussion:
[systemd-devel] networkd - DHCP timeout ?
Branko
2015-02-11 10:49:17 UTC
Permalink
Unless I have overlooked something, there seems to be no way to tell
dhcp client to fail and leave card unset after some timeout.

We had power interruption, which left dhcp server unconcious and after
rebooting my workstation I couldn't get it up, since it was waiting for
dhcp client to get its response.

One can set a timeout on unit, but i can't find anything similar for
network.
Tom Gundersen
2015-02-11 10:54:02 UTC
Permalink
Unless I have overlooked something, there seems to be no way to tell dhcp
client to fail and leave card unset after some timeout.
We had power interruption, which left dhcp server unconcious and after
rebooting my workstation I couldn't get it up, since it was waiting for dhcp
client to get its response.
One can set a timeout on unit, but i can't find anything similar for
network.
You can't set a timeout for the dhcp client itself (we will keep
trying forever), but you can set a timeout (in current git) on the
wait-online service, so that the length of time your boot is blocked
is limited. Currently it is set to 120s (in git), but it can be
overridden manually.

HTH,

Tom
Vasiliy Tolstov
2015-02-11 11:11:31 UTC
Permalink
Nice, can you say how to reduce timeout manually to 30s? Where I need to
change value?
Post by Tom Gundersen
Unless I have overlooked something, there seems to be no way to tell dhcp
client to fail and leave card unset after some timeout.
We had power interruption, which left dhcp server unconcious and after
rebooting my workstation I couldn't get it up, since it was waiting for
dhcp
client to get its response.
One can set a timeout on unit, but i can't find anything similar for
network.
You can't set a timeout for the dhcp client itself (we will keep
trying forever), but you can set a timeout (in current git) on the
wait-online service, so that the length of time your boot is blocked
is limited. Currently it is set to 120s (in git), but it can be
overridden manually.
HTH,
Tom
_______________________________________________
systemd-devel mailing list
http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Tom Gundersen
2015-02-11 11:42:33 UTC
Permalink
Post by Vasiliy Tolstov
Nice, can you say how to reduce timeout manually to 30s? Where I need to
change value?
systemd-networkd-wait-online gained two new features in git (online
manpages are still lagging):

--ignore=
Network interfaces to be ignored when deciding if the
system is online. By default only the loopback interface is ignored.
This option may be used more than once to ignore multiple network
interfaces.

--timeout=
Fail the service if the network is not online by the time
the timeout elapses. A timeout of 0 disables the timeout. Defaults to
120 seconds.


So you'll just have to override that unit file to add what you want.

-t
Vasiliy Tolstov
2015-02-11 12:08:55 UTC
Permalink
Post by Tom Gundersen
systemd-networkd-wait-online gained two new features in git (online
--ignore=
Network interfaces to be ignored when deciding if the
system is online. By default only the loopback interface is ignored.
This option may be used more than once to ignore multiple network
interfaces.
--timeout=
Fail the service if the network is not online by the time
the timeout elapses. A timeout of 0 disables the timeout. Defaults to
120 seconds.
So you'll just have to override that unit file to add what you want.
Thanks! Why not add ability to read environment file for options?
--
Vasiliy Tolstov,
e-mail: ***@selfip.ru
jabber: ***@selfip.ru
Lennart Poettering
2015-02-11 12:15:39 UTC
Permalink
Post by Vasiliy Tolstov
Post by Tom Gundersen
systemd-networkd-wait-online gained two new features in git (online
--ignore=
Network interfaces to be ignored when deciding if the
system is online. By default only the loopback interface is ignored.
This option may be used more than once to ignore multiple network
interfaces.
--timeout=
Fail the service if the network is not online by the time
the timeout elapses. A timeout of 0 disables the timeout. Defaults to
120 seconds.
So you'll just have to override that unit file to add what you want.
Thanks! Why not add ability to read environment file for options?
It's a generic tool, people might call with different arguments,
waiting for different interface. I am not sure it's a good idea to
introduce a singular config file for that, given the number of
different contexts this tool might be useful in.

Lennart
--
Lennart Poettering, Red Hat
Kai Krakow
2015-02-11 20:00:13 UTC
Permalink
Post by Lennart Poettering
Post by Vasiliy Tolstov
Post by Tom Gundersen
systemd-networkd-wait-online gained two new features in git (online
--ignore=
Network interfaces to be ignored when deciding if the
system is online. By default only the loopback interface is ignored.
This option may be used more than once to ignore multiple network
interfaces.
--timeout=
Fail the service if the network is not online by the time
the timeout elapses. A timeout of 0 disables the timeout. Defaults to
120 seconds.
So you'll just have to override that unit file to add what you want.
Thanks! Why not add ability to read environment file for options?
It's a generic tool, people might call with different arguments,
waiting for different interface. I am not sure it's a good idea to
introduce a singular config file for that, given the number of
different contexts this tool might be useful in.
I think you are covering the idea of loading the config file from within the
tool... But how about adding an EnvironmentFile to the service (using the
dash prefix) and passing the values from there to ExecStart, defaulting to
120...

Tho, personally I don't see a need for this as "systemctl edit xyz.service"
is already a nice configuration tool to personalize services without the
need for all those extra configuration files. But people new to the systemd
concept tend to love their old concepts of having configuration and scripts
everywhere... ;-)
--
Replies to list only preferred.
Lennart Poettering
2015-02-11 20:21:20 UTC
Permalink
Post by Kai Krakow
Post by Lennart Poettering
Post by Vasiliy Tolstov
Post by Tom Gundersen
systemd-networkd-wait-online gained two new features in git (online
--ignore=
Network interfaces to be ignored when deciding if the
system is online. By default only the loopback interface is ignored.
This option may be used more than once to ignore multiple network
interfaces.
--timeout=
Fail the service if the network is not online by the time
the timeout elapses. A timeout of 0 disables the timeout. Defaults to
120 seconds.
So you'll just have to override that unit file to add what you want.
Thanks! Why not add ability to read environment file for options?
It's a generic tool, people might call with different arguments,
waiting for different interface. I am not sure it's a good idea to
introduce a singular config file for that, given the number of
different contexts this tool might be useful in.
I think you are covering the idea of loading the config file from within the
tool... But how about adding an EnvironmentFile to the service (using the
dash prefix) and passing the values from there to ExecStart, defaulting to
120...
EnvironemntFile is a work-around for certain things, I am pretty sure
we shouldn't intrdouce new "fake" configuration files with it.
Post by Kai Krakow
Tho, personally I don't see a need for this as "systemctl edit xyz.service"
is already a nice configuration tool to personalize services without the
need for all those extra configuration files. But people new to the systemd
concept tend to love their old concepts of having configuration and scripts
everywhere... ;-)
Yeah, "systemctl edit" is the nicer option, I fully agree.

Lennart
--
Lennart Poettering, Red Hat
Branko
2015-02-11 10:42:37 UTC
Permalink
Unless I have overooked something, there seems to be no way to tell dhcp
client to fail and leave card unset after some timeout.

We had popwer interruption, which left dhcp server unconcious and after
rebooting my workstation I couldn't get it up, since it was waiting for
dhcp client to get its response.

One can set a timeout on unit, but i can't find anything similar for
network.
Loading...