Skip to content

Commit

Permalink
systemd: set SYSTEMD_SULOGIN_FORCE=1 for emergency.service
Browse files Browse the repository at this point in the history
On error of the installer we invoke emergency.target. The executable
that gets called in emergency.service will won't give us a shell if
the root account is locked. We'll get a message like this:

```
Cannot open access to console, the root account is locked.
See sulogin(8) man page for more details.
```

We can force to login by setting SYSTEMD_SULOGIN_FORCE=1.
  • Loading branch information
dustymabe committed Jan 6, 2020
1 parent dd3aa1c commit 15a7926
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions systemd/coreos-installer-generator
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ if [ -n "$(karg coreos.inst.install_dev)" ]; then
if ! karg_bool coreos.inst.skip_reboot; then
touch /run/coreos-installer-reboot
fi

# Allow emergency.service to execute even with locked root account
mkdir -p /etc/systemd/system/emergency.service.d
echo -e '[Service]\nEnvironment=SYSTEMD_SULOGIN_FORCE=1\n' \
> /etc/systemd/system/emergency.service.d/override.conf
fi

0 comments on commit 15a7926

Please sign in to comment.