[asterisk-biz] 87.230.80.186 - Trying to register

Steve Edwards asterisk.org at sedwards.com
Wed Jun 30 18:34:38 CDT 2010


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       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-biz mailing list