Skip to contentSkip to conversation

meta-systemd: ntp: Change version to what is used in meta-networking.

PATCH In review Martin Ertsaas 3 participants 6 messages Oct 26, 2012 – Oct 27, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 meta-systemd: ntp: Change version to what is used in meta-networking.

Change version of ntp to match that in meta-networking. Also change ntpdate to ntp-date to match the names used in meta-networking.

---
 .../recipes-support/ntp/ntp_4.2.6p3.bbappend       |   20 --------------------
 .../recipes-support/ntp/ntp_4.2.6p5.bbappend       |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 20 deletions(-)
 delete mode 100644 meta-systemd/meta-oe/recipes-support/ntp/ntp_4.2.6p3.bbappend
 create mode 100644 meta-systemd/meta-oe/recipes-support/ntp/ntp_4.2.6p5.bbappend
meta-systemd/meta-oe/recipes-support/ntp/ntp_4.2.6p3.bbappend deleted +0 -20
deleted file mode 100644
index c6cd031..0000000
@@ -1,20 +0,0 @@
-inherit systemd
-
-PRINC := "${@int(PRINC) + 1}"
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-SYSTEMD_PACKAGES = "${PN}-systemd ntpdate-systemd"
-SYSTEMD_SERVICE_${PN}-systemd = "ntpd.service"
-SYSTEMD_SERVICE_ntpdate-systemd = "ntpdate.service"
-
-SRC_URI += " \
-	file://ntpdate.service \
-        file://ntpd.service \
-"
-
-do_install_append() {
-	install -d ${D}${systemd_unitdir}/system
-	install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
-	install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
-}
meta-systemd/meta-oe/recipes-support/ntp/ntp_4.2.6p5.bbappend new file +20 -0
new file mode 100644
index 0000000..bc2b2dd
@@ -0,0 +1,20 @@
+inherit systemd
+
+PRINC := "${@int(PRINC) + 1}"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SYSTEMD_PACKAGES = "${PN}-systemd ${PN}-date-systemd"
+SYSTEMD_SERVICE_${PN}-systemd = "ntpd.service"
+SYSTEMD_SERVICE_${PN}-date-systemd = "ntpdate.service"
+
+SRC_URI += " \
+	file://ntpdate.service \
+        file://ntpd.service \
+"
+
+do_install_append() {
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
+	install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
+}
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH v2 2/2 meta-systemd: ntp: Fix starting of ntpdate.service

Make ntpdate.service run ntpdate instead of ntpd, as ntpd is not necessarily installed. Also make ntpdate require network.target, as you can not run ntpdate (or ntpd for that matter), without networking.

---
 .../recipes-support/ntp/ntp/ntpdate.service        |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
meta-systemd/meta-oe/recipes-support/ntp/ntp/ntpdate.service +2 -1
index b2bc632..a48d11d 100644
@@ -1,10 +1,11 @@
 [Unit]
 Description=Network Time Service (one-shot ntpdate mode)
+Requires=network.target
 Before=ntpd.service
 
 [Service]
 Type=oneshot
-ExecStart=/usr/bin/ntpd -q -g -x
+ExecStart=/usr/bin/ntpdate pool.ntp.org
 RemainAfterExit=yes
 
 [Install]
Signature · 1 line
1.7.8.6
#2 lore raw

Re: [meta-systemd][PATCH v2 2/2] meta-systemd: ntp: Fix starting of ntpdate.service

meta-systemd/meta-oe/recipes-support/ntp/ntp/ntpdate.service line 8

Quoted 3 lines · Martin Ertsaas

Type=oneshot

meta-systemd/meta-oe/recipes-support/ntp/ntp/ntpdate.service +1 -1
-ExecStart=/usr/bin/ntpd -q -g -x
+ExecStart=/usr/bin/ntpdate pool.ntp.org

This should be made configurable. E.g.

Environment=NTPHOSTS=pool.ntp.org
EnvironmentFile=-/etc/sysconfig/ntp.conf
ExecStart=/usr/bin/ntpdate $NTPHOSTS

Enrico

#3 lore raw

Re: [meta-systemd][PATCH v2 2/2] meta-systemd: ntp: Fix starting of ntpdate.service

Quoted 11 lines · Enrico Scholz

meta-systemd/meta-oe/recipes-support/ntp/ntp/ntpdate.service line 8

Quoted 3 lines · Martin Ertsaas

Type=oneshot

meta-systemd/meta-oe/recipes-support/ntp/ntp/ntpdate.service +1 -1
-ExecStart=/usr/bin/ntpd -q -g -x
+ExecStart=/usr/bin/ntpdate pool.ntp.org

This should be made configurable. E.g.

Environment=NTPHOSTS=pool.ntp.org
EnvironmentFile=-/etc/sysconfig/ntp.conf
ExecStart=/usr/bin/ntpdate $NTPHOSTS

From http://www.pool.ntp.org/en/vendors.html:

"To allow you to use the pool as the default time service in your application, we will set you up with special hostnames, for example 0.vendor.pool.ntp.org, 1.vendor.pool.ntp.org, 2.vendor.pool.ntp.org and 3.vendor.pool.ntp.org.
You must absolutely not use the default pool.ntp.org zone names as the default configuration in your application or appliance."

Someone -- probably someone on the TSC I suspect as a representative of the YP -- should register a vendor pool so we can default to 0.yocto.pool.ntp.org or something similar.

Ross

#4 lore raw

Re: [meta-systemd][PATCH v2 2/2] meta-systemd: ntp: Fix starting of ntpdate.service

Quoted 24 lines · Ross
Quoted 10 lines · Enrico Scholz

meta-systemd/meta-oe/recipes-support/ntp/ntp/ntpdate.service line 8

Quoted 3 lines · Martin Ertsaas

Type=oneshot

meta-systemd/meta-oe/recipes-support/ntp/ntp/ntpdate.service +1 -1
-ExecStart=/usr/bin/ntpd -q -g -x
+ExecStart=/usr/bin/ntpdate pool.ntp.org

This should be made configurable. E.g.

Environment=NTPHOSTS=pool.ntp.org
EnvironmentFile=-/etc/sysconfig/ntp.conf
ExecStart=/usr/bin/ntpdate $NTPHOSTS

From http://www.pool.ntp.org/en/vendors.html:

"To allow you to use the pool as the default time service in your application, we will set you up with special hostnames, for example 0.vendor.pool.ntp.org, 1.vendor.pool.ntp.org, 2.vendor.pool.ntp.org and 3.vendor.pool.ntp.org.
You must absolutely not use the default pool.ntp.org zone names as the default configuration in your application or appliance."

Someone -- probably someone on the TSC I suspect as a representative of the YP -- should register a vendor pool so we can default to 0.yocto.pool.ntp.org or something similar.

Quoted 6 lines

Ross

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

That sounds like a good way to do it. Then we can simply use that as the default, and have the possibility to use an NTPHOST or something.

Should we leave this until someone registers a pool, or what would be a good default pool until someone does it?

- Martin

#5 lore raw

Re: [meta-systemd][PATCH v2 2/2] meta-systemd: ntp: Fix starting of ntpdate.service

Quoted 2 lines · Martin Ertsås

Should we leave this until someone registers a pool, or what would be a good default pool until someone does it?

This should be raised with the TSC. There isn't a good default pool, if you use pool.ntp.org as a default you are in breach of their terms.

Ross