-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SLE add ability to configure emergency via dropin
For SLE platforms add the possibilty to configure the emergency target auth via drop-in configuration file, rather than directly in the /usr/lib/systemd.. unit
- Loading branch information
1 parent
98d58ec
commit 23af3a8
Showing
3 changed files
with
72 additions
and
7 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
11 changes: 11 additions & 0 deletions
11
...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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
# platform = multi_platform_all | ||
|
||
{{% if 'sle' in product %}} | ||
service_dropin_cfg_dir="/etc/systemd/system/emergency.service.d" | ||
service_dropin_file="${service_dropin_cfg_dir}/10-oscap.conf" | ||
{{% else %}} | ||
service_file="/usr/lib/systemd/system/emergency.service" | ||
{{% endif %}} | ||
|
||
{{% if product in ["fedora", "ol8", "ol9", "rhel8", "rhel9", "sle12", "sle15"] -%}} | ||
sulogin="/usr/lib/systemd/systemd-sulogin-shell emergency" | ||
{{%- else -%}} | ||
sulogin='/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' | ||
{{%- endif %}} | ||
|
||
{{% if 'sle' in product %}} | ||
mkdir -p "${service_dropin_cfg_dir}" | ||
echo "[Service]" >> "${service_dropin_file}" | ||
echo "ExecStart=-$sulogin" >> "${service_dropin_file}" | ||
{{% else %}} | ||
if grep "^ExecStart=.*" "$service_file" ; then | ||
sed -i "s%^ExecStart=.*%ExecStart=-$sulogin%" "$service_file" | ||
else | ||
echo "ExecStart=-$sulogin" >> "$service_file" | ||
fi | ||
{{% endif %}} |
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