how to force reboot via CLI

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 5180
Location: UK, London, just across the river..

PostPosted: Sun Dec 19, 2021 13:06    Post subject: how to force reboot via CLI Reply with quote
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?


root@WR1043NDv2:~# reboot
-sh: nvram: I/O error
-sh: chmod: I/O error
-sh: /tmp/.rc_shutdown: Permission denied
-sh: /sbin/reboot: I/O error
root@WR1043NDv2:~#startservice httpd
-sh: nvram: I/O error

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 49599 WAP
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,AP Isolation,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -Gargoyle OS 1.13.0b AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear R7800 --DD-WRT 49626 Gateway,DNS,AD-Block,AP&Net Isolation,VLAN's,Firewall,DoT,Vanilla
Netgear R9000 --DD-WRT 49599 Gateway,DNS,AD-Block,AP Isolation,Firewall,Forced DNS,DoT,2,4Ghz only,Vanilla
Broadcom
Netgear R7000 ---DD-WRT 49626 Gateway,DNS,AD-Block,Firewall,Forced DNS,VLAN's,DoT,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 12855
Location: Texas, USA

PostPosted: Mon Dec 20, 2021 17:54    Post subject: Reply with quote
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"
Pogo - A minimal level of ability is expected and needed...
At some point, people just get plain tired of this place.

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
giuliomagnifico
DD-WRT User


Joined: 11 Apr 2016
Posts: 454
Location: Italy

PostPosted: Tue Dec 21, 2021 10:39    Post subject: Reply with quote
Already tried reboot -f (force)?
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 5180
Location: UK, London, just across the river..

PostPosted: Tue Dec 21, 2021 13:46    Post subject: Reply with quote
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 Razz ...

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 49599 WAP
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,AP Isolation,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -Gargoyle OS 1.13.0b AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear R7800 --DD-WRT 49626 Gateway,DNS,AD-Block,AP&Net Isolation,VLAN's,Firewall,DoT,Vanilla
Netgear R9000 --DD-WRT 49599 Gateway,DNS,AD-Block,AP Isolation,Firewall,Forced DNS,DoT,2,4Ghz only,Vanilla
Broadcom
Netgear R7000 ---DD-WRT 49626 Gateway,DNS,AD-Block,Firewall,Forced DNS,VLAN's,DoT,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 10079
Location: Netherlands

PostPosted: Tue Dec 21, 2021 14:02    Post subject: Reply with quote
Why not upload the file as "firmware.bin" it will update automatically (and reboot etc) if cron is running
_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 12855
Location: Texas, USA

PostPosted: Tue Dec 21, 2021 17:08    Post subject: Reply with quote
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 Razz

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 Rolling Eyes

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=330820
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1250813#1250792

egc wrote:
Why not upload the file as "firmware.bin" it will update automatically (and reboot etc) if cron is running

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=331072

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Pogo - A minimal level of ability is expected and needed...
At some point, people just get plain tired of this place.

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 5180
Location: UK, London, just across the river..

PostPosted: Tue Dec 21, 2021 17:09    Post subject: Reply with quote
egc wrote:
Why not upload the file as "firmware.bin" it will update automatically (and reboot etc) if cron is running


yep my next move... Razz

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 49599 WAP
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,AP Isolation,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -Gargoyle OS 1.13.0b AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear R7800 --DD-WRT 49626 Gateway,DNS,AD-Block,AP&Net Isolation,VLAN's,Firewall,DoT,Vanilla
Netgear R9000 --DD-WRT 49599 Gateway,DNS,AD-Block,AP Isolation,Firewall,Forced DNS,DoT,2,4Ghz only,Vanilla
Broadcom
Netgear R7000 ---DD-WRT 49626 Gateway,DNS,AD-Block,Firewall,Forced DNS,VLAN's,DoT,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 286

PostPosted: Tue Dec 21, 2021 20:09    Post subject: Reply with quote
I would try /sbin/reboot like easyddup does since by default reboot is a function in /etc/profile

Welcome to "the general mass.." Wink ref. first reply to easyddup thread.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 12855
Location: Texas, USA

PostPosted: Tue Dec 21, 2021 21:51    Post subject: Reply with quote
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"
Pogo - A minimal level of ability is expected and needed...
At some point, people just get plain tired of this place.

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 5180
Location: UK, London, just across the river..

PostPosted: Wed Dec 22, 2021 6:39    Post subject: Reply with quote
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 Razz )... 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 49599 WAP
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,AP Isolation,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -DD-WRT 49599 Gateway,DNS,Ad-Block,Firewall,Forced DNS,DoT,VPN,VLAN
TP-Link WR1043NDv2 -Gargoyle OS 1.13.0b AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear R7800 --DD-WRT 49626 Gateway,DNS,AD-Block,AP&Net Isolation,VLAN's,Firewall,DoT,Vanilla
Netgear R9000 --DD-WRT 49599 Gateway,DNS,AD-Block,AP Isolation,Firewall,Forced DNS,DoT,2,4Ghz only,Vanilla
Broadcom
Netgear R7000 ---DD-WRT 49626 Gateway,DNS,AD-Block,Firewall,Forced DNS,VLAN's,DoT,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 by mac913
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum