Skip to content

Commit 230b4be

Browse files
Merge pull request #3097 from aleksandrychev/ENT-13638_3.24.x
ENT-13638: Fixed SELinux context on apachectl after template repair (3.24.x)
2 parents c86bdaa + 77be758 commit 230b4be

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cfe_internal/enterprise/mission_portal.cf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,28 @@ bundle agent apachectl_patched_for_upgrade
5858
edit_template => "$(this.promise_dirname)/templates/apachectl.mustache",
5959
handle => "apachectl_content_pre_create_default_templated_files",
6060
template_method => "mustache",
61-
template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }');
61+
template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }'),
62+
classes => results("bundle", "apachectl_file");
6263

6364
_running_cfengine_version_where_templated_files_NOT_automatically_created::
6465
"$(sys.workdir)/httpd/bin/apachectl"
6566
create => "true",
6667
edit_template => "$(this.promise_dirname)/templates/apachectl.mustache",
6768
handle => "apachectl_content_post_create_default_templated_files",
6869
template_method => "mustache",
69-
template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }');
70+
template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }'),
71+
classes => results("bundle", "apachectl_file");
7072

7173
cfengine::
7274
"$(sys.workdir)/httpd/bin/apachectl"
7375
handle => "apachectl_perms",
7476
perms => mog( "0755", "root", "root" );
77+
78+
commands:
79+
# This only runs if apachectl touched (repaired) and restorecon path exists
80+
apachectl_file_repaired.default:_stdlib_path_exists_restorecon::
81+
"$(default:paths.restorecon) $(sys.workdir)/httpd/bin/apachectl"
82+
comment => "Ensure the templated apachectl has the correct SELinux context.";
7583
}
7684

7785
bundle agent cfe_internal_enterprise_mission_portal_apache

0 commit comments

Comments
 (0)