Hard reboot over SSH?

For topics which do not fit in other specific forums.
chanunnaki
Posts: 105
Joined: Tue Jul 07, 2020 1:33 am
Been thanked: 19 times

Hard reboot over SSH?

Unread post by chanunnaki »

Is it possible?

I pulled my hair out for 20 minutes changing ini setting through ssh and rebooting from there, not realising that the reboot command performs a soft reboot and therefore none of the settings were taking.
Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: Hard reboot over SSH?

Unread post by Bas »

What does 'shutdown -r now' do? That's generally enough of a reboot to bring any regular Linux box back in line.
chanunnaki
Posts: 105
Joined: Tue Jul 07, 2020 1:33 am
Been thanked: 19 times

Re: Hard reboot over SSH?

Unread post by chanunnaki »

Bas wrote: Thu Mar 25, 2021 7:33 pm What does 'shutdown -r now' do? That's generally enough of a reboot to bring any regular Linux box back in line.
nothing. :P
Screenshot 2021-03-25 at 19.46.07.png
Screenshot 2021-03-25 at 19.46.07.png (59.42 KiB) Viewed 3685 times
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Hard reboot over SSH?

Unread post by aberu »

Correct, I believe a hard reboot has to be initiated through the menu core.

Try:

Code: Select all

reboot now
That's what the updater script uses:

Code: Select all

if [[ "${REBOOT_NEEDED}" == "true" ]] ; then
	if [[ "${AUTOREBOOT}" == "true" && "${REBOOT_PAUSE}" -ge 0 ]] ; then
		echo "Rebooting in ${REBOOT_PAUSE} seconds"
		sleep "${REBOOT_PAUSE}"
		reboot now
		else
		echo "You should reboot"
    fi
fi
But yes, a full hard reboot will likely require direct input.
birdybro~
chanunnaki
Posts: 105
Joined: Tue Jul 07, 2020 1:33 am
Been thanked: 19 times

Re: Hard reboot over SSH?

Unread post by chanunnaki »

aberu wrote: Thu Mar 25, 2021 7:51 pm Correct, I believe a hard reboot has to be initiated through the menu core.

Try:

Code: Select all

reboot now
That's what the updater script uses:

Code: Select all

if [[ "${REBOOT_NEEDED}" == "true" ]] ; then
	if [[ "${AUTOREBOOT}" == "true" && "${REBOOT_PAUSE}" -ge 0 ]] ; then
		echo "Rebooting in ${REBOOT_PAUSE} seconds"
		sleep "${REBOOT_PAUSE}"
		reboot now
		else
		echo "You should reboot"
    fi
fi
But yes, a full hard reboot will likely require direct input.
Thanks for this! It's not performing a full reboot, but it's enough for it to take new ini settings. So good enough :D
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Hard reboot over SSH?

Unread post by aberu »

No prob
birdybro~
User avatar
Sorgelig
Site Admin
Posts: 890
Joined: Thu May 21, 2020 9:49 pm
Has thanked: 2 times
Been thanked: 214 times

Re: Hard reboot over SSH?

Unread post by Sorgelig »

it doesn't even need any reset.
reload the core (or restart MiSTer binary) is enough to apply new ini settings.
Or you can choose the same ini config from OSD menu and it will also reload the core with new ini.
User avatar
darksakul
Posts: 353
Joined: Mon May 25, 2020 4:34 pm
Has thanked: 397 times
Been thanked: 73 times

Re: Hard reboot over SSH?

Unread post by darksakul »

I always though a hard reboot is physically turning off all power then turning back on again and booting up again.

if it's done by a code or script it's a soft reboot.
It is my great regret that we live in an age that is proud of machines that think and suspicious of people who try to.
Post Reply