Skip to content

Commit

Permalink
many: remove snapd.refresh.{timer,service}
Browse files Browse the repository at this point in the history
We used to have an emergency timer that would run a forced refresh once
a week to ensure that if something is wrong with our refresh schedule
implementation we have a way out.

We don't need this anymore because:
- we have the monthly schedule now so weekly does not fit anymore
- we have repairs for emergencies which are on their own timer
- our internal refresh got quite a bit of testing since we introduced it

This should be cherry-picked back to 2.31 and 2.32.
  • Loading branch information
mvo5 committed Mar 9, 2018
1 parent ccee525 commit 7074e72
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 55 deletions.
8 changes: 4 additions & 4 deletions cmd/snap-confine/spread-tests/regression/lp-1599608/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ prepare: |
cd /
echo "Install hello-world"
snap install hello-world
systemctl stop snapd.refresh.timer snapd.service snapd.socket
systemctl stop snapd.service snapd.socket
# all of this ls madness can go away when we have remote environment
# variables
echo "Unmount original core snap"
Expand All @@ -31,7 +31,7 @@ prepare: |
if [ ! -e $(ls -1 /var/lib/snapd/snaps/ubuntu-core_*.snap | tail -1) ]; then exit 1; fi
echo "Mount modified core snap"
mount $(ls -1 /var/lib/snapd/snaps/ubuntu-core_*.snap | tail -1) $(ls -1d /snap/ubuntu-core/* | grep -v current | tail -1)
systemctl start snapd.refresh.timer snapd.service snapd.socket
systemctl start snapd.service snapd.socket
execute: |
exit 0
cd /
Expand All @@ -51,7 +51,7 @@ restore: |
exit 0
echo "Remove hello-world"
snap remove hello-world
systemctl stop snapd.refresh.timer snapd.service snapd.socket
systemctl stop snapd.service snapd.socket
echo "Unmount the modified core snap"
# all of this ls madness can go away when we have remote environment
# variables
Expand All @@ -66,4 +66,4 @@ restore: |
udevadm settle
udevadm trigger
udevadm settle
systemctl start snapd.refresh.timer snapd.service snapd.socket
systemctl start snapd.service snapd.socket
11 changes: 0 additions & 11 deletions data/systemd/snapd.refresh.service.in

This file was deleted.

14 changes: 0 additions & 14 deletions data/systemd/snapd.refresh.timer

This file was deleted.

9 changes: 2 additions & 7 deletions packaging/arch/snapd.install
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ post_install() {
echo 'To use snapd start/enable the snapd.socket'
echo
echo 'If you want your apps to be automatically updated'
echo 'from the store start/enable the snapd.refresh.timer'
echo 'from the store start/enable the snapd.service'
echo
echo 'NOTE: Desktop entries show up after logging in again'
echo ' or rebooting after snapd installation'
Expand All @@ -15,9 +15,7 @@ post_install() {
_systemctl_do_for_all() {
/usr/bin/systemctl "$@" \
snapd.service \
snapd.socket \
snapd.refresh.timer \
snapd.refresh.service > /dev/null 2>&1
snapd.socket > /dev/null 2>&1
}

_stop_services() {
Expand Down Expand Up @@ -46,9 +44,6 @@ post_upgrade() {
if /usr/bin/systemctl -q is-enabled snapd.socket > /dev/null 2>&1; then
/usr/bin/systemctl start snapd.socket > /dev/null 2>&1 || :
fi
if systemctl -q is-enabled snapd.refresh.timer > /dev/null 2>&1; then
systemctl start snapd.refresh.timer > /dev/null 2>&1 || :
fi
}

# vim:set ts=2 sw=2 et:
7 changes: 1 addition & 6 deletions packaging/fedora/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}

%global snappy_svcs snapd.service snapd.socket snapd.autoimport.service snapd.refresh.timer snapd.refresh.service
%global snappy_svcs snapd.service snapd.socket snapd.autoimport.service

# Until we have a way to add more extldflags to gobuild macro...
%if 0%{?fedora} >= 26
Expand Down Expand Up @@ -604,8 +604,6 @@ popd
%{_unitdir}/snapd.socket
%{_unitdir}/snapd.service
%{_unitdir}/snapd.autoimport.service
%{_unitdir}/snapd.refresh.service
%{_unitdir}/snapd.refresh.timer
%{_datadir}/dbus-1/services/io.snapcraft.Launcher.service
%{_datadir}/polkit-1/actions/io.snapcraft.snapd.policy
%config(noreplace) %{_sysconfdir}/sysconfig/snapd
Expand Down Expand Up @@ -680,9 +678,6 @@ if [ $1 -eq 1 ] ; then
if systemctl -q is-enabled snapd.socket > /dev/null 2>&1 ; then
systemctl start snapd.socket > /dev/null 2>&1 || :
fi
if systemctl -q is-enabled snapd.refresh.timer > /dev/null 2>&1 ; then
systemctl start snapd.refresh.timer > /dev/null 2>&1 || :
fi
fi

%preun
Expand Down
4 changes: 1 addition & 3 deletions packaging/opensuse-42.2/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
%global with_test_keys 0
%endif

%define systemd_services_list snapd.refresh.timer snapd.refresh.service snapd.socket snapd.service
%define systemd_services_list snapd.socket snapd.service
Name: snapd
Version: 2.31.1
Release: 0
Expand Down Expand Up @@ -291,8 +291,6 @@ fi
%verify(not user group mode) %attr(06755,root,root) %{_libexecdir}/snapd/snap-confine
%{_mandir}/man1/snap-confine.1.gz
%{_mandir}/man5/snap-discard-ns.5.gz
%{_unitdir}/snapd.refresh.service
%{_unitdir}/snapd.refresh.timer
%{_unitdir}/snapd.service
%{_unitdir}/snapd.socket
/usr/bin/snap
Expand Down
4 changes: 2 additions & 2 deletions packaging/ubuntu-14.04/snapd.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ case "$1" in
# snapd.system-shutdown.service is not strictly needed on 14.04. Its functionality
# is limited to core devices, we still include it here for the sake of comppleteness
# in comparison to 16.04 setups.
systemctl -f enable snapd.refresh.timer snapd.refresh.service snapd.autoimport.service snapd.socket snapd.service snap.mount.service snapd.system-shutdown.service
systemctl start snapd.refresh.timer snapd.autoimport.service snapd.socket snapd.service snap.mount.service
systemctl -f enable snapd.autoimport.service snapd.socket snapd.service snap.mount.service snapd.system-shutdown.service
systemctl start snapd.autoimport.service snapd.socket snapd.service snap.mount.service
fi

case ":$PATH:" in
Expand Down
7 changes: 0 additions & 7 deletions tests/main/interfaces-snapd-control-with-manage/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ execute: |
fi
snap refresh --time | MATCH 'schedule: managed'
echo "Check that the snapd.refresh.service is disabled as well"
systemctl start snapd.refresh.service
if snap changes | MATCH "Refresh all snaps"; then
echo "snapd.refresh.service did refresh, this should not happen"
exit 1
fi
# make sure we trigger a refresh for hints at least once
systemctl stop snapd.socket snapd.service
jq ".data[\"last-refresh\"] = \"2007-08-22T09:30:44.449455783+01:00\"" /var/lib/snapd/state.json > /var/lib/snapd/state.json.new
Expand Down
2 changes: 1 addition & 1 deletion tests/main/ubuntu-core-services/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ execute: |
systemctl status snapd.service |MATCH active
echo "Ensure timers are working"
for timer in snapd.refresh.timer snapd.snap-repair.timer; do
for timer in snapd.snap-repair.timer; do
systemctl is-active $timer
done
restore: |
Expand Down

0 comments on commit 7074e72

Please sign in to comment.