diff options
author | Peter A. Bigot <bigotp@acm.org> | 2012-01-04 02:21:05 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-01-05 10:15:55 +0100 |
commit | 42d6f4f36696faaf0e526b14bcc6daff51ab943b (patch) | |
tree | c05f6e11c9239ec68830cd085db988285e2777ae /meta-oe/recipes-support/ntp/files | |
parent | dc32361d19b49c9cb2df1d73dc61dfe7255a11b2 (diff) | |
download | meta-openembedded-contrib-42d6f4f36696faaf0e526b14bcc6daff51ab943b.tar.gz |
ntp: correct systemd EnvironmentFile, add ntpdate service
Eliminate EnvironmentFile from systemd unit descriptions. /etc/ntp.conf
can't be sourced to set environment variables like NTPD_ARG. Following the
rationale at http://0pointer.de/blog/projects/on-etc-sysinit.html it isn't
needed anyway; if you don't buy that, it should be:
EnvironmentFile=-/etc/default/ntpd
Add one-shot ntpdate service which synchronizes local clock prior to
starting ntpd (which aborts if the local time is more than 1000 seconds off
of the server). "systemctl enable ntpdate.service" not done by default
because this would be a behavior change.
Correct comment describing how to replace ntpdate (ntpdc doesn't take those
arguments).
Add comment to ntp.conf pointing out need to remove local hardware clock as
a reference when simulating ntpdate.
Signed-off-by: Peter A. Bigot <bigotp@acm.org>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-support/ntp/files')
-rw-r--r-- | meta-oe/recipes-support/ntp/files/ntp.conf | 1 | ||||
-rw-r--r-- | meta-oe/recipes-support/ntp/files/ntpd.service | 3 | ||||
-rw-r--r-- | meta-oe/recipes-support/ntp/files/ntpdate.service | 11 |
3 files changed, 13 insertions, 2 deletions
diff --git a/meta-oe/recipes-support/ntp/files/ntp.conf b/meta-oe/recipes-support/ntp/files/ntp.conf index 5964828708..bf52440ced 100644 --- a/meta-oe/recipes-support/ntp/files/ntp.conf +++ b/meta-oe/recipes-support/ntp/files/ntp.conf @@ -7,6 +7,7 @@ driftfile /etc/ntp.drift # as required, or change this. server pool.ntp.org # Using local hardware clock as fallback +# Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself server 127.127.1.0 fudge 127.127.1.0 stratum 14 # Defining a default security setting diff --git a/meta-oe/recipes-support/ntp/files/ntpd.service b/meta-oe/recipes-support/ntp/files/ntpd.service index 420a0563a8..bd87b1ea24 100644 --- a/meta-oe/recipes-support/ntp/files/ntpd.service +++ b/meta-oe/recipes-support/ntp/files/ntpd.service @@ -5,8 +5,7 @@ After=network.target [Service] Type=forking PIDFile=/run/ntpd.pid -EnvironmentFile=/etc/ntp.conf -ExecStart=/usr/bin/ntpd $NTPD_ARGS -p /run/ntpd.pid +ExecStart=/usr/bin/ntpd -p /run/ntpd.pid [Install] WantedBy=multi-user.target diff --git a/meta-oe/recipes-support/ntp/files/ntpdate.service b/meta-oe/recipes-support/ntp/files/ntpdate.service new file mode 100644 index 0000000000..b2bc632069 --- /dev/null +++ b/meta-oe/recipes-support/ntp/files/ntpdate.service @@ -0,0 +1,11 @@ +[Unit] +Description=Network Time Service (one-shot ntpdate mode) +Before=ntpd.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/ntpd -q -g -x +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target |