PacketFence
Bug Tracking System

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000328PacketFence 1.7public2008-05-28 15:162008-06-02 11:51
Reporterjsnapp 
Assigned Touser4 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000328: iptables.bak should be saved and restored when a restart is run too
DescriptionWhile 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.
TagsNo tags attached.
fixed in mtn revision
Attached Filestxt file icon PFCMD_Control_Function.txt [^] (1,403 bytes) 2008-05-28 15:16 [Show Content]

- Relationships

-  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

- Issue History
Date Modified Username Field Change
2008-05-28 15:16 jsnapp New Issue
2008-05-28 15:16 jsnapp File Added: PFCMD_Control_Function.txt
2008-05-28 23:08 user4 Status new => assigned
2008-05-28 23:08 user4 Assigned To => user4
2008-06-02 11:48 user4 Note Added: 0000730
2008-06-02 11:51 user4 Status assigned => closed
2008-06-02 11:51 user4 Note Added: 0000731
2008-06-02 11:51 user4 Resolution open => fixed


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker