So I wrote a little script that runs after the auto-upgrade when you add it to /etc/cron.daily/mintupdate and checks if this file exists. If so, it will trigger a notification that lists the package(s) that require(s) a reboot:
Code: Select all
if [ -f /var/run/reboot-required ]; then export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep cinnamon-sessio)/environ) MAINUSER=$(cat /etc/passwd|grep 1000|sed "s/:.*$//g") su $MAINUSER -c "notify-send -i mintupdate \"Reboot required\" \"$(cat /var/run/reboot-required.pkgs)\""& fi
cinnamon-sessiowith gnome-session and maybe there's also mate-session or xfce-session? Also keep in mind the 15 character limit for process names or it won't return the process ID (that's why there is no n at the end of cinnamon-sessio).
For portability, this script assumes a regular single user installation where the main user usually has a uid of 1000. Of course you can also hardcode the username of the logged in user that needs to receive the notifications if you like/require.
The line that sends the actual notification ends in & (forks the notify-send process to the background) because otherwise the script (and I guess the anacron script that called this one too) won't finish until the notification has been closed or dismissed.
I thought I'd put this out there, seeing as I searched these forums and didn't get any relevant results before I came up with this solution myself. I've used this script for a while now and it works like a charm!