-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DLPX-86902 failed to upgrade from 13.0.0.0 to 14.0.0.0 because engine…
… should allow deferred PR URL: https://www.github.com/delphix/delphix-platform/pull/447
- Loading branch information
Prakash Surya
committed
Jul 12, 2023
1 parent
67f4d94
commit fb9a665
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/usr/share/update-notifier/notify-reboot-required |
50 changes: 50 additions & 0 deletions
50
files/common/usr/share/update-notifier/notify-reboot-required
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
|
||
# we do not include ". gettext.sh" here because: | ||
# a) it breaks if its not available | ||
# b) the string we have here does not need it (because it has no vars) | ||
eval_gettext() { | ||
if [ -x /usr/bin/gettext ]; then | ||
echo $(gettext "$1") | ||
else | ||
echo "$1" | ||
fi | ||
} | ||
export TEXTDOMAIN=update-notifier | ||
export TEXTDOMAINDIR=/usr/share/locale | ||
|
||
case "$DPKG_MAINTSCRIPT_PACKAGE::$DPKG_MAINTSCRIPT_NAME" in | ||
linux-image-extra*::postrm) | ||
exit 0;; | ||
esac | ||
|
||
if [ "$0" = "/etc/kernel/postinst.d/update-notifier" ]; then | ||
DPKG_MAINTSCRIPT_PACKAGE=linux-base | ||
fi | ||
|
||
KERNEL_UPGRADED=0 | ||
# Prefer showing the canonical-livepatch reboot message if one is required | ||
if [ -f "/snap/bin/canonical-livepatch" ]; then | ||
# k-u-r returns 1 if livepatch isn't enabled or if a reboot isn't required | ||
kur_rc=$(/snap/bin/canonical-livepatch kernel-upgrade-required 2> /dev/null) | ||
if [ $? -eq 0 ]; then | ||
exit 0; | ||
elif [ $? -eq 1 ]; then | ||
# status returns 1 if livepatch isn't enabled | ||
status_rc=$(/snap/bin/canonical-livepatch status 2> /dev/null) | ||
if [ $? -eq 0 ]; then | ||
KERNEL_UPGRADED=1 | ||
fi | ||
fi | ||
fi | ||
|
||
# while a reboot isn't required for the new kernel it might be for another package | ||
if [ $KERNEL_UPGRADED -eq 1 ]; then | ||
if [ "$(echo $DPKG_MAINTSCRIPT_PACKAGE | cut -c1-5)" = "linux" ]; then | ||
exit 0; | ||
fi | ||
fi | ||
|
||
# Wake the applet up | ||
echo "*** $(eval_gettext "System restart required") ***" > /var/run/reboot-required | ||
echo "$DPKG_MAINTSCRIPT_PACKAGE" >> /var/run/reboot-required.pkgs |