15.11.2018 2:34, Martin Wilck пишет:
On Tue, 2018-11-13 at 21:24 +0100, Achim Gratz wrote:
The handling of ntpd apparently switched from an old-style rc script to a systemd unit. Since then the stop script will take somewhere between ten seconds to a minute to declare success and continue with the shutdown.
Strange - AFAICS the systemd unit files for ntp have existed for more than 4 years in factory.
This is not the first report that ntpd service takes long time on shutdown.
I don't see why it should take that long to shut down since ntpd really just closes the ntp logs and exits. The systemd unit file treats it as a forking daemon, which probably makes the check of whether the daemon has exited more involved.
Not really involved. For forking daemons, systemd simply kills and checks the PID mentioned in the PIDfile directive.
systemd waits for all processes to stop. ntpd starts at least one more process for asynchronous resolver. It's possible that this process may get blocked and ignores SIGTERM. It is even possible that it gets blocked somewhere in a library call and so the reason is outside of ntpd. I am not sure how to debug it, given that it seems to happen on shutdown only (and logs presented here are obviously from system shutdown as well). I thought that it may be related to network being stopped too early, but simple minded "systemctl stop network; systemctl stop ntpd" still has no delay. But if someone can reproduce it with high probability (I cannot) running with systemd debug level output is the first step.
But ntpd can easily be told not to fork, so I think it should use the "-n" option in ExecStart and all
systemd does exactly the same in both cases - it either runs ExecStop or sends signal, so I do not see how it is going to change anything.
the stuff that the current start script is doing should go into ExecStartPre?
Please consider opening a bug.
Martin
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org