mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
sm: remove /run/nologin when leaving runlevel S
On a system with systemd's tmpfiles.d files installed, only root can
log in after boot. The files have a boot-only entry:
f+! /run/nologin 0644 - - - "System is booting up. ..."
On systemd the file is removed by systemd-user-sessions when boot is
done. Finit runs the entry, but only removes /etc/nologin, so
pam_nologin keeps refusing everyone but root.
Remove /run/nologin too when leaving runlevel S.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
3 files changed
+21
No files matched your search
@@ -22,11 +22,18 @@ test_teardown()
|
||||
{
|
||||
say "Running test teardown."
|
||||
run "rm -rf $DIR $CONF /fastboot"
|
||||
rm -f "$NOLOGIN"
|
||||
}
|
||||
|
||||
# Removed at boot by an r! entry in Finit's own legacy.conf
|
||||
touch "${SYSROOT:-$(pwd)/$TEST_DIR/sysroot}/fastboot"
|
||||
|
||||
# What systemd's own tmpfiles.d has, logins are refused until boot is done
|
||||
NOLOGIN="${SYSROOT:-$(pwd)/$TEST_DIR/sysroot}/etc/tmpfiles.d/nologin.conf"
|
||||
mkdir -p "$(dirname "$NOLOGIN")"
|
||||
echo 'f+! /run/nologin 0644 - - - "System is booting up."' > "$NOLOGIN"
|
||||
echo 'f! /run/nologin-ran' >> "$NOLOGIN"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
. "$TEST_DIR/lib/setup.sh"
|
||||
|
||||
@@ -34,6 +41,11 @@ sep
|
||||
say 'Finit runs the boot-only entries, and removes, at boot'
|
||||
assert_exists /fastboot no
|
||||
|
||||
sep
|
||||
say 'Logins are let in again when boot is done'
|
||||
assert_exists /run/nologin-ran yes
|
||||
assert_exists /run/nologin no
|
||||
|
||||
run "cat > $CONF" <<CONF
|
||||
d $DIR
|
||||
f $DIR/always
|
||||
|
||||
Reference in new issue
Block a user