What's new

firewall-start runns three (3) times at reboot?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Bamsefar

Senior Member
I thought there was a thread about 380.58 - but I can not find it for the moment.

Anyway, my problem seems a bit older. I can not say why since I simply don't know: But for some odd reason my /jffs/scripts/firewall-start script is started three (3) times after reboot.

Anyone have any idea why it is so? and if so what I can do to prevent this?
 
Not much at all...

Code:
#!/bin/sh

echo "0 * * * * /jffs/scripts/firewall save" > /var/spool/cron/crontabs/admin
[ -n "`pidof crond`" ] && killall -q crond

sleep 5
crond
sh /jffs/scripts/firewall

nohup /jffs/scripts/CheckIfHome2 &

The last line of code is mine - the rest is from a thread here on this forum...
 
If you copy that into SSH shell and se what that throw out, that will tell you some useful info.
But try at end:
fi
exit 0
 
Nothing unexpected at all - and the problem is actually not the script it self - it is that it is STARTED by the firmware THREE times - and nothing else.
 
Try to use debug as i show you. Then you can see what happens.
 
I fail to see how debug the script itself will not solve the ground fact that the script is called from external source three times.
 
I fail to see how debug the script itself will not solve the ground fact that the script is called from external source three times.
Then you have a chance to se where it called 3 times or other trouble.
 
Well I replaced my /jffs/scripts/firewall-start script with nothing, and I still got multiple starts - so it is not the script it self, it is some part of the firmware that starts more than once.
 
What do try to start here: nohup /jffs/scripts/CheckIfHome2 &

The nohup command can continue even after you have removed firewall-start script.
You must "killall" to terminate.
http://www.computerhope.com/unix/unohup.htm
 
Last edited:
It should continue - that's the point. This script checks to see if either of the mobiles are on the local WiFi system, and then sends a command to my Fibaro HC2. It is supposed to runt 7*24. And it is still not the reason for the issue I have, since I did test to run with an empty firewall-start script and I still had lines like this in Systemlog:

Aug 1 02:00:34 custom script: Running /jffs/scripts/firewall-start (args: eth0)
 
But for some odd reason my /jffs/scripts/firewall-start script is started three (3) times after reboot.

Anyone have any idea why it is so? and if so what I can do to prevent this?

Haven't looked into why but that's the way it's. Considered "normal" I believe. It has to do with the hooks placed in the firmware to call firewall-start to begin with.

If you only want some of your own script to be run once on startup, consider another custom script such as services-start/other appropriate ones.

Or do a bit more elaborated scripting to prevent your script being run a redundant number of times.
 
Yes I have added some code into my own CheckIfHome2 script to prevent it from being started more than once - the rest of the scripts are from this forum - I guess I have to modify them also...
 
Remember that most services on the router are event driven. So here is an easy scenario to get at least 2 starts of the firewall....
- During boot your ISP provides an IPv4 address
- Firewall starts to configure for IPv4 now that it knows your WAN address
- ISP (or tunnel provider) provides IPv6 address and prefix
- Firewall now needs to also support the IPv6 configuration, so restarts

Think of what other options you are using which may need to be reflected in the firewall, and you'll come up others. Many of the services can start/stop several times during the boot process....another example is if you have multiple USB devices. Things like Samba for example can be restarted as each device is mounted.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top