We have PC’s in the field that we would like to be able to reboot remotely. To do this we just FTP a file into a specific folder when our application sees this file it reboots the PC by running “shutdown -r”. However we have only been able to make this work using Debian. I need to be able to make this work in OpenSuse 15.3. Currently all that seems to happen is the PC halts but never reboots. Is there a more reliable method to ensure the PC actually reboots. Since these PC’s are hundreds of miles away in remote areas we use XRDP to connect remotely to them and having a reliable method to reboot them is must have feature.
In our lab if I open a terminal and enter sudo shutdown -r now and after I enter the password my remote desktop session ends but the PC never reboots. Since I have access to the PC in the lab I connected a screen and all I see is blank screen. The computer never reboots. The same is true if I login locally issue the same command the result is the same just a blank screen.
This a brand new computer with a fresh install of Leap 15.3.
The bit about the FTP is just a little background about the proposed method for remotely rebooting. The real problem is that shutdown -r does not work from the Linux console. It seems to just halt the PC.
I had this issue but it was hardware related - specific to a Lenovo X1 Carbon gen-9 laptop, where it would not reliably shutdown nor restart with the 5.3.18 kernel. After updating to the 5.14.11 kernel that problem disappeared.
However I suspect the OPs issue, while similar symptoms, is a different issue.
Not sure if this is relevant, but when using ssh to the computers on my network, I simply use the reboot command rather than shutdown -r and it works well. According the the man pages, all of these commands “should” work, but YMMV.
-r as an option to systemctl doesn’t look relevant to rebooting, so likely the result of shutting down using -r isn’t unexpected. I’ve been mostly using the reboot command for several years, but ISTR trying the shutdown command now & then, as I’ve known it’s a symlink, and not getting either a shutdown or a reboot.
The problem is IMHO not on how to get the the command executed in the remote system (most done of course using SSH, but in this case done by storing a file in it using FTP, that then is detected by a local program/script) but the fact that the command does not do what is expected.
As long as shutdown -r does not “work”, it is irrelevant how it is initiated.
As I said, the shutdown command is now executed by systemctl (and this backward compatibility is done using a soft link). This does however NOT mean that all of the shutdown man page (like -r option) are not working anymore as defined in the shutdown man page.
The systemctl program will be designed so that it detects that it is called as “shutdown” and then honour (at least it has to honour) all arguments as defined in the shutdown man page. This is transparent to the user.
As I tried to explain, all versions of starting a reboot mentioned above should “work”. It is the system itself that is the problem.
And I am still waiting for the OP to report on what at least one or two of the offered alternatives do on the system. Of course because I want to be 1000% sure that
systemctl isolate reboot
are all not working (or otherwise, you never know until you tried it).