Triggering a sync

65 views
Skip to first unread message

Jeffrey Kinsey

unread,
Feb 9, 2018, 6:20:12 PM2/9/18
to Mender List mender.io
Is there a way to trigger a mender client to check the server for an update? The reason I ask is because I'd like to run in managed mode but I'd to check for an update immediately after the device is powered on for the first time. Or, do I rely on the fact that the Mender daemon will check immediately at boot?

Vladimir Bashkirtsev

unread,
Feb 9, 2018, 6:41:26 PM2/9/18
to men...@lists.mender.io
I would rely on Mender client to check for update automatically on boot. However if the device is not authorized yet then no update will happen - instead device will generate its keys and post it to the server. After the device is authorized it still will not ask for update: next thing it will do on boot (or on subsequent contact with the server due to the schedule) it will provide the inventory. And only on third contact it will ask for the update.

So if you want to ship your devices and ensure that they will ask the server for the update at boot time make sure that mender server has its keys and inventory before delivery.

On 10 Feb 2018 07:20, "Jeffrey Kinsey" <jef...@nakedlabs.com> wrote:
Is there a way to trigger a mender client to check the server for an update? The reason I ask is because I'd like to run in managed mode but I'd to check for an update immediately after the device is powered on for the first time. Or, do I rely on the fact that the Mender daemon will check immediately at boot?

--
You received this message because you are subscribed to the Google Groups "Mender List mender.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mender+unsubscribe@lists.mender.io.
To post to this group, send email to men...@lists.mender.io.
Visit this group at https://groups.google.com/a/lists.mender.io/group/mender/.

Jeffrey Kinsey

unread,
Feb 9, 2018, 6:49:35 PM2/9/18
to men...@lists.mender.io
Vladimir,

Perfect, thanks.

Jeffrey
On Fri, Feb 9, 2018 at 3:41 PM, Vladimir Bashkirtsev <vbashk...@gmail.com> wrote:
I would rely on Mender client to check for update automatically on boot. However if the device is not authorized yet then no update will happen - instead device will generate its keys and post it to the server. After the device is authorized it still will not ask for update: next thing it will do on boot (or on subsequent contact with the server due to the schedule) it will provide the inventory. And only on third contact it will ask for the update.

So if you want to ship your devices and ensure that they will ask the server for the update at boot time make sure that mender server has its keys and inventory before delivery.
On 10 Feb 2018 07:20, "Jeffrey Kinsey" <jef...@nakedlabs.com> wrote:
Is there a way to trigger a mender client to check the server for an update? The reason I ask is because I'd like to run in managed mode but I'd to check for an update immediately after the device is powered on for the first time. Or, do I rely on the fact that the Mender daemon will check immediately at boot?

--
You received this message because you are subscribed to the Google Groups "Mender List mender.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mender+un...@lists.mender.io.

To post to this group, send email to men...@lists.mender.io.
Visit this group at https://groups.google.com/a/lists.mender.io/group/mender/.

Kyle Manna

unread,
Feb 10, 2018, 10:24:55 AM2/10/18
to mender
I have a similar issue on a device that doesn't have a RTC and starts with the wrong time and fails to communicate via TLS to the Mender server on the first attempt as the NTP synchronization hasn't succeeded yet.  It succeeds on the second polling interval.

To speed this up I've found that restarting the service with `systemctl restart mender` is sufficient to make it talk again.

Ultimately I need to modify the systemd service file to delay mender service until after the time is synchronized..

Vladimir Bashkirtsev

unread,
Feb 10, 2018, 10:33:36 AM2/10/18
to men...@lists.mender.io
Just change wants target in your mender service file.

Kyle Manna

unread,
Feb 10, 2018, 11:31:07 AM2/10/18
to mender
That'll only wait for the NTP service to start, not the NTP service to finish synchronization.

Vladimir Bashkirtsev

unread,
Feb 10, 2018, 12:44:19 PM2/10/18
to men...@lists.mender.io
After=systemd-timesyncd-wait.target

Works for me with latest systemd and timesyncd used as ntp client (which is more than enough for SBCs).

In previous versions of systemd

After=time-sync.target

does similar job but it may still continue without time set under some circumstances.

Kyle Manna

unread,
Feb 10, 2018, 1:18:55 PM2/10/18
to mender
Ahh, didn't realize there was systemd-timesyncd-wait target.  I'll definitely check this out.  I'm using timesyncd as well, simple and lightweight.

Thanks!

Kyle Manna

unread,
Feb 13, 2018, 1:55:12 PM2/13/18
to mender
Hey all,

There's a time-sync.target in systemd that aims to do exactly what I want and would work with systemd-timesyncd-wait, chrony-wait or similar in a generic way.


Dell Green

unread,
Sep 17, 2018, 9:32:03 AM9/17/18
to Mender List mender.io
looks like there is a 'check-update'  client command coming in version 1.6 to trigger daemon to do an update-check 
Reply all
Reply to author
Forward
0 new messages