diff options
author | Johannes Kauffmann <johanneskauffmann@hotmail.com> | 2023-06-15 13:24:18 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-06-15 10:28:20 -0700 |
commit | d04c39d753ef17108516d054c4bd89a69de44616 (patch) | |
tree | 811046c6ce14866238b092d04288ca566710300b /meta-networking | |
parent | 45a8bb2620b6a035ae9f42434ab1fde45e0f30cb (diff) | |
download | meta-openembedded-d04c39d753ef17108516d054c4bd89a69de44616.tar.gz |
ntpd: switch service type from forking to simple
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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r-- | meta-networking/recipes-support/ntp/ntp/ntpd.service | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.service b/meta-networking/recipes-support/ntp/ntp/ntpd.service index 0e3d7cd37..d793db4a7 100644 --- a/meta-networking/recipes-support/ntp/ntp/ntpd.service +++ b/meta-networking/recipes-support/ntp/ntp/ntpd.service | |||
@@ -3,9 +3,8 @@ Description=Network Time Service | |||
3 | After=network.target | 3 | After=network.target |
4 | 4 | ||
5 | [Service] | 5 | [Service] |
6 | Type=forking | 6 | Type=simple |
7 | PIDFile=/run/ntpd.pid | 7 | ExecStart=/usr/sbin/ntpd -u ntp:ntp -n -g |
8 | ExecStart=/usr/sbin/ntpd -u ntp:ntp -p /run/ntpd.pid -g | ||
9 | 8 | ||
10 | [Install] | 9 | [Install] |
11 | WantedBy=multi-user.target | 10 | WantedBy=multi-user.target |