[
https://issues.apache.org/jira/browse/BROOKLYN-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14058428#comment-14058428
]
ASF GitHub Bot commented on BROOKLYN-36:
----------------------------------------
Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/62#discussion_r14807785
--- Diff:
utils/common/src/main/java/brooklyn/util/ssh/IptablesCommands.java ---
@@ -93,7 +93,7 @@ public static String iptablesServiceStatus() {
*/
public static String saveIptablesRules() {
return BashCommands.alternatives(
- BashCommands.ifExecutableElse1("iptables-save",
sudo("iptables-save")),
+ BashCommands.ifExecutableElse1("apt-get",
BashCommands.installPackage("iptables-persistent")),
--- End diff --
does `apt-get`ting this package really cause the rules to be saved
immediately? i think you want to second command to be run irrespective of the
result of the former. perhaps also try running `iptables-save` as presumably
that worked somewhere, and it might work somewhere that `service iptables save`
and `/sbin/service iptables save` doesn't work ... if i've understood
correctly? /cc @grkvlt
i'd suggest (with `import static BashCommands.*` here, for brevity):
chain(
ok(install("iptables-persistent")),
alternatives(
iptablesService("save"),
"iptables-save"
))
> IptablesCommands.saveIptablesRules doesn't work as expected
> -----------------------------------------------------------
>
> Key: BROOKLYN-36
> URL: https://issues.apache.org/jira/browse/BROOKLYN-36
> Project: Brooklyn
> Issue Type: Bug
> Reporter: Andrea Turli
> Assignee: Andrea Turli
> Priority: Minor
> Fix For: 0.7.0-SNAPSHOT
>
>
> This needs to be revisited as the behavior is not as described at
> http://www.thomas-krenn.com/en/wiki/Saving_Iptables_Firewall_Rules_Permanently,
> for example
--
This message was sent by Atlassian JIRA
(v6.2#6252)