On Tue, 29 Jun 2010, James Sharp wrote: > Or make your changes to the iptables config file, then run: > > /etc/init.d/iptables restart; sleep 15; /etc/init.d/iptables stop > > The crontab trick is neat, but you can set yourself up with some > possible race conditions.
Ahh, Unix -- always more than 1 way to skin a cat. Now how to choose? What race conditions have you encountered? I like your trick and I'm sure I'll use it at some point in the future. It does have 2 weaknesses though: 1) If you miss-type the "stop" command, you may not find out until it's too late. The "crontab" method has the advantage that you can keep it "commented out" in root's crontab so you never have to type the command again. (I use this so often that my "create crontabs" script puts it in for me.) 2) If the new iptables rules cause your ssh session to "die" you're toast. Since the "crontab" method is scheduled as a separate process, it is not dependent on your session. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards [email protected] Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000 -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-biz mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-biz
