Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have 8 Kiosk PCs that I manually patch via SSH. Is there a way after I apply the patches to send a message to the remote PC notifying any users that the system is going to reboot in x minutes? I am running Suse and tried the shutdown -r +1 System is going to reboot in 1 minute but the message doesn't broadcast to the remote PC. I basically want to notify any user that may be logged in to wrap up before the PC reboots.
In your /etc/systemdown.txt text file place something like this.
System is going down in one minute.
Please save and exit.
The use of & on the xmessage line drops the screen display to the background so the script contiues on. If not then the user can hold the script to the user clicks OK.
Also Gnome uses notification daemon so it might be prettier if you do something like
Code:
notify-send "Reboot" "System is going down for a reboot in 1 minute for upgrades. Please save all your work.
instead of xmessage. See if it works : ). You can also use notify-send --help to see the other options. Emergency could be turned high and a nice picture added. I'm also pretty sure your script will have to find out which X display is being used and use that for transfering the message.
Also Gnome uses notification daemon so it might be prettier if you do something like
Code:
notify-send "Reboot" "System is going down for a reboot in 1 minute for upgrades. Please save all your work.
instead of xmessage. See if it works : ). You can also use notify-send --help to see the other options. Emergency could be turned high and a nice picture added. I'm also pretty sure your script will have to find out which X display is being used and use that for transfering the message.
Is there something else that needs to be done for the notify-send to work. I looked and the notification daemon is running but I fire that command off in a terminal window and it just gives me the > and just sites there. What am I doing wrong?
Is there something else that needs to be done for the notify-send to work. I looked and the notification daemon is running but I fire that command off in a terminal window and it just gives me the > and just sites there. What am I doing wrong?
Hehe, I missed a quote. Here:
Code:
notify-send "Reboot" "System is going down for a reboot in 1 minute for upgrades. Please save all your work."
I tried it out again but it only pops up on the PC I am working on. Does this not work if using SSH? Here is what I am doing.
I connect to the remote PC via SSH. I keyed in the net-send command "Rebooting" "System is going to reboot in 15 minutes to apply updates." I receive the message on the host PC and don't see anything happening on the remote PC I am ssh'ing into.
Afaik, the $DISPLAY variable has to be set to the display that is currently used on the remote computer. I have never successfully tried that so I think someone else can help you better with this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.