[opensuse] Shutdown / Reboot Warning
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 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/05/2017 12:39 AM, Fraser_Bell wrote:
Is there another way? Or, have things changed enough that the message is done differently?
It's been a while since I've used it, but there is a way to create a pop up message, at least in KDE. I've long since forgotten the details. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-02-05 15:00, James Knott wrote:
On 02/05/2017 12:39 AM, Fraser_Bell wrote:
Is there another way? Or, have things changed enough that the message is done differently?
It's been a while since I've used it, but there is a way to create a pop up message, at least in KDE. I've long since forgotten the details.
Yes, but one needs a way to pop up a message in all desktops, no matter if it is gnome, kde, xfce... -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On 02/05/2017 06:58 AM, Carlos E. R. wrote:
On 2017-02-05 15:00, James Knott wrote:
On 02/05/2017 12:39 AM, Fraser_Bell wrote:
Is there another way? Or, have things changed enough that the message is done differently?
It's been a while since I've used it, but there is a way to create a pop up message, at least in KDE. I've long since forgotten the details.
Yes, but one needs a way to pop up a message in all desktops, no matter if it is gnome, kde, xfce...
Yes. Exactly. The KDE pop-up message that was supposed to do that was xmessage or zenity(?), I believe, but it does not work from an SSH login. Have not tested it while sitting at the machine in question, maybe it works then, or if root is in the GUI and opens a terminal there and uses one of those, but that would be a moot usage, anyway. If I am sitting at the machine, I do not need to send myself a message that I am about to shut it down. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-02-06 09:25, Fraser_Bell wrote:
On 02/05/2017 06:58 AM, Carlos E. R. wrote:
On 2017-02-05 15:00, James Knott wrote:
On 02/05/2017 12:39 AM, Fraser_Bell wrote:
Is there another way? Or, have things changed enough that the message is done differently?
It's been a while since I've used it, but there is a way to create a pop up message, at least in KDE. I've long since forgotten the details.
Yes, but one needs a way to pop up a message in all desktops, no matter if it is gnome, kde, xfce...
Yes. Exactly.
The KDE pop-up message that was supposed to do that was xmessage or zenity(?), I believe, but it does not work from an SSH login. Have not tested it while sitting at the machine in question, maybe it works then, or if root is in the GUI and opens a terminal there and uses one of those, but that would be a moot usage, anyway.
If I am sitting at the machine, I do not need to send myself a message that I am about to shut it down.
But there may be remote users. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On Mon, 6 Feb 2017 11:03:10 +0100 Carlos E. R. wrote:
On 2017-02-06 09:25, Fraser_Bell wrote:
On 02/05/2017 06:58 AM, Carlos E. R. wrote:
On 2017-02-05 15:00, James Knott wrote:
On 02/05/2017 12:39 AM, Fraser_Bell wrote:
Is there another way? Or, have things changed enough that the message is done differently?
It's been a while since I've used it, but there is a way to create a pop up message, at least in KDE. I've long since forgotten the details.
Yes, but one needs a way to pop up a message in all desktops, no matter if it is gnome, kde, xfce...
Yes. Exactly.
The KDE pop-up message that was supposed to do that was xmessage or zenity(?), I believe, but it does not work from an SSH login. Have not tested it while sitting at the machine in question, maybe it works then, or if root is in the GUI and opens a terminal there and uses one of those, but that would be a moot usage, anyway.
If I am sitting at the machine, I do not need to send myself a message that I am about to shut it down.
But there may be remote users.
I keep expecting to see libnotify or libnotify-tools pulled into in this thread. From the archlinux wiki: "Libnotify is an implementation of the Desktop Notifications Specification which provides support for GTK+ and Qt applications and is desktop independent ... In order to use libnotify, you have to install a notification server. ... KDE Plasma provides a notification server itself. Notifications are displayed ..." -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 06/02/17 10:28, Carl Hartung wrote:
In order to use libnotify, you have to install a notification server. ... KDE Plasma provides a notification server itself. Notifications are displayed ..."
And if that's what I think it is, that can be a pain in the neck too. I regularly get messages where only the first few characters are displayed in the available space, and I don't have a clue how to get at the rest of the message ... Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sunday, 5 February 2017 09:00:28 GMT James Knott wrote:
On 02/05/2017 12:39 AM, Fraser_Bell wrote:
Is there another way? Or, have things changed enough that the message is done differently?
It's been a while since I've used it, but there is a way to create a pop up message, at least in KDE. I've long since forgotten the details.
Was it "kwrited"? According to its description, it picks up wall messages -- opensuse:tumbleweed:20170203 Qt: 5.7.1 KDE Frameworks: 5.30.0 KDE Plasma: 5.9.0 kwin5-5.9.0-1.1.x86_64 kmail2 5.4.1 Kernel: 4.9.6-1-default Nouveau: 1.0.13_2.2 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/06/2017 02:20 AM, ianseeks wrote:
On Sunday, 5 February 2017 09:00:28 GMT James Knott wrote:
On 02/05/2017 12:39 AM, Fraser_Bell wrote:
Is there another way? Or, have things changed enough that the message is done differently? It's been a while since I've used it, but there is a way to create a pop up message, at least in KDE. I've long since forgotten the details. Was it "kwrited"? According to its description, it picks up wall messages
Might be, but it's been years. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Fraser_Bell <Fraser_Bell@openSUSE.org> [02-05-17 00:41]:
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?
wall (1) - write a message to all users is is provided in util-linux another quite old application. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 Photos: http://wahoo.no-ip.org/piwigo @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 05.02.2017 um 16:03 schrieb Patrick Shanahan:
Is there another way?
wall (1) - write a message to all users is is provided in util-linux
I've tried it, and the message appears in terminal windows but I didn't get any message in the gui (XFCE4). Karl -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Karl Sinn <news@budostore.de> [02-05-17 10:09]:
Am 05.02.2017 um 16:03 schrieb Patrick Shanahan:
Is there another way?
wall (1) - write a message to all users is is provided in util-linux
I've tried it, and the message appears in terminal windows but I didn't get any message in the gui (XFCE4).
I just did a test in kde/plasma5 and see it in all pts for all users including root, but only see it in ttys for <user>, no root. when broadcasting the message as root, it appears in *all* terminals for *all* users. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 Photos: http://wahoo.no-ip.org/piwigo @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Sun, 5 Feb 2017 10:15:41 -0500 Patrick Shanahan <paka@opensuse.org> wrote:
* Karl Sinn <news@budostore.de> [02-05-17 10:09]:
Am 05.02.2017 um 16:03 schrieb Patrick Shanahan:
Is there another way?
wall (1) - write a message to all users is is provided in util-linux
I've tried it, and the message appears in terminal windows but I didn't get any message in the gui (XFCE4).
I just did a test in kde/plasma5 and see it in all pts for all users including root, but only see it in ttys for <user>, no root.
when broadcasting the message as root, it appears in *all* terminals for *all* users.
Doesn't display anything here on lxde (gtk) gui even when broadcast as root. Ralph -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
I've tried it, and the message appears in terminal windows but I didn't get any message in the gui (XFCE4).
I just did a test in kde/plasma5 and see it in all pts for all users including root, but only see it in ttys for <user>, no root.
when broadcasting the message as root, it appears in *all* terminals for *all* users.
yes, but only in terminals. If you have no terminal open you'll never get the message -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
wall (1) - write a message to all users is is provided in util-linux
another quite old application. -- But does that assume users are working at a terminal? I've met plenty of
On 05/02/17 15:03, Patrick Shanahan wrote: programs like that over the years and they wrote to all terminals. If the user's not got a terminal session, they're not going to see it (and often won't see it even if they do). Is there an easy way (1) to block new logins, and (2) to see who's logged in? Okay, it wasn't *nix, but that was always my standard technique - disable logins, log everyone out, and reboot. And my kde - when you try to shut down - kicks up a warning saying who else is logged in. Important seeing as it's the family server and often has multiple sessions on vt7, vt8, vt9, and occasionally even more :-) Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/05/2017 10:21 AM, Wols Lists wrote:
But does that assume users are working at a terminal?
https://en.wikipedia.org/wiki/Teletype_Model_33 ;-) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 05/02/17 15:03, Patrick Shanahan wrote:
wall (1) - write a message to all users is is provided in util-linux
another quite old application. --
Well, that only sends messages to terminals, not to the desktop. If someone is working on a spreadsheet in OpenOffice or a photo in GIMP, or something else like that on the desktop, they will not see the warning. Instead the machine just suddenly shuts down at the appointed time losing their work and leaving them with their jaws wide open. On 02/05/2017 07:21 AM, Wols Lists wrote:
But does that assume users are working at a terminal? I've met plenty of programs like that over the years and they wrote to all terminals. If the user's not got a terminal session, they're not going to see it (and often won't see it even if they do).
Is there an easy way (1) to block new logins,
Cheers, Wol
The shutdown command itself, when given with a time (as in, not "shutdown now") will block new logins as the appointed time approaches. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
* Fraser_Bell <Fraser_Bell@openSUSE.org> [02-06-17 03:21]:
On 05/02/17 15:03, Patrick Shanahan wrote:
wall (1) - write a message to all users is is provided in util-linux
another quite old application. --
Well, that only sends messages to terminals, not to the desktop. If someone is working on a spreadsheet in OpenOffice or a photo in GIMP, or something else like that on the desktop, they will not see the warning. Instead the machine just suddenly shuts down at the appointed time losing their work and leaving them with their jaws wide open.
There are people that do not work from a terminal? -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 Photos: http://wahoo.no-ip.org/piwigo @ http://linuxcounter.net -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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
On 2017-02-05 22:38, Michael Hamilton wrote:
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.'
How do you tell which user to send to? cer@Telcontar:~> notify-send --help Usage: notify-send [OPTION...] <SUMMARY> [BODY] - create a notification Help Options: -?, --help Show help options Application Options: -u, --urgency=LEVEL Specifies the urgency level (low, normal, critical). -t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification. -a, --app-name=APP_NAME Specifies the app name for the icon -i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display. -c, --category=TYPE[,TYPE...] Specifies the notification category. -h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte. -v, --version Version of the package. cer@Telcontar:~> -u is for urgency, not user. Ah, you set the DISPLAY variable and run as that user. Interesting... What about those users that are not running a full desktop, but only a remote app via ssh? Mmm, perhaps on that terminal, via wall. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On 02/05/2017 02:07 PM, Carlos E. R. wrote:
What about those users that are not running a full desktop, but only a remote app via ssh? Mmm, perhaps on that terminal, via wall.
Yes. Both Wall and the message in the shutdown command itself display in the terminal window, including to the remote ssh user logged in at the time. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/05/2017 01:38 PM, Michael Hamilton wrote:
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
Thanks, Michael, I will test it out, but I am not sure what to expect. I have tested with notify-send, xmessage, Wall, and at the time I am writing this I do not know what others I have tried before I wrote the original posting, but so far none work as expected and none send a pop-up note of any type in front of someone in the GUI. They will only get the message if they happen to be working in the terminal at the time, and even then might not spot it. Someone earlier mentioned they have tested Wall and it works: Well, it does *not* pop up a message or notification into the GUI, only to terminals. If you are in a terminal started within the GUI, you will get the message *in the terminal window*, but if the window is minimized, or you are not looking in the terminal at the time, you will see nothing. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-02-06 09:07, Fraser_Bell wrote:
I have tested with notify-send, xmessage, Wall, and at the time I am writing this I do not know what others I have tried before I wrote the original posting, but so far none work as expected and none send a pop-up note of any type in front of someone in the GUI.
I tested notify-send, and it does pop up a message, ant least in xfce. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On Mon, 6 Feb 2017 11:07:20 +0100 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 2017-02-06 09:07, Fraser_Bell wrote:
I have tested with notify-send, xmessage, Wall, and at the time I am writing this I do not know what others I have tried before I wrote the original posting, but so far none work as expected and none send a pop-up note of any type in front of someone in the GUI.
I tested notify-send, and it does pop up a message, ant least in xfce.
I tested it too, and it didn't appear to do anything in LXDE on 42.1 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Mon, 06 Feb 2017, Dave Howorth wrote:
On Mon, 6 Feb 2017 11:07:20 +0100 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 2017-02-06 09:07, Fraser_Bell wrote:
I have tested with notify-send, xmessage, Wall, and at the time I am writing this I do not know what others I have tried before I wrote the original posting, but so far none work as expected and none send a pop-up note of any type in front of someone in the GUI.
I tested notify-send, and it does pop up a message, ant least in xfce.
I tested it too, and it didn't appear to do anything in LXDE on 42.1
On 42.2 I see that xfce is running its own xfce4-notifyd, which is probably why it works out of the box. According to various google searches concerning missing notifications in LXDE, if you install the notification-daemon, then LXDE should show notifications. But I don't have a LXDE desktop, so I can't be sure. There is also this link which includes info on implementations for many desktops (but curiously not LXDE): https://wiki.archlinux.org/index.php/Desktop_notifications It's interesting that the above page does not include a description of any wall like capability. The closest being an example of using sudo from root in the manner of the example script I posted previously. This appears to be a shortcoming in the notification facilities. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Tue, 7 Feb 2017 08:16:17 +1300 Michael Hamilton <michael@actrix.gen.nz> wrote:
On Mon, 06 Feb 2017, Dave Howorth wrote:
On Mon, 6 Feb 2017 11:07:20 +0100 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 2017-02-06 09:07, Fraser_Bell wrote:
I have tested with notify-send, xmessage, Wall, and at the time I am writing this I do not know what others I have tried before I wrote the original posting, but so far none work as expected and none send a pop-up note of any type in front of someone in the GUI.
I tested notify-send, and it does pop up a message, ant least in xfce.
I tested it too, and it didn't appear to do anything in LXDE on 42.1
On 42.2 I see that xfce is running its own xfce4-notifyd, which is probably why it works out of the box.
According to various google searches concerning missing notifications in LXDE, if you install the notification-daemon, then LXDE should show notifications. But I don't have a LXDE desktop, so I can't be sure.
I haven't done any investigation, but notification-daemon is installed.
There is also this link which includes info on implementations for many desktops (but curiously not LXDE):
https://wiki.archlinux.org/index.php/Desktop_notifications
It's interesting that the above page does not include a description of any wall like capability. The closest being an example of using sudo from root in the manner of the example script I posted previously. This appears to be a shortcoming in the notification facilities.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 02/06/2017 1:11 PM, Dave Howorth wrote:
On Tue, 7 Feb 2017 08:16:17 +1300
I haven't done any investigation, but notification-daemon is installed.
There is also this link which includes info on implementations for many desktops (but curiously not LXDE):
https://wiki.archlinux.org/index.php/Desktop_notifications
It's interesting that the above page does not include a description of any wall like capability. The closest being an example of using sudo from root in the manner of the example script I posted previously. This appears to be a shortcoming in the notification facilities.
Not wanting to be redundant, because I don't have the whole thread here.... but Is there any chance the settings in /etc/systemd/journald.conf is not allowing the passing of message due to either MaxLevelWall or ForwardToWall? Or are we sure it is a user presentation issue in the DE? -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2017-02-06 22:19, John Andersen wrote:
Not wanting to be redundant, because I don't have the whole thread here....
but Is there any chance the settings in /etc/systemd/journald.conf is not allowing the passing of message due to either MaxLevelWall or ForwardToWall?
Or are we sure it is a user presentation issue in the DE?
The original problem is wanting to tell all users, in any terminal or desktop, that the system is going down in five minutes: shutdown -r +5 "Server will restart in 5 minutes. \ Please save your work." This does not work for desktop users. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)
On Mon, 06 Feb 2017, Fraser_Bell wrote:
On 02/05/2017 01:38 PM, Michael Hamilton wrote:
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
Thanks, Michael, I will test it out, but I am not sure what to expect.
I have tested with notify-send, xmessage, Wall, and at the time I am writing this I do not know what others I have tried before I wrote the original posting, but so far none work as expected and none send a pop-up note of any type in front of someone in the GUI.
They will only get the message if they happen to be working in the terminal at the time, and even then might not spot it.
Someone earlier mentioned they have tested Wall and it works: Well, it does *not* pop up a message or notification into the GUI, only to terminals.
If you are in a terminal started within the GUI, you will get the message *in the terminal window*, but if the window is minimized, or you are not looking in the terminal at the time, you will see nothing.
If a reasonable window manager is running, notify-send as each user should work. But it's true that notify-send won't work if the desktop lacks a listener for the message. I had another go at a script and this time added an option to use xterm to popup the message. (Plus I re-coded the script to be less clever with bash because I wasn't convinced that the one I originally modified was totally clear or correct). ---- snip ---- #!/bin/bash # Example usage: notify-send-all Going on holiday on 10 minutes PATH=/usr/bin # Set this to use an xterm instead of send-notify USE_XTERM=1 who | awk '$NF ~ /^\(.*:[0-9]+(\.[0-9])*\)$/ {gsub(/[()]/,"", $NF); print $1, $NF}'|sort -u | while read username displayname do if [ $USE_XTERM ] then msg="$@" # run an xterm as the username to echo out the message sudo -u "$username" DISPLAY="$displayname" xterm -geometry "130x10+400+400" -title Warning -e "echo $msg; sleep 10000" & else sudo -u "$username" DISPLAY="$displayname" notify-send "$@" fi done ---- snip ---- bash -x notify-send-all the sky is falling in two minutes I used Xephyr to test more than one display and confirmed this works. Something like kdialog might also be used, but xterm is a lowest common denominator. It's not pleasing that this kind code is necessary. I guess no one has been that concerned about the corner cases. Most people have a sophisticated desktop all to themselves. A remaining problem is that If anyone gets a display running without getting a utmp entry, then who won't be able to report their existence. For example, I had to start an xterm in Xephyr to get a utmp entry before testing. Cheers, Michael -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (12)
-
Carl Hartung
-
Carlos E. R.
-
Dave Howorth
-
Fraser_Bell
-
ianseeks
-
James Knott
-
John Andersen
-
Karl Sinn
-
listreader
-
Michael Hamilton
-
Patrick Shanahan
-
Wols Lists