activate/deactivate firewall using Porteus Settings Centre
Posted: 25 Nov 2016, 11:19
I have a doubt about deactivating firewall using Porteus Settings Centre (PSC).
The PSC scripts seems to manage activation and deactivation by setting or unsetting execution permission to file /etc/rc4.d/S-firewall.sh which it creates if doesn't exits.
So when you select 'Activate firewall when Porteus starts' checkbox the PSC script run a 'chmod +x /etc/rc.d/rc4.d/S-firewall.sh' command and if not checked it runs the same chmod command but with -x argument.
That's ok but the PSC script seem to do nothing with /etc/rc.d/rc.Firewall execution bit, so it remains +x and thus rc.services call it when booting to start firewall:
so, that way firewall is always activated when booting Porteus, it is not possible to switch off from booting using PSC, the only way to switch it off is manually clearing x bit of rc.Firewall:
anyway, why using two models (slackware bsd scripts and slackware sysV-like scripts) to manage firewall activation at boot? wouldn't it be better for PSC to simply toggle x bit of /erc/rc.d/rc.FireWall file rather than create a sysV script file and toggle that (/etc/rc.d/rc4.d/S-firewall.sh)? and if doing that way using file S-firewall.sh I think PSC script should handle both files (rc,FireWall and S-firewall.sh), shouldn't it?
Is this ok? or I am misunderstanding something...
The PSC scripts seems to manage activation and deactivation by setting or unsetting execution permission to file /etc/rc4.d/S-firewall.sh which it creates if doesn't exits.
So when you select 'Activate firewall when Porteus starts' checkbox the PSC script run a 'chmod +x /etc/rc.d/rc4.d/S-firewall.sh' command and if not checked it runs the same chmod command but with -x argument.
Code: Select all
----file /opt/porteus-scripts/porteus-settings-centre ----
'`chkbox $FWALL chkFirewall "Activate firewall when Porteus starts"`'
<action>if true chmod +x /etc/rc.d/rc4.d/S-firewall.sh</action>
<action>if false chmod -x /etc/rc.d/rc4.d/S-firewall.sh</action>
<action>if true cp -a --parents /etc/rc.d/rc4.d/S-firewall.sh $PSC_SETTINGS</action>
<action>if false cp -a --parents /etc/rc.d/rc4.d/S-firewall.sh $PSC_SETTINGS</action></checkbox>
Code: Select all
----file /etc/rc.d/rc.services ----
# Enable firewall:
[ -x /etc/rc.d/rc.FireWall ] && sh /etc/rc.d/rc.FireWall start &
Code: Select all
# chmod a-x /etc/rc.d/rc.FireWall
Is this ok? or I am misunderstanding something...