dvohwinkel
Senior Member
I made my own watchdog that runs from cron to check connections. The entry survives a firewall restart but not a reboot. How can I get my entry in crontab to survive a reboot?
Make a script to reload the cron settings at restart.I made my own watchdog that runs from cron to check connections. The entry survives a firewall restart but not a reboot. How can I get my entry in crontab to survive a reboot?
Make a script to reload the cron settings at restart.
that works. I made an init-script in /jffs/scripts/ and it adds an entry to the crontab. Thanks for the help.How do I add to cron from a script? Just add to the /var/spool/crontab/{USER} file?
I would suggest:Actually adding the init-start to /jffs/scripts/ didn't work on reboot. When I manually ran init-start it added fine, but it didn't seem to run on it's own on reboot. I was chmod 755 .. I'll put the simple thing below (init-start)
#!/bin/shAny ideas why it didn't run or why it wouldn't work on reboot but would work when run manually?
echo "*/5 * * * * sh /jffs/scripts/firewall_watchdog.sh" >> /var/spool/cron/crontabs/dave
#!/bin/sh
cru a fwwatchdog "*/5 * * * * sh /jffs/scripts/firewall_watchdog.sh"
Actually adding the init-start to /jffs/scripts/ didn't work on reboot. When I manually ran init-start it added fine, but it didn't seem to run on it's own on reboot. I was chmod 755 .. I'll put the simple thing below (init-start)
#!/bin/shAny ideas why it didn't run or why it wouldn't work on reboot but would work when run manually?
echo "*/5 * * * * sh /jffs/scripts/firewall_watchdog.sh" >> /var/spool/cron/crontabs/dave
I would suggest:
Code:#!/bin/sh cru a fwwatchdog "*/5 * * * * sh /jffs/scripts/firewall_watchdog.sh"
Do you have JFFS scripts enabled on the Administration / System page?Interesting.. I had not seen that before. The problem is it does not seem to be running init-start at all as the logger I put in it didn't run either.
Do you have JFFS scripts enabled on the Administration / System page?
How did you create your init-start script? Using VI on the router or upload from a PC?yes as I also use Skynet which requires it and works fine.
dos2unix /jffs/scripts/init-start
ls -l /jffs/scripts
How did you create your init-start script? Using VI on the router or upload from a PC?
Try runningEdit: Nevermind you said it works when run manually.
Code:dos2unix /jffs/scripts/init-start
Or for another set of eyes, post the output of
Code:ls -l /jffs/scripts
Post the entire unedited contents of init-start. There be something in there that we're missing.
Are you running it manually asIt was created with vi inside the router and runs fine when ran manually. The logger does not show up in syslog unless ran manually.
/jffs/scripts/init-start
sh /jffs/scripts/init-start
Are you running it manually as
as the router would, or are you running it asCode:/jffs/scripts/init-start
Try the first variant if not already done.Code:sh /jffs/scripts/init-start
Sorry @dvohwinkel I gave you bad advice. I should have double-checked.
init-start is too early in the boot process, you should be using services-start.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!