From eed5d537fe94e4054d5a9720299dd558476d8149 Mon Sep 17 00:00:00 2001 From: Iavael <905853+iavael@users.noreply.github.com> Date: Mon, 19 Jun 2023 07:57:38 +0400 Subject: [PATCH] Make package scriptlets more universal --- resources/install-scripts/post-install.in | 4 ++-- resources/install-scripts/post-uninstall.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/install-scripts/post-install.in b/resources/install-scripts/post-install.in index edb76cb9..69854670 100755 --- a/resources/install-scripts/post-install.in +++ b/resources/install-scripts/post-install.in @@ -6,6 +6,6 @@ echo "Installing AppImageLauncher as interpreter for AppImages" # as there's no _real_ package that we could use as a dependency to take care of the kernel module, # we need to make sure that the kernel module is loaded manually -modprobe -v binfmt_misc +modprobe -v binfmt_misc || : -(set -x; systemctl restart systemd-binfmt) +systemctl try-restart systemd-binfmt.service || echo "ERROR: failed to execute 'systemctl try-restart systemd-binfmt.service', apply binfmt integration manually" >&2 diff --git a/resources/install-scripts/post-uninstall.in b/resources/install-scripts/post-uninstall.in index d27e46ea..076105a3 100755 --- a/resources/install-scripts/post-uninstall.in +++ b/resources/install-scripts/post-uninstall.in @@ -3,7 +3,7 @@ set -eo pipefail echo "Removing AppImageLauncher as interpreter for AppImages" -(set -x; systemctl restart systemd-binfmt) +systemctl try-restart systemd-binfmt.service || echo "ERROR: failed to execute 'systemctl try-restart systemd-binfmt.service', apply/remove binfmt integration manually" >&2 update_notifier="/usr/share/update-notifier/notify-reboot-required" if [ -x "$update_notifier" ]; then