Force re-scan of script directories

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
notorious.dds
DD-WRT User


Joined: 24 May 2012
Posts: 372
Location: Michigan

PostPosted: Tue Jul 21, 2020 0:45    Post subject: Force re-scan of script directories Reply with quote
I've got a Netgear R6250 running build 43381 (06/10/20).

I cannot seem to find a build that doesn't have certain flaws. So, I've settled on this build and elected to script my way around the flaws. At any rate, my current issue is that the virtual AP dies whenever I apply any config changes in the gui. I discovered that I can get it going again by restarting 'wlconf'.

Consequently, I decided to write a script that would restart wlconf on wanup. If I enable jffs and put it in /jffs/etc/config, all is good. However, if I create the script in /tmp/etc/config by means of the following startup command:
Code:

/bin/mkdir /tmp/etc/config && printf "#!/bin/bash\n/sbin/stopservice wlconf && startservice wlconf" > /tmp/etc/config/fix_vap.wanup && /bin/chmod 755 /tmp/etc/config/*

it doesn't execute on wanup. I've verified that the script exists and works upon manual execution. (I have my reasons why I'd prefer the startup command vs utilizing JFFS, but I'd prefer not to get into that here.)

My suspicion is that the failure results from the firmware scaning the four script directories before the script is created via the startup command.

Does anyone know if it's possible to force a rescan of these script directories?

Thanks!
Sponsor
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 847

PostPosted: Tue Jul 21, 2020 23:15    Post subject: Reply with quote
I apologize for being off topic a little bit, but I have noticed a similar thing, but it takes a little bit longer for the virtual APs to get restarted.

Out of curiosity is there a reason for that thought?

Could you try having a link in JFFS to this location?

I will take some time to think and come back.
notorious.dds
DD-WRT User


Joined: 24 May 2012
Posts: 372
Location: Michigan

PostPosted: Wed Jul 22, 2020 0:23    Post subject: Reply with quote
Wildlion wrote:
I apologize for being off topic a little bit, but I have noticed a similar thing, but it takes a little bit longer for the virtual APs to get restarted.

Out of curiosity is there a reason for that thought?

Assuming that you're asking about my speculation as to why the script isn't running as desired, it's because I assumed it had to either be because:
    1. The build I'm using simply isn't looking in /tmp/etc/config for scripts (as I assume it should), or
    2. It just doesn't know that the script is present

I assumed that #1 was unlikely and that #2 could possibly be true if my specualated theory of directory scanning not occuring at the right time is valid.

Also, in my case, it's more than just a lagging restart. My VAPs don't restart at all without manually (or scripting) a restart of wlconf.

Wildlion wrote:
Could you try having a link in JFFS to this location?

/jffs is read-only until it is enabled. In which case, if I have to enable it, I can simply write the script directly into /jffs.

Looking forward to your thoughts. Thanks!
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 847

PostPosted: Wed Jul 22, 2020 2:00    Post subject: Reply with quote
DD-WRT does not use the exact same start up as sysVinit , but it is a stripped down version, so some of the same things do not work.

but based on looking at the code specifically:

https://svn.dd-wrt.com/browser/src/router/services/sysinit/sysinit.c

It is only run at system initialization and is not given access that I know of.

The only thing I can think of is to try the init command or rc commands (but again I know they are limited).

You might be able to get a usb drive to mount and then have it host the jffs file system.

I am a little surprised by this and maybe someone else knows why the system works this way.

Sorry for not being able to help much
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