Linux Mint shutdown immediately poweroff.target.

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

Hi I am Rupesh from India and I brought a new pc with AMD Ryzen zen3 5500GT APU and Asus prime b450 motherboard. I installed Linux Mint successfully and everything is working fine except I can't shutdown immediately.

When I press power button while the system is running it must shutdown immediately and properly without any questions but this is not happening.

Actually I am in a place where there are frequent power fluctuations and so I have followed a small trick to halt immediately and safely.

I created a symbolic link as follows

ln -sf /usr/lib/systemd/system/poweroff.target /etc/systemd/system/alt-ctrl-del.target

As I created symbolic link when I press the buttons alt ctrl del in console mode ie., command line the system must halt immediately and properly without any questions or confirmation but this is not happening.

From the past two years I am using the same technique to shutdown the Linux system immediately and safely.

At present I installed Fedora 40 and Arch Linux operating systems and created symbolic link same as above and when I press alt ctrl del in console mode they are halting safely and immediately.

Even in desktop environments like mate when I press power button it is asking for confirmation.

Kindly try to suggest how to shutdown immediately and safely without any confirmation and also try to suggest why the above symbolic link is not working.

Regards,
Rupesh.
User avatar
all41
Level 19
Level 19
Posts: 9941
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Linux Mint shutdown immediately poweroff.target.

Post by all41 »

In mint you can enter poweroff in the terminal.
You can make this into an executable icon just by
making a bash script in which poweroff is the command.
Right-click the file and make it executable.

You could also make a keyboard shortcut with poweroff in the command field.
Everything in life was difficult before it became easy.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

Okay can you suggest a procedure to halt immediately without any confirmation by pressing the buttons Ctrl Alt Del.

I mean how to assign shutdown procedure to the combination of keys Ctrl Alt Del.
User avatar
all41
Level 19
Level 19
Posts: 9941
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Linux Mint shutdown immediately poweroff.target.

Post by all41 »

Menu/Keyboard/Shortcuts.
You can add a new shortcut there.
Usually ctrl+alt+delete is pre-assigned to Logout or perhaps other function.
Suggest use something else--but if you want to use ctrl+alt+delete the utility
will explain how in a popup when you enter it..
Name the new shortcut poweroff (or anything)
In the command field of the new shortcut type: poweroff
Then go down to the top unassigned line and enter your preferred key sequence
Everything in life was difficult before it became easy.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

Thanks for your suggestions.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

I have assigned the buttons Ctrl Alt Del for shutdown in keyboard shortcuts.

Unfortunately when I press Ctrl Alt Del it is asking for confirmation.

Kindly try to suggest how to halt immediately without any confirmation.
Hawaiihemd
Level 5
Level 5
Posts: 520
Joined: Fri Sep 25, 2020 12:42 pm

Re: Linux Mint shutdown immediately poweroff.target.

Post by Hawaiihemd »

Try init 0 as the command to execute.
User avatar
all41
Level 19
Level 19
Posts: 9941
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Linux Mint shutdown immediately poweroff.target.

Post by all41 »

rupeshforu3 wrote: Tue Sep 03, 2024 6:27 am I have assigned the buttons Ctrl Alt Del for shutdown in keyboard shortcuts.

Unfortunately when I press Ctrl Alt Del it is asking for confirmation.

Kindly try to suggest how to halt immediately without any confirmation.
Don't assign the keys to the 'shutdown' function
Add a new shortcut named 'poweroff' with poweroff as the command.
Assign the keys there. For some reason MATE can't use ctrl+alt+delete key for this.
It asks for permission to reassign the keys and shows the reassignment but the keys do not work.
ctrl+alt+Pagedown works nicely.
ctrl+alt+delete reassignments work fine in Cinnamon and Xfce
Which Mint version and desktop are you using?
Everything in life was difficult before it became easy.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

Hi in cinnamon desktop I have created a new shortcut called poweoff and assigned Ctrl Alt Del to it.

After that I pressed Ctrl Alt Del and the system halted properly.

I restarted my system and booted into Mint and entered into Mate desktop and pressed the keys Ctrl Alt Del but unfortunately the system is asking for confirmation.

Kindly try to suggest how to halt immediately and safely without any confirmation.

The procedure must be universal to all desktop environments and window managers.
User avatar
all41
Level 19
Level 19
Posts: 9941
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Linux Mint shutdown immediately poweroff.target.

Post by all41 »

rupeshforu3 wrote: Wed Sep 04, 2024 5:39 am Hi in cinnamon desktop I have created a new shortcut called poweoff and assigned Ctrl Alt Del to it.

After that I pressed Ctrl Alt Del and the system halted properly.

I restarted my system and booted into Mint and entered into Mate desktop and pressed the keys Ctrl Alt Del but unfortunately the system is asking for confirmation.

Kindly try to suggest how to halt immediately and safely without any confirmation.

The procedure must be universal to all desktop environments and window managers.
Nope. No universality. MATE would nor reassign ctl+alt+del here either.
Did you try another key combination there?
I would use something like ctrl+alt+o (o for off) or ctrl+alt+p (p for power)
All the desktops use ctrl+alt+del for other purposes---if it has to be ctrl+alt+del on MATE I dion't know how.
Everything in life was difficult before it became easy.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

I have used Ctrl and Alt keys for poweroff but no use.

In cinnamon desktop when I press Ctrl Alt the system halts immediately and safely but in other desktop environments like mate and gnome it asks for confirmation.

I can't understand why symbolic link to poweoff.target is not working.

In all other Linux operating systems this particular symbolic link is working fine.
Hawaiihemd
Level 5
Level 5
Posts: 520
Joined: Fri Sep 25, 2020 12:42 pm

Re: Linux Mint shutdown immediately poweroff.target.

Post by Hawaiihemd »

Did you try if my suggestion works without a confirmation? For me it does.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

In cinnamon desktop for poweroff shortcut I have created keys Ctrl Alt p.

I used init 0 as command.

After logging into gnome desktop when I press Ctrl Alt p there's no action being performed neither halt nor logout.
Hawaiihemd
Level 5
Level 5
Posts: 520
Joined: Fri Sep 25, 2020 12:42 pm

Re: Linux Mint shutdown immediately poweroff.target.

Post by Hawaiihemd »

You are a little scarce with the info you are providing which makes it difficult to help you.
Please try to be a little more forthcoming in your answers and explanations.

So I gather you are using cinnamon, MATE and gnome now!?
Mind you, gnome is not a supported DE in this community.

In cinnamon, did init 0 give a confirmation dialog?
In cinnamon, did init 0 work at all to shutdown the system?
Did you setup the same keybinds in MATE and gnome independently?
After setting those up as well, what happens in each DE when you try to run init 0 via those keybinds?
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

Hi actually I am the fan of desktop environments and X Windows System and so I would like to use different desktop environments and window managers.

Different desktop environments in Mint has different shortcuts. In mate and xfce desktop environments I have created shortcuts for poweroff with buttons Ctrl Alt p and with command

Code: Select all

init 0
In cinnamon desktop when I press Ctrl Alt p the system is halted properly and immediately but in mate and xfce desktop environments when I press Ctrl Alt p it is showing menu with entries About,quit etc.,.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

Why can't Linux Mint community and developers create an universal method for all desktop environments and window managers to halt the system immediately and safely.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

As Linux Mint is based on Ubuntu Linux can I ask the same question in Ubuntu Linux forums.
rupeshforu3
Level 1
Level 1
Posts: 11
Joined: Mon Sep 02, 2024 8:09 am

Re: Linux Mint shutdown immediately poweroff.target.

Post by rupeshforu3 »

Hi there's something in the following webpage which is related to Ubuntu systemd shutdown.

https://manpages.ubuntu.com/manpages/fo ... ice.8.html
Post Reply

Return to “Hardware Support”