[opensuse-packaging] How to do a %post action, like calling yast firewall configuration?
Hi, I want to add a firewall rule for SSH on a package installation. This is currently done in %post section. But on OpenSUSE I get `/sys filesystem is not mounted' error. The package has this build issue but on target host it installs correctly. ========= SNIP ========= %post %if 0%{?suse_version} >= 1110 yast2 firewall services add service=service:sshd zone=EXT %else yast2 firewall services add service=ssh zone=EXT %endif ========= SNIP ========= ========= BUILD LOG SNIP ========= The /sys filesystem is not mounted. If you are running in a chroot environment, bind-mount missing filesystems. ========= BUILD LOG SNIP ========= This is an internal TESTING package so managing firewall is OK even if otherwise it would not be appropriate. Is there way how to do this "correct and clean" way? Cheers, -- Pavel Kačer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
I forgot to mention to put me into reply CC because I am not subscribed. Thanks! -- Pavel Kačer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
El 04/08/14 a las #4, Pavel Kačer escribió:
Is there way how to do this "correct and clean" way?
RPM scriptlets are not intended to be used for this purpose. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
You can use sysconf_addword to add it directly to the SuSEfirewall2 config file. sysconf_addword /etc/sysconfig/SuSEfirewall2 FW_CONFIGURATIONS_EXT sshd -- Later, Darin On Mon, Aug 4, 2014 at 7:48 AM, Pavel Kačer <pkacer@suse.com> wrote:
Hi,
I want to add a firewall rule for SSH on a package installation. This is currently done in %post section. But on OpenSUSE I get `/sys filesystem is not mounted' error. The package has this build issue but on target host it installs correctly.
========= SNIP ========= %post %if 0%{?suse_version} >= 1110 yast2 firewall services add service=service:sshd zone=EXT %else yast2 firewall services add service=ssh zone=EXT %endif ========= SNIP =========
========= BUILD LOG SNIP ========= The /sys filesystem is not mounted. If you are running in a chroot environment, bind-mount missing filesystems. ========= BUILD LOG SNIP =========
This is an internal TESTING package so managing firewall is OK even if otherwise it would not be appropriate.
Is there way how to do this "correct and clean" way?
Cheers, -- Pavel Kačer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (3)
-
Cristian Rodríguez
-
Darin Perusich
-
Pavel Kačer