naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
2aacef
From 4161593c24ea24f03bc89d74147e7209dc02ba80 Mon Sep 17 00:00:00 2001
2aacef
From: Mike Yuan <me@yhndnzj.com>
2aacef
Date: Sat, 3 Dec 2022 20:27:47 +0800
2aacef
Subject: [PATCH] rpm/systemd-update-helper: use --no-warn when disabling units
2aacef
2aacef
Suppress the "empty [Install] section" warning (see #25437).
2aacef
2aacef
(cherry picked from commit 0acb1459a15f5b4d3a9bd2e7bf52661ca7bdebf0)
2aacef
2aacef
Related: #2141979
2aacef
---
2aacef
 src/rpm/systemd-update-helper.in | 8 ++++----
2aacef
 1 file changed, 4 insertions(+), 4 deletions(-)
2aacef
2aacef
diff --git a/src/rpm/systemd-update-helper.in b/src/rpm/systemd-update-helper.in
2aacef
index ab8cdc0ff9..b35d952fab 100755
2aacef
--- a/src/rpm/systemd-update-helper.in
2aacef
+++ b/src/rpm/systemd-update-helper.in
2aacef
@@ -19,21 +19,21 @@ case "$command" in
2aacef
 
2aacef
     remove-system-units)
2aacef
         if [ -d /run/systemd/system ]; then
2aacef
-            systemctl --no-reload disable --now "$@"
2aacef
+            systemctl --no-reload disable --now --no-warn "$@"
2aacef
         else
2aacef
-            systemctl --no-reload disable "$@"
2aacef
+            systemctl --no-reload disable --no-warn "$@"
2aacef
         fi
2aacef
         ;;
2aacef
 
2aacef
     remove-user-units)
2aacef
-        systemctl --global disable "$@"
2aacef
+        systemctl --global disable --no-warn "$@"
2aacef
 
2aacef
         [ -d /run/systemd/system ] || exit 0
2aacef
 
2aacef
         users=$(systemctl list-units 'user@*' --legend=no | sed -n -r 's/.*user@([0-9]+).service.*/\1/p')
2aacef
         for user in $users; do
2aacef
             SYSTEMD_BUS_TIMEOUT={{UPDATE_HELPER_USER_TIMEOUT}} \
2aacef
-                    systemctl --user -M "$user@" disable --now "$@" &
2aacef
+                    systemctl --user -M "$user@" disable --now --no-warn "$@" &
2aacef
         done
2aacef
         wait
2aacef
         ;;