Where are startup scripts in ddwrt

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2
Author Message
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed Mar 30, 2022 11:20    Post subject: Reply with quote
No sweat there are more important things than DDWRT Wink

The problem with startup are the dependencies.
To avoid catch 22 situations services are started without taking dependent services into account and therefore have to start again.

It is very difficult to take all possible setups into account and when trying to untangle things the chances are real that you break things.

I tried to look at it but it takes bigger brains than me to solve this.

egc's inverse relationship:
Quote:
There is an inverse relation between coding skills and communication skills


Luckily there are exceptions

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, 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
Sponsor
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Wed Mar 30, 2022 12:56    Post subject: Reply with quote
If only life were that simple.
_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Wed Mar 30, 2022 14:43    Post subject: Reply with quote
egc wrote:
No sweat there are more important things than DDWRT Wink

The problem with startup are the dependencies.
To avoid catch 22 situations services are started without taking dependent services into account and therefore have to start again.

It is very difficult to take all possible setups into account and when trying to untangle things the chances are real that you break things.

Well, OS textbook answers: semaphores & critical section? file (e.g. pid) locking? There had to be something that made everyone just hands-up.

Maybe this critical section was just started too early.... just delay it? Smile


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sun May 01, 2022 10:49    Post subject: Reply with quote
jwh7 wrote:
emm wrote:
This script file is more or less I am looking for, but for broadcom ddwrt. So source code is only direction? Are there any development documentation regarding boot phase?
http://svn.dd-wrt.com/browser/src/router/services/sysinit/

Thank you!

Lately I was playing with USB Startup Script (/tmp/.rc_usb), I came across this portion of DD-WRT source codes(line numbers: 2962 - 2980). I think it might help me understand sysinit.

From: https://svn.dd-wrt.com/browser/src/router/services/networking/firewall.c?rev=13372

Code:

           /*
2962            * begin Sveasoft add
2963            */
2964           /*
2965            * run rc_firewall script
2966            */
2967           cprintf("Exec RC Filewall\n");
2968   #ifdef HAVE_REGISTER
2969           if (isregistered_real())
2970   #endif
2971                   runStartup("/jffs/etc/config", ".prewall");     // if available
2972                   runStartup("/mmc/etc/config", ".prewall");      // if available
2973                   runStartup("/tmp/etc/config", ".prewall");      // if available
2974                   if (create_rc_file(RC_FIREWALL) == 0) {
2975                           setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin", 1);
2976                           system2("/tmp/.rc_firewall");
2977                   }
2978           runStartup("/etc/config", ".firewall");
2979   
2980           cprintf("Ready\n");




Related:

https://svn.dd-wrt.com/changeset/13372

DD-WRT の Unbound 有効化でハマった話(あるいはDNSSECの罠) | ネットワークとともに
(starting unbound in routers without real-time clock)
https://www.infrastudy.com/?p=1280

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT 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