You are not logged in.
Pages: 1
Hello!
I have an Arch Linux machine running 24/7 without problems, until recently, when we had a power outage. The computer is set to automatically start again when there's power, and that works. The problem is that the computer starts before the router is up, the computer tries to connect to the network once, fails and then doesn't try again. That leaves the computer running without internet until I manually restart it.
Is there any way to make the computer continue to try connecting to the router until it works? Instead of trying once and giving up.
I ran the following to enable the connection in the first place: systemctl enable dhcpcd@enp7s0.service
Offline
I suggest looking into one of the systemd "wait-online" services. Examples are: NetworkManager-wait-online.service, systemd-networkd-wait-online.service, netctl-wait-online.service, etc. Your dhcpcd@enp7s0.service unit would then run after the wait-online target.
Offline
I can't even figure out how to do it manually, ever since "systemd" was implemented. I tried "systemctl restart dhcpcd@enp2s0.service" but it never seems to reconnect, so I always just reboot!
Offline
The wait-online services will not help at all. That's for units that should wait until the network is up - having the networking service wait until the network is up is obviously nonsensical.
drcouzelis, I could only speculate that you are not initially (or only) running dhcpcd@.service, otherwise that command *would* work.
As for the OP, you should look at Restart= and RestartSec= options of the service file.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
The wait-online services will not help at all. That's for units that should wait until the network is up - having the networking service wait until the network is up is obviously nonsensical.
Thanks Trilby. My bad, I didn't think the dhcpd service was a standalone networking service.
Offline
Edit your boot-loader to have a longer wait before continuing boot -- long enough for your router to come up before your PC.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
My solution was to disable dhcpcd@enp7s0.service, install NetworkManager and enable that instead. Now everything works as it should.
Does anyone know if this is what's used by default for other distros, like Fedora?
Offline
Does anyone know if this is what's used by default for other distros, like Fedora?
I think so. I don't use Fedora, but I do know NetworkManager was created by Red Hat...
Offline
Pages: 1