On Sun, 05 Feb 2017, Fraser_Bell wrote:
It has been many years since I was in a role where I needed to advise logged-in Users of a system shutdown or reboot.
Back then, there was little GUI and the Users would receive a warning in the terminal window.
Since then, I have been aware of a method where Windows Users can receive notifications in the GUI that the system was going down for a reboot or for servicing.
In Unix/Linux, it was -- back then -- simply a matter of issuing:
shutdown -r +5 "Server will restart in 5 minutes. Please save your work."
However, I see that does not pop up a warning wall message for GUI Users, at least in Plasma on Leap 42.1
Is there another way? Or, have things changed enough that the message is done differently?
I saw no differences listed with
shutdown --help
Thanks
I was looking for an answer to this quite recently, but found nothing inspiring, your question prompted me to revisit the issue. There is an old question at stackexchange that addresses this issue: http://unix.stackexchange.com/questions/2881/show-a-notification-across-all-... None of the answers are truly satisfactory as there seems to be no universally correct, simple, standard, guaranteed equivalent to tty wall for X11. However, I did manage to get a modified solution to one of the suggestions to work on my system when run as root: --- snip --- #!/bin/bash PATH=/usr/bin XUSERS=($(who|egrep "\(:[0-9](\.[0-9])*\)"|awk '{print $1$NF}'|sort -u)) for XUSER in $XUSERS; do NAME=(${XUSER/(/ }) DISPLAY=${NAME[1]/)/} sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \ notify-send "$@" done --- snip --- If saved in notify-send-all, you can then do: notify-send-all -i 'dialog-information' Warning 'Shutting down shortly.' I haven't tested this with more than one display running and I haven't tested on anything other than KDE. It does raise a question in my mind: if there is something bad in the logs, such as smartd deciding a disk is failing, will the GUI user be informed? Anyone know how this is handled in OpenSUSE? Cheers, Michael -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org