PacketFence - BTS - PacketFence 1.7
View Issue Details
0000328PacketFence 1.7public2008-05-28 15:162008-06-02 11:51
jsnapp 
user4 
normalminoralways
closedfixed 
 
 
0000328: iptables.bak should be saved and restored when a restart is run too
While troubleshooting an issue I reported in http://www.packetfence.org/mantis/view.php?id=327 [^]
I found what IMHO was some convoluted code in pf/bin/pfcmd, pf/bin/start and pf/bin/stop.

The "control" function code is identical in each of these three files.

The main issue I have is that the "control" function code doesn't do anything in terms of saving or restoring iptables when "control" receives the "restart" command. I also think that even when it does decide whether to do a "save_iptables" or a "restore_iptables" it does an inefficient job of it.

I believe that when a "restart" command is sent to "control" function the function should effectively call itself again with a "stop" command and then again with a "start" command. This way we can have a full restart that includes restarting iptables.

I also think it is important to move the restore_iptables test after the call to "service_ctl" since that way we can know for sure whether any services are still running before we restore_iptables.

I know it may be a long shot but I have attached a rewrite of the code for the "control" function that belongs in pf/bin/pfcmd, pf/bin/start and pf/bin/stop.
No tags attached.
txt PFCMD_Control_Function.txt (1,403) 2008-05-28 15:16
https://www.packetfence.org/bugs/file_download.php?file_id=35&type=bug
Issue History
2008-05-28 15:16jsnappNew Issue
2008-05-28 15:16jsnappFile Added: PFCMD_Control_Function.txt
2008-05-28 23:08user4Statusnew => assigned
2008-05-28 23:08user4Assigned To => user4
2008-06-02 11:48user4Note Added: 0000730
2008-06-02 11:51user4Statusassigned => closed
2008-06-02 11:51user4Note Added: 0000731
2008-06-02 11:51user4Resolutionopen => fixed

Notes
(0000730)
user4   
2008-06-02 11:48   
Thanks a lot for the suggested fix. I agree with it, with one minor modification. I added a test that restart calls stop/start only in the case when the service is 'pf' (i.e. all services). This way, a given daemon can have are more specific restart handling ...
(0000731)
user4   
2008-06-02 11:51   
fixed in mtn revision 00e115ceb83b5686bcbbfc98ff12ca7352dd1d13