1

When I press power button in usb keyboard/ir the program offer me a menu "shudown reboot exit.." I want to shutdown it immediately when i press button, how to do?

3
  • 1
    AFAIK there's no setting to change the exit behavior. Commented Nov 8 at 10:28
  • 1
    On standard kodi using X11 I have obtain what I want. Only one problem: it use X11, so I use xfce, so is probably a behavior of Xfce power manager instead of kodi. Commented Nov 8 at 17:31
  • I wonder if this would help you askubuntu.com/questions/460/…? I realise it's pretty old so I don't know if it's still valid. Commented Nov 9 at 16:38

1 Answer 1

1

Create a shortcut on the screen:

  • For sufficiently fresh systemd:
sudo poweroff --force --no-wtmp --no-sync --no-wall 
  • This will work for any Linux distro but it's a reboot command:
echo r | sudo tee /proc/sysrq-trigger 

Both these commands will shutdown/reboot your system without closing any apps or writing any data to the disk. In short data will be lost.

4
  • Why add the --no-sync, why risk the data loss that may come with? AFAIK cache will not prevent the shutdown, just add a few ms to the shutdown sequence. Commented Nov 9 at 16:29
  • There is no screen, is kodi only on omsc. Commented Nov 9 at 19:20
  • @PhilipCouling They said "I want to shutdown it immediately when i press button, how to do?" Syncing caches can take quite some time. Commented Nov 22 at 10:38
  • @ArtemS.Tashkinov okay this answer should pobobably contain a caveat to explain that since it's a very specific interpretation of the word "immediately". In context of the question I think many would read that word as meaning only "don't wait for user confirmation" and not expect skipping other important shutdown steps. Commented Nov 22 at 10:56

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.