Files
runner-images/images/ubuntu/scripts/build/configure-snap.sh
Shamil Mubarakshin 1bd9214f41 [ubuntu] Rename build scripts (#8866)
* [ubuntu] Rename build scripts

* [ubuntu] Change reboot to inline shell

* [ubuntu] Move disk space validation to pester tests

* [ubuntu] Rename helper and tests files

* [ubuntu] Changes to cleanup, post-deployment and r scripts
2023-11-22 21:49:23 +01:00

26 lines
947 B
Bash

#!/bin/bash -e
################################################################################
## File: configure-snap.sh
## Desc: Configure snap
################################################################################
source $HELPER_SCRIPTS/etc-environment.sh
# Update /etc/environment to include /snap/bin in PATH
# because /etc/profile.d is ignored by `--norc` shell launch option
prependEtcEnvironmentPath "/snap/bin"
# Put snapd auto refresh on hold
# as it may generate too much traffic on Canonical's snap server
# 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)"