If you want to change the behaviour of Ctrl-Alt-Del to power-off you just need to change ctrl-alt-del.target to be a symlink to poweroff.target (as long as you are booting to the command line, booting to the desktop overrides this).

Code: Select all

pi@rpi3:~ $ cd /lib/systemd/system
pi@rpi3:/lib/systemd/system $ sudo ln -sf poweroff.target ctrl-alt-del.target

To change it back to rebooting then change the symlink back so that it points at reboot.target,

Code: Select all

pi@rpi3:~ $ cd /lib/systemd/system
pi@rpi3:/lib/systemd/system $ sudo ln -sf reboot.target ctrl-alt-del.target

Whatever you do don’t edit the file ctrl-alt-del.target itself as doing that will edit whichever file it is linked to (and hence alter the behaviour of reboot or poweroff).

By faiz

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *