[neon/neon/ubuntu-advantage-tools/Neon/release] debian: don't allow systemctl errors to bork everything

Carlos De Maine null at kde.org
Tue Jun 2 03:57:46 BST 2026


Git commit 935a25e4647109531e9fbf8db5a5f0e1605bd721 by Carlos De Maine.
Committed on 02/06/2026 at 02:57.
Pushed by carlosdem into branch 'Neon/release'.

don't allow systemctl errors to bork everything

(cherry picked from commit ed564b7cd04b54a6bc3d2523391c9e06ea90de5e)

M  +4    -5    debian/ubuntu-advantage-tools.postinst

https://invent.kde.org/neon/neon/ubuntu-advantage-tools/-/commit/935a25e4647109531e9fbf8db5a5f0e1605bd721

diff --git a/debian/ubuntu-advantage-tools.postinst b/debian/ubuntu-advantage-tools.postinst
index fa48b2f..e5f8cc7 100644
--- a/debian/ubuntu-advantage-tools.postinst
+++ b/debian/ubuntu-advantage-tools.postinst
@@ -3,13 +3,12 @@
 set -e
 
 # mask the systemd services to not spam the terminal
-sudo systemctl stop ua-timer.timer ua-messaging.timer ua-messaging.service
-systemctl stop apt-news.service esm-cache.service
-systemctl mask apt-news.service esm-cache.service​
+systemctl stop apt-news.service esm-cache.service >/dev/null 2>&1 || true
+systemctl mask apt-news.service esm-cache.service​ >/dev/null 2>&1 || true
 
 # dpkg-divert the service away as well
-dpkg-divert --rename --remove /etc/apt/apt.conf.d/20apt-esm-hook.conf
-dpkg-divert --rename --divert /etc/apt/apt.conf.d/20apt-esm-hook.confdisabled --add /etc/apt/apt.conf.d/20apt-esm-hook.conf
+dpkg-divert --rename --remove /etc/apt/apt.conf.d/20apt-esm-hook.conf  || true
+dpkg-divert --rename --add /etc/apt/apt.conf.d/20apt-esm-hook.conf
 #DEBHELPER#
 
 exit 0


More information about the Neon-commits mailing list