Startup scripts on JFFS not executing - My solution

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
gravitron
DD-WRT Novice


Joined: 13 May 2017
Posts: 3

PostPosted: Wed Mar 18, 2020 15:24    Post subject: Startup scripts on JFFS not executing - My solution Reply with quote
Here's how I addressed the issue of ever-increasing time before the USB drive hosting my JFFS becomes available. That situation leads to the startup script(s) on JFFS never being executed.

In the Administration->Commands screen, create a startup script in NVRAM that looks like this:

#!/bin/sh
until [ -f /jffs/IPL.sh -a `nvram get wan_ipaddr` != "0.0.0.0" ]; do
sleep 1
done
/bin/sh /jffs/IPL.sh


In essence, the NVRAM startup script launches the JFFS startup script (IPL.sh in my setup) only after (1) USB drive is mounted and (2) WAN is up. It checks for those 2 conditions every second. That way, no need to code a fixed delay that might need adjustments.

Hope this helps someone else.
Sponsor
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 153

PostPosted: Sun Mar 22, 2020 20:31    Post subject: Reply with quote
Thanks for sharing! I just noticed entware wasn't always starting up on my dev/backup router. Added a one-liner based on yours as the first startup command and the race condition is gone. The second line is the usual entware startup command.

Code:
/bin/sh -c 'until [ -f /opt/etc/init.d/rc.unslung ]; do sleep 1 ; done'
/opt/etc/init.d/rc.unslung start
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC 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 can attach files in this forum
You can download files in this forum