Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntpd: switch service type from forking to simple #712

Closed

Conversation

JohannesKauffmann
Copy link
Contributor

Type=forking means systemd waits untill the main process, /usr/sbin/ntpd in this case, has exited. However, the ntpd daemon does not seem to call fork() or vfork() and runs endlessly untill killed. Eventually, this causes systemd to trigger a timeout, and the ntpd service is killed. All the while, "systemctl status ntpd" shows "activating (start)" instead of "active (running)". This is fixed by switching Type=forking to Type=simple.

Reading ntpd(8) shows that the "-n" option requests ntpd not to fork, so also use that to be safe.

Finally, there is no need anymore to keep a pidfile around.

Type=forking means systemd waits untill the main process, /usr/sbin/ntpd
in this case, has exited. However, the ntpd daemon does not seem to call
fork() or vfork() and runs endlessly untill killed. Eventually, this
causes systemd to trigger a timeout, and the ntpd service is killed. All
the while, "systemctl status ntpd" shows "activating (start)" instead of
"active (running)". This is fixed by switching Type=forking to
Type=simple.

Reading ntpd(8) shows that the "-n" option requests ntpd not to fork, so
also use that to be safe.

Finally, there is no need anymore to keep a pidfile around.

Signed-off-by: Johannes Kauffmann <johanneskauffmann@hotmail.com>
@kraj
Copy link
Contributor

kraj commented Jul 1, 2023

applied to master with d04c39d

@kraj kraj closed this Jul 1, 2023
@JohannesKauffmann JohannesKauffmann deleted the ntpd-fork branch July 1, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants