[systemd-devel] How to ensure a systemd unit waits for ntpd to sync before starting?

Lennart Poettering lennart at poettering.net
Tue Apr 2 10:00:33 UTC 2019

On Di, 02.04.19 14:47, Debraj Manna (subharaj.manna at gmail.com) wrote:

> Thanks for replying. Below is the service file for ntpd
> support at vrni-platform:/etc/init.d$ sudo systemctl cat ntp.service
> # /run/systemd/generator.late/ntp.service
> # Automatically generated by systemd-sysv-generator
> [Unit]
> Documentation=man:systemd-sysv-generator(8)
> SourcePath=/etc/init.d/ntp
> Description=LSB: Start NTP daemon
> Before=multi-user.target
> Before=multi-user.target
> Before=multi-user.target
> Before=graphical.target
> After=network-online.target
> After=remote-fs.target
> After=systemd-journald-dev-log.socket
> Wants=network-online.target

This is an automatically converted SysV service. It's not going to
match what systemd expects from this, and doesn't know systemd's
time-sync.target (which is a concept that didn't exist in SysV). You'd
have to write your own service file to make this work.

Usually, that's a job for your distribution however. Hence please
contact your distro for help about this, or check if there's a newer
version of the distro already that contains native systemd units.

Given that systemd is closing in on its 9th birthday maybe it's really
time for your distro to update things to systemd units.


Lennart Poettering, Berlin

More information about the systemd-devel mailing list