[meta-networking] chrony: install chrony-wait.service

Submitted by pdmorrow@gmail.com on Nov. 19, 2019, 3:45 p.m. | Patch ID: 167138

Details

Message ID 20191119154539.22200-1-pdmorrow@gmail.com
State Changes Requested
Commit 746e52fc15259973bedb0f97bd1b2e7a43e11b43
Headers show

Commit Message

pdmorrow@gmail.com Nov. 19, 2019, 3:45 p.m.
From: Peter Morrow <peter.morrow@microsoft.com>

Any systemd service which needs to wait on ntp synchronization before
starting can order themselves after chrony-wait.service.  It's useful
to install this service as part of the recipe as it saves needing to
install it via a bbappend file.  Note that even if the service is
installed no start up delay is introduced unless another service
orders itself after the systemd target time-sync.target.

Signed-off-by: Peter Morrow <peter.morrow@microsoft.com>
---
 meta-networking/recipes-support/chrony/chrony_3.5.bb | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta-networking/recipes-support/chrony/chrony_3.5.bb b/meta-networking/recipes-support/chrony/chrony_3.5.bb
index 7c6356d26..fa11c443e 100644
--- a/meta-networking/recipes-support/chrony/chrony_3.5.bb
+++ b/meta-networking/recipes-support/chrony/chrony_3.5.bb
@@ -103,6 +103,9 @@  do_install() {
     install -d ${D}${systemd_unitdir}/system
     install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/
 
+    # systemd chronyd synchronization unit configuration file
+    install -m 0644 ${S}/examples/chrony-wait.service ${D}${systemd_unitdir}/system/
+
     # Variable data (for drift and/or rtc file)
     install -d ${D}${localstatedir}/lib/chrony
 

Comments

Khem Raj Nov. 20, 2019, 2:39 p.m.
On Tue, Nov 19, 2019 at 7:46 AM <pdmorrow@gmail.com> wrote:
>
> From: Peter Morrow <peter.morrow@microsoft.com>
>
> Any systemd service which needs to wait on ntp synchronization before
> starting can order themselves after chrony-wait.service.  It's useful
> to install this service as part of the recipe as it saves needing to
> install it via a bbappend file.  Note that even if the service is
> installed no start up delay is introduced unless another service
> orders itself after the systemd target time-sync.target.
>
> Signed-off-by: Peter Morrow <peter.morrow@microsoft.com>
> ---
>  meta-networking/recipes-support/chrony/chrony_3.5.bb | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/meta-networking/recipes-support/chrony/chrony_3.5.bb b/meta-networking/recipes-support/chrony/chrony_3.5.bb
> index 7c6356d26..fa11c443e 100644
> --- a/meta-networking/recipes-support/chrony/chrony_3.5.bb
> +++ b/meta-networking/recipes-support/chrony/chrony_3.5.bb
> @@ -103,6 +103,9 @@ do_install() {
>      install -d ${D}${systemd_unitdir}/system
>      install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/
>
> +    # systemd chronyd synchronization unit configuration file
> +    install -m 0644 ${S}/examples/chrony-wait.service ${D}${systemd_unitdir}/system/
> +

thiis needs to be packages as well something like

FILES_${PN} = "${systemd_unitdir}/system/"
> +
>      # Variable data (for drift and/or rtc file)
>      install -d ${D}${localstatedir}/lib/chrony
>
> --
> 2.20.1
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
pdmorrow@gmail.com Nov. 20, 2019, 4:03 p.m.
On Wed, 20 Nov 2019 at 14:39, Khem Raj <raj.khem@gmail.com> wrote:
>
> On Tue, Nov 19, 2019 at 7:46 AM <pdmorrow@gmail.com> wrote:
> >
> > From: Peter Morrow <peter.morrow@microsoft.com>
> >
> > Any systemd service which needs to wait on ntp synchronization before
> > starting can order themselves after chrony-wait.service.  It's useful
> > to install this service as part of the recipe as it saves needing to
> > install it via a bbappend file.  Note that even if the service is
> > installed no start up delay is introduced unless another service
> > orders itself after the systemd target time-sync.target.
> >
> > Signed-off-by: Peter Morrow <peter.morrow@microsoft.com>
> > ---
> >  meta-networking/recipes-support/chrony/chrony_3.5.bb | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/meta-networking/recipes-support/chrony/chrony_3.5.bb b/meta-networking/recipes-support/chrony/chrony_3.5.bb
> > index 7c6356d26..fa11c443e 100644
> > --- a/meta-networking/recipes-support/chrony/chrony_3.5.bb
> > +++ b/meta-networking/recipes-support/chrony/chrony_3.5.bb
> > @@ -103,6 +103,9 @@ do_install() {
> >      install -d ${D}${systemd_unitdir}/system
> >      install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/
> >
> > +    # systemd chronyd synchronization unit configuration file
> > +    install -m 0644 ${S}/examples/chrony-wait.service ${D}${systemd_unitdir}/system/
> > +
>
> thiis needs to be packages as well something like
>
> FILES_${PN} = "${systemd_unitdir}/system/"

Thanks Khem.  Strange my build did not show this up, I'll do some more
testing and re-submit.

> > +
> >      # Variable data (for drift and/or rtc file)
> >      install -d ${D}${localstatedir}/lib/chrony
> >
> > --
> > 2.20.1
> >
> > --
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Khem Raj Nov. 20, 2019, 4:11 p.m.
On Wed, Nov 20, 2019 at 8:03 AM Peter Morrow <pdmorrow@gmail.com> wrote:
>
> On Wed, 20 Nov 2019 at 14:39, Khem Raj <raj.khem@gmail.com> wrote:
> >
> > On Tue, Nov 19, 2019 at 7:46 AM <pdmorrow@gmail.com> wrote:
> > >
> > > From: Peter Morrow <peter.morrow@microsoft.com>
> > >
> > > Any systemd service which needs to wait on ntp synchronization before
> > > starting can order themselves after chrony-wait.service.  It's useful
> > > to install this service as part of the recipe as it saves needing to
> > > install it via a bbappend file.  Note that even if the service is
> > > installed no start up delay is introduced unless another service
> > > orders itself after the systemd target time-sync.target.
> > >
> > > Signed-off-by: Peter Morrow <peter.morrow@microsoft.com>
> > > ---
> > >  meta-networking/recipes-support/chrony/chrony_3.5.bb | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/meta-networking/recipes-support/chrony/chrony_3.5.bb b/meta-networking/recipes-support/chrony/chrony_3.5.bb
> > > index 7c6356d26..fa11c443e 100644
> > > --- a/meta-networking/recipes-support/chrony/chrony_3.5.bb
> > > +++ b/meta-networking/recipes-support/chrony/chrony_3.5.bb
> > > @@ -103,6 +103,9 @@ do_install() {
> > >      install -d ${D}${systemd_unitdir}/system
> > >      install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/
> > >
> > > +    # systemd chronyd synchronization unit configuration file
> > > +    install -m 0644 ${S}/examples/chrony-wait.service ${D}${systemd_unitdir}/system/
> > > +
> >
> > thiis needs to be packages as well something like
> >
> > FILES_${PN} = "${systemd_unitdir}/system/"
>
> Thanks Khem.  Strange my build did not show this up, I'll do some more
> testing and re-submit.

I also wonder, how this was tested as well if it never showed up on
image. Please describe the testing part as well.

>
> > > +
> > >      # Variable data (for drift and/or rtc file)
> > >      install -d ${D}${localstatedir}/lib/chrony
> > >
> > > --
> > > 2.20.1
> > >
> > > --
> > > _______________________________________________
> > > Openembedded-devel mailing list
> > > Openembedded-devel@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-devel