-
Notifications
You must be signed in to change notification settings - Fork 698
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12486 from Mab879/systemd_unit_rule_updates
Update select rules for RHEL not to modify systemd units in /usr
- Loading branch information
Showing
12 changed files
with
91 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...x_os/guide/system/accounts/accounts-physical/require_emergency_target_auth/bash/shared.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...counts/accounts-physical/require_emergency_target_auth/tests/correct_value_dropin.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_fedora,multi_platform_rhel,multi_platform_sle | ||
rm -f /etc/systemd/system/emergency.service | ||
mkdir -p /etc/systemd/system/emergency.service.d/ | ||
cat << EOF > /etc/systemd/system/emergency.service.d/10-automatus.conf | ||
[Service] | ||
ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency | ||
EOF |
8 changes: 8 additions & 0 deletions
8
...accounts/accounts-physical/require_emergency_target_auth/tests/wrong_value_dropin.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_fedora,multi_platform_rhel,multi_platform_sle | ||
rm -f /etc/systemd/system/emergency.service | ||
mkdir -p /etc/systemd/system/emergency.service.d/ | ||
cat << EOF > /etc/systemd/system/emergency.service.d/10-oscap.conf | ||
[Service] | ||
ExecStart=/bin/bash | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 3 additions & 9 deletions
12
linux_os/guide/system/accounts/accounts-physical/require_singleuser_auth/bash/shared.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
# platform = multi_platform_all | ||
|
||
service_file="/usr/lib/systemd/system/rescue.service" | ||
|
||
{{% if product in ["fedora", "ol8", "ol9", "sle12", "sle15",] or 'rhel' in product -%}} | ||
sulogin="/usr/lib/systemd/systemd-sulogin-shell rescue" | ||
{{% set sulogin="-/usr/lib/systemd/systemd-sulogin-shell rescue" %}} | ||
{{%- else -%}} | ||
sulogin='/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' | ||
{{% set sulogin='-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' %}} | ||
{{%- endif %}} | ||
|
||
if grep "^ExecStart=.*" "$service_file" ; then | ||
sed -i "s%^ExecStart=.*%ExecStart=-$sulogin%" "$service_file" | ||
else | ||
echo "ExecStart=-$sulogin" >> "$service_file" | ||
fi | ||
{{{ bash_ensure_ini_config("/etc/systemd/system/rescue.service.d/10-oscap.conf", "Service", "ExecStart", sulogin) }}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...de/system/accounts/accounts-physical/require_singleuser_auth/tests/correct_dropin.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_fedora,multi_platform_rhel | ||
rm -rf /etc/systemd/system/rescue.service.d | ||
mkdir -p /etc/systemd/system/rescue.service.d | ||
cat << EOF > /etc/systemd/system/rescue.service.d/10-automatus.conf | ||
[Service] | ||
ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue | ||
EOF |
2 changes: 1 addition & 1 deletion
2
...ide/system/accounts/accounts-physical/require_singleuser_auth/tests/correct_value.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...uide/system/accounts/accounts-physical/require_singleuser_auth/tests/wrong_dropin.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# platform = multi_platform_fedora,multi_platform_rhel | ||
rm -rf /etc/systemd/system/rescue.service.d | ||
mkdir -p /etc/systemd/system/rescue.service.d | ||
cat << EOF > /etc/systemd/system/rescue.service.d/10-automatus.conf | ||
[Service] | ||
ExecStart=/bin/bash | ||
EOF |