From 29dbc46881136406ea6830a1dff33c4c152aee27 Mon Sep 17 00:00:00 2001 From: Mikhail Koliada <88318005+mikhailkoliada@users.noreply.github.com> Date: Wed, 29 Dec 2021 13:01:38 +0300 Subject: [PATCH] [Ubuntu] restart snapd during images generation (#4814) --- images/linux/scripts/base/snap.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/images/linux/scripts/base/snap.sh b/images/linux/scripts/base/snap.sh index 98163745..6d38c2e0 100644 --- a/images/linux/scripts/base/snap.sh +++ b/images/linux/scripts/base/snap.sh @@ -5,4 +5,10 @@ # when they are rolling a new major update out. # Hold is calculated as today's date + 60 days +# snapd is started automatically, but during image generation +# a unix socket may die, restart snapd.service (and therefore snapd.socket) +# to make sure the socket is alive. + +systemctl restart snapd.socket +systemctl restart snapd snap set system refresh.hold="$(date --date='today+60 days' +%Y-%m-%dT%H:%M:%S%:z)"