From 084d08f7c5a3ffd5b1e6e1867ec3a27fd4212d55 Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Mon, 25 Mar 2024 12:34:59 +0100 Subject: [PATCH] doc: uninstall cacher client based on tag For: https://github.com/ben-grande/qusal/issues/41 --- salt/sys-cacher/README.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/salt/sys-cacher/README.md b/salt/sys-cacher/README.md index 3390207..8f21dce 100644 --- a/salt/sys-cacher/README.md +++ b/salt/sys-cacher/README.md @@ -54,7 +54,7 @@ sudo qubesctl --skip-dom0 --targets=tpl-sys-cacher state.apply sys-cacher.instal sudo qubesctl --skip-dom0 --targets=sys-cacher state.apply sys-cacher.configure sudo qubesctl --skip-dom0 --targets=sys-cacher-browser state.apply sys-cacher.configure-browser sudo qubesctl state.apply sys-cacher.appmenus,sys-cacher.tag -sudo qubesctl --skip-dom0 --templates state.apply sys-cacher.install-client +sudo qubesctl --skip-dom0 --targets="$(qvm-ls --no-spinner --raw-list --tags updatevm-sys-cacher | tr "\n" ",")" state.apply sys-cacher.install-client ``` @@ -99,19 +99,22 @@ By default, only templates will use the proxy to update, if you want to cache Non-TemplateVMs updates or simply make them functional again, the qube will need the `service.updates-proxy-setup` feature set: ```sh -sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.install-client qvm-tags add QUBE updatevm-sys-cacher qvm-features QUBE service.updates-proxy-setup 1 +sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.install-client ``` Don't forget to restart the qube. If you don't want or can't restart the qube, such as DispVMs, where you would -lose the current session, run the above commands plus the following inside the -qube: +lose the current session: ```sh -sudo touch /var/run/qubes-service/updates-proxy-setup -sudo /usr/lib/qubes/update-proxy-configs -sudo systemctl restart qubes-updates-proxy-forwarder.socket +qvm-tags add QUBE updatevm-sys-cacher +qvm-features QUBE service.updates-proxy-setup 1 +qvm-run --user=root QUBE -- " + touch /var/run/qubes-service/updates-proxy-setup + /usr/lib/qubes/update-proxy-configs + systemctl restart qubes-updates-proxy-forwarder.socket" +sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.install-client ``` ### Rewrite URIs inside the qube @@ -131,21 +134,22 @@ sudo apt-cacher-ng-repo uninstal - Top: ```sh sudo qubesctl top.enable sys-cacher.deinit -sudo qubesctl --templates state.apply +sudo qubesctl --targets="$(qvm-ls --no-spinner --raw-list --tags updatevm-sys-cacher | tr "\n" ",")" state.apply sudo qubesctl top.disable sys-cacher.deinit ``` - State: ```sh sudo qubesctl state.apply sys-cacher.remove-policy +sudo qubesctl --skip-dom0 --targets="$(qvm-ls --no-spinner --raw-list --tags updatevm-sys-cacher | tr "\n" ",")" state.apply sys-cacher.uninstall-client sudo qubesctl state.apply sys-cacher.untag -sudo qubesctl --skip-dom0 --templates state.apply sys-cacher.uninstall-client ``` -If you want to use the standard proxy for a few templates: +If you want to use the standard proxy for a few qubes, only uninstall it +from the templates that you don't want to cache packages: ```sh -sudo qubesctl --skip-dom0 --targets=TEMPLATE state.apply sys-cacher.uninstall-client -qvm-tags del TEMPLATE updatevm-sys-cacher +sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.uninstall-client +qvm-tags del QUBE updatevm-sys-cacher ``` ## Credits