summarylogtreecommitdiffstats
path: root/snapd.install
blob: 9b7815dd21ae5f61a080abe46a2442b53b69737b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  pre_remove() {
  /usr/lib/snapd/snap-mgmt --purge || :
  rm -f /etc/udev/rules.d/70-snap.*.rules || true
  rm -f /etc/dbus-1/system.d/snap.* || true
  rm -f /var/lib/snapd/system-key || true
}

post_upgrade() {
  # since 2.39+ void permission bits are 111 instead of 000
  chmod 111 /var/lib/snapd/void || true
  # since 2.62, snapd generates cgroup device files under /var/lib/snapd/cgroup/
  # which are needed in order to start any snaps, suggest to restart snapd if
  # we're upgrading from a version older than 2.62
  if (( $(vercmp "$2" '2.62-1') < 0)); then
      echo
      echo ">>> The snapd.service requires a restart for snaps to continue working. "
      echo ">>> Run the following command after the update:"
      echo ">>>    systemctl restart snapd.service"
      echo
  fi
}

# vim:set ts=2 sw=2 et: