Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 525  / 3 Years ago, tue, november 23, 2021, 10:34:36

I'm making a computer like an arcade machine with an academic game. I'm using Xsession to replace the desktop by an application. It's working fine. But when I go out from the game it returns to the LightDM - login screen. But I desire to shuts down instead back to LightDM. It's possible to do this?



Custom User Defined Session:



[Desktop Entry]
Encoding=UTF-8
Name=RacingGameX
Comment=Just the game!
Exec=/usr/share/xsessions/gameBash.sh
Type=Application


Bash Script:



xscreensaver -nosplash &
xrandr -r 60
exec /usr/bin/RacingGameX/RacingGameXExecutable
xrandr -r 75
sleep 5
sudo shutdown now # <- that's not working


Thanks for the help!


More From » shutdown

 Answers
2

The syntax for shutdown from command line is



sudo shutdown -P now ## for system POWEROFF
sudo shutdown -h now ## for system HALT or POWEROFF


If that did not work we can also perform a forced poweroff



sudo poweroff --force


In case we start the script from a user session (as was the case in a custom session) we can either allow users to shutdown without root privileges (don't use sudo in your script then!) or follow answers to below questions to shutdown without root privileges from a user session:




[#21279] Wednesday, November 24, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
utonmbo

Total Points: 134
Total Questions: 104
Total Answers: 118

Location: Argentina
Member since Mon, Jan 3, 2022
2 Years ago
;