Previously I have created a similar thread and creating a new because previous one doesn't have a solution and the current one has solution.
Hi Many of us use Linux desktop computer or even a server with optionally a secondary power supply such as ups etc.,. Many of of us but not all think to shutdown the system immediately and safely without turning on the monitor but don't know how to do so. I have found a solution and sharing with you which may help you.
I have asked many of you how to shutdown the system immediately and safely by pressing power button present in cabinet box without turning monitor on. Many of you suggested to buy a new apc ups or buy a RTL usb converter and connect ups with usb port and install a software etc. Some people suggested to click shutdown button in desktop environment etc.,.
But one person from tech enclave forum suggested a method and it working properly and I have tested a number of times. I am providing this method as it may help you and other people like me.
The procedure is as follows
Create a symbolic link in bash terminal as follows
Code:
sudo ln -sf /usr/lib/systemd/system/poweroff.target /etc/systemd/system/ctrl-alt-del.target
After this press ctrl-alt-f4 which should bring or switch from graphics to console login prompt.
After this press ctrl-alt-del which will instantly start shutting down your Linux system safely and immediately, without any confirmation.
Here after pressing Ctrl alt F1 I am at graphics login prompt and after pressing Ctrl alt f2 I am at desktop environment and after pressing Ctrl alt f4 I am at console login.
The above may vary from Linux distribution to distribution so try to press ctrl alt F1 or ctrl alt f2 or ctrl alt f3 ctrl alt f4 keys and any one can bring you to console login. After that press ctrl alt del which will shutdown system immediately and safely.
Note that all these happened with in 15 seconds even when my monitor is turned off.
Finally thanks to some of you who have given some suggestions and patience.
Regards,
Rupesh.