Talk:Unbound

From ArchWiki
Jump to navigation Jump to search

"better to wait another month than this terrible script"

User:Lahwaacz Please explain how the script is "terrible". It builds upon the one already suggested and is the only thing that works in a setup where one starts their network configuration manually when they want to connect to the internet, not automatically at boot.

—This unsigned comment is by Wincraft71 (talk) 07:21, 4 January 2018‎. Please sign your posts with ~~~~!

To begin with, systemctl is-active dhcpcd@eth0.service returns active even if the ethernet cable is not connected. Second, the service should run once and then be done, not ping-pong with systemd every 2 minutes if the system is offline. Third, longish scripts belong to separate files instead of the ExecStart line. Finally, if it still builds upon the one already suggested, you should just describe the differences instead of copy-pasting the timer etc. -- Lahwaacz (talk) 18:10, 4 January 2018 (UTC)
In the scenario where the dhcpcd service is not enabled at boot and stays disabled for the user to manually start it, that would not be a problem. The service only repeats until it succeeds then it's done, otherwise it would always fail at boot because the system is offline. The script helps with delayed manual network configurations and is far from "terrible". Aside from the first two points, if the script was placed in a file and the differences placed in the article as an edit to be made to the original roothints.service, would it be acceptable? -- Wincraft71 (talk) 18:39, 4 January 2018 (UTC)
If the dhcpcd service is not enabled and only started manually, one can also update the root hints manually. And note that for each restart of a service systemd writes several lines into its log so if the system is offline for 2 hours and the service restarts every 2 minutes, that's 60 log events, which is too much for a "normal" operation. Since you're devising such solution, surely 2 hours offline are not unusual - otherwise you could simply let the timer trigger at the time of the day which is always online. Let's continue when you deal with these. -- Lahwaacz (talk) 19:17, 4 January 2018 (UTC)
Updating the root hints manually defeats the entire purpose of it being automatic. The time can be upped to 15 minutes which would make it only 8 log events which should be fine. Letting the timer trigger at a certain time of day is not dynamic, schedules can change and it should not be a fixed time. -- Wincraft71 (talk) 19:46, 4 January 2018 (UTC)
There is no maximum offline time for a system, so it doesn't matter how large the restart timeout is - the service should start and wait on its own instead of returning to systemd. In any case, you need a better way to detect active internet connection. -- Lahwaacz (talk) 20:09, 4 January 2018 (UTC)
Services running only when the system is up is additionally exactly the point of the network-online.target target, which this service should require and be ordered after, and then just run the update script without the restart or connectivity checking. @kyriastalk 00:25, 7 January 2018 (UTC)
I am seeing from journalctl --list-boots and systemctl status network-online.target that network-online.target is reached shortly after boot, but my network was not up until 15 minutes later -- Wincraft71 (talk) 02:28, 8 January 2018 (UTC)
Then it is misconfigured. See [1]. -- Lahwaacz (talk) 08:51, 8 January 2018 (UTC)