Skip to content

Commit 756066c

Browse files
committed
feat: Add SELinux configuration for RedHat systems
1 parent 91977d8 commit 756066c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

installer/system.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ import (
1010

1111
func PrepareSystem(distro string) error {
1212
if distro == "redhat" {
13+
if err := utils.RunCmd("setenforce", "0"); err != nil {
14+
return fmt.Errorf("failed to disable SELinux immediately: %v", err)
15+
}
16+
17+
if err := utils.RunCmd("sed", "-i", "s/^SELINUX=.*/SELINUX=disabled/", "/etc/selinux/config"); err != nil {
18+
return fmt.Errorf("failed to configure permanent SELinux setting: %v", err)
19+
}
20+
1321
if err := utils.RunCmd("systemctl", "disable", "firewalld"); err != nil {
1422
return fmt.Errorf("failed to disable firewalld: %v", err)
1523
}

0 commit comments

Comments
 (0)