Joined: 16 Nov 2015 Posts: 6446 Location: UK, London, just across the river..
Posted: Sun Dec 19, 2021 13:06 Post subject: SOLVED - How to force reboot via CLI
Moderator note 10.23.23: Moved to General Forum from Atheros - kp69
Hi guy's
It seems its not my first time that happens, but sometimes after CLI flash i loose control over the router and cannot reboot or execute any other command...like shell is gone...47874>47893
I can use dropbear but no commands or GUI access..
apart of physical reboot is there a way how to reactivate shell via SSh?
Joined: 08 May 2018 Posts: 14244 Location: Texas, USA
Posted: Mon Dec 20, 2021 17:54 Post subject:
Whatever shutdown scripts you are running should probably be removed or disabled when you are upgrading via CLI as it seems to cause issues. If you have the same issues upgrading via webUI, then you should probably consider this when upgrading by any method. To answer your question: the only option is a reboot by power switch, most likely, since I don't know if 'poweroff' will get you in trouble. _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Joined: 16 Nov 2015 Posts: 6446 Location: UK, London, just across the river..
Posted: Tue Dec 21, 2021 13:46 Post subject:
giuliomagnifico wrote:
Already tried reboot -f (force)?
10's giuliomagnifico as it came into my mind, i tried it too, but it seams for some odd reason, shell is down, it happens, sometimes...once in a while..
KP-69 noting in the shutdown script that will interfere...and if i have no physical access to the button or power switch, it's funny...have to wait...its a company router, where only i have control over it and its locked in the IT network room ...
In fact router is fully functional..
so, my idea was if i can break something, like shutdown/kill vital process via htop and force it to autoshutdown kind of...or a way to restart shell.. _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Joined: 08 May 2018 Posts: 14244 Location: Texas, USA
Posted: Tue Dec 21, 2021 17:08 Post subject:
Alozaros wrote:
KP-69 noting in the shutdown script that will interfere...and if i have no physical access to the button or power switch, it's funny...have to wait...its a company router, where only i have control over it and its locked in the IT network room
Nothing to see here... you bricked one of these because your shutdown script hung the router, and I am not the one who said this in the emails
Joined: 08 May 2018 Posts: 14244 Location: Texas, USA
Posted: Tue Dec 21, 2021 21:51 Post subject:
I'm sure there is a valid explanation for what caused this, but we'll never get it. I have a couple of these in service myself with DD-WRT and have no issues upgrading via webUI or CLI or using a reboot command via ssh. There's more to the picture than meets the eye here. Not trying to play rugby here or be rude, it's just pretty obvious that there is something wrong and it is user-induced. _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Joined: 16 Nov 2015 Posts: 6446 Location: UK, London, just across the river..
Posted: Wed Dec 22, 2021 6:39 Post subject:
kernel-panic69 wrote:
I'm sure there is a valid explanation for what caused this, but we'll never get it. I have a couple of these in service myself with DD-WRT and have no issues upgrading via webUI or CLI or using a reboot command via ssh. There's more to the picture than meets the eye here. Not trying to play rugby here or be rude, it's just pretty obvious that there is something wrong and it is user-induced.
it could be (not that you are rude )... up to a use err..
the odd bit... it happens on random basis...not only on my 1043v2 and not every time...for example with almost identical set up, it happened on 1 of the 1043v2 but not on the other 1043v2... _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Joined: 16 Nov 2015 Posts: 6446 Location: UK, London, just across the river..
Posted: Sun Oct 22, 2023 12:35 Post subject:
this started to happens every time i flash via CLI (ssh) and than try to reboot R7800..
reboot
/tmp/.rc_shutdown: line 2: /opt/etc/init.d/rc.unslung: not found
-sh: /sbin/reboot: I/O error
for the record..it wasn't like that and its been all alright ever since, it now happens again on random basis on various routers...
is there any chance to force the reboot via CLI, anyhow ? (consider im away of the unit)...
-i tried...to unmount the USB (it doesn't matter, it happens again)
-I tried to stop USB from GUI and removed the shutdown script as well the USB itself..there is no more this report /tmp/.rc_shutdown: line 2: /opt/etc/init.d/rc.unslung: not found, but it still ends with -sh: /sbin/reboot: I/O error
currently happens on R7800 since i moved to 53714 from 53694 but it happened when i moved from k4 to k6.1 for first time...
-tried various command to reboot/restart/shutdown still end with -sh: /sbin/reboot: I/O error
-tried various services to restart..but some come up with -sh: /sbin/reboot: I/O error..
-i used the name firmware.bin it didn't reboot...-sh: /sbin/reboot: I/O error...
Ive found the cure:
this will immediately reboot the system...
echo b > /proc/sysrq-trigger _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Joined: 08 May 2018 Posts: 14244 Location: Texas, USA
Posted: Sun Oct 22, 2023 14:09 Post subject:
Alozaros wrote:
Ive found the cure:
this will immediately reboot the system...
echo b > /proc/sysrq-trigger
Something I hadn't considered earlier in the discussion, thanks for the update. It's still safest to use the /tmp/firmware.bin method, as long as you're not concerned with bricking. 10x again for the follow-up, Aloz! _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Ive found the cure:
this will immediately reboot the system...
echo b > /proc/sysrq-trigger
Something I hadn't considered earlier in the discussion, thanks for the update. It's still safest to use the /tmp/firmware.bin method, as long as you're not concerned with bricking. 10x again for the follow-up, Aloz!
When the I/O error happens with /sbin/reboot is the file there at all with ls? Should easyddup look for a particular error return code from /sbin/reboot after attempting to run it?
Running Alozaros's alternative reboot command is great if the normal/clean reboot command is missing/failing. If someone can get into the state where /sbin/reboot fails could you share the output of these commands so easyddup could reliably detect this situation?
ls -l /sbin/reboot
/sbin/reboot ; echo $?
Using the /tmp/firmware.bin method might work too but seems like a bigger change since the current method has many years of testing behind it.
Joined: 16 Nov 2015 Posts: 6446 Location: UK, London, just across the river..
Posted: Sun Oct 22, 2023 16:39 Post subject:
yoyoma2 i guess even in a CLI flash, there are some services that shut down...
in my case after the cli flash, there was no more sbin directory to access...after reboot it reappeared....
as i said i had a believe it happens due to the USB or something..unfortunately..its not USB related, more likely something odd..
output is 0 (zero) and router rebooted...
/sbin/reboot ; echo $?
0
ls -l /sbin/reboot - output is ok it lists the stuff ...
but as i said i had to go trough lots of different try's and nothing..until ive found
echo b > /proc/sysrq-trigger would reboot... _________________ Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Joined: 26 Mar 2013 Posts: 1858 Location: Hung Hom, Hong Kong
Posted: Mon Oct 23, 2023 4:27 Post subject:
giuliomagnifico wrote:
Already tried reboot -f (force)?
Try "reboot -n"!?
I usually run "sync" three times before rebooting my Linux and router... old habit...
Now that I saw this question, it seemed that DD-WRT's /sbin/reboot is not exactly what I expected in from standard Linux. You don't really need the "-n". There is no "--help" as well.
And DD-WRT does not have shutdown the command as well.
Alozaros wrote:
but as i said i had to go trough lots of different try's and nothing..until ive found
echo b > /proc/sysrq-trigger would reboot...