Hide Forgot
Description of problem: rhel5, rhel6 have different selinux contexts, which causes error during deployment when is there selinux context valid only for one platform Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. create cfg. channel with files, links (without selinux context filled) and register rhel5 rhel6 machines to this channel 2. find some selinux context, which is only on one platform and set this context for those files and links 3. execute 'rhncfg-client get --topdir=/tmp/topdir' or 'rhncfg-manager upload-channel channel-from-step-2 -t /tmp' Actual results: rhncfg-client get --topdir /tmp/topdir Traceback (most recent call last): File "/usr/bin/rhncfg-client", line 34, in ? sys.exit(Main().main() or 0) File "/usr/share/rhn/config_common/rhn_main.py", line 187, in main handler.run() File "/usr/share/rhn/config_client/rhncfgcli_get.py", line 25, in run self.options.exclude) File "/usr/share/rhn/config_common/deploy.py", line 53, in deploy_files dep_trans.add_preprocessed(path, processed_path, file_info, dirs_created) File "/usr/share/rhn/config_common/transactions.py", line 192, in add_preprocessed self._chown_chmod_chcon(processed_file_path, dest_path, file_info, strict_ownership=strict_ownership) File "/usr/share/rhn/config_common/transactions.py", line 160, in _chown_chmod_chcon raise Exception("failed to set selinux context on %s" % dest_path) Exception: failed to set selinux context on /tmp/topdir/tmp/config.cfg ################################# rhncfg-manager download-channel test-644985 -t /tmp Traceback (most recent call last): File "/usr/bin/rhncfg-manager", line 46, in <module> sys.exit(Main().main() or 0) File "/usr/share/rhn/config_common/rhn_main.py", line 187, in main handler.run() File "/usr/share/rhn/config_management/rhncfg_download_channel.py", line 52, in run config_channel=ns) File "/usr/share/rhn/config_common/deploy.py", line 53, in deploy_files dep_trans.add_preprocessed(path, processed_path, file_info, dirs_created) File "/usr/share/rhn/config_common/transactions.py", line 192, in add_preprocessed self._chown_chmod_chcon(processed_file_path, dest_path, file_info, strict_ownership=strict_ownership) File "/usr/share/rhn/config_common/transactions.py", line 159, in _chown_chmod_chcon if lsetfilecon(temp_file_path, sectx) < 0: Exception: ('failed to set selinux context on /tmp/test-644985/tmp/config.cfg', OSError(22, 'Invalid argument')) Expected results: rhncfg-manager download-channel test-644985 -t /tmp WARNING: skipping invalid selinux context Additional info:
It's supposed to work that way. For different selinux context for RHEL 5 and 6 put separate config files into separate channels for the respective OS.