Browse Source

Fix numerous issues with login/logouts

content-update
xpetit 3 years ago
parent
commit
f9f5f1b582
No known key found for this signature in database
GPG Key ID: 97C60669182C17A5
  1. 6
      sh/debian/ubuntu/configure.sh
  2. 10
      sh/debian/ubuntu/system/etc/gdm3/PostLogin/Default
  3. 7
      sh/debian/ubuntu/system/etc/gdm3/PostSession/Default
  4. 25
      sh/debian/ubuntu/system/usr/local/bin/reset_home

6
sh/debian/ubuntu/configure.sh diff.vendored

@ -346,6 +346,12 @@ plymouth-quit-wait.service
# shellcheck disable=2086
systemctl mask $services
# Logout quickly
cat <<EOF >>/etc/systemd/logind.conf
KillUserProcesses=yes
UserStopDelaySec=0
EOF
# Disable GTK hidden scroll bars
echo GTK_OVERLAY_SCROLLING=0 >> /etc/environment

10
sh/debian/ubuntu/system/etc/gdm3/PostLogin/Default diff.vendored

@ -25,10 +25,6 @@ PS4='-\D{%F %T} '
# Print commands and their arguments as they are executed.
set -x
# Make sure the mountpoints are free
kill $(lsof -t "$HOME" /mnt) ||:
umount "$HOME" /mnt ||:
if test -e /dev/disk/by-partlabel/01-home; then
mount -o noatime /dev/disk/by-partlabel/01-home /mnt
else
@ -45,6 +41,6 @@ temp_path=/mnt/.01/tmp
mkdir -p "$user_path" "$temp_path"
chown -R "$USER":"$USER" "$user_path" "$temp_path"
mount -t overlay -o lowerdir="$HOME",upperdir="$user_path",workdir="$temp_path" overlay "$HOME"
mkdir -p "$HOME"/.cache
mount -t tmpfs -o size=2G tmpfs "$HOME"/.cache
mount -t overlay -o lowerdir=/home/student,upperdir="$user_path",workdir="$temp_path" overlay /home/student
mkdir -p /home/student/.cache
mount -t tmpfs -o size=2G tmpfs /home/student/.cache

7
sh/debian/ubuntu/system/etc/gdm3/PostSession/Default diff.vendored

@ -17,10 +17,5 @@ PS4='-\D{%F %T} '
set -x
passwd -d "$USER" ||:
systemctl stop user@1000.service
# Make sure the mountpoints are free
kill $(lsof -t "$HOME" /mnt) $(ps --no-headers -u "$USER" -o pid)
umount "$HOME"/.cache "$HOME" /mnt
umount /dev/disk/by-partlabel/01-home ||:
/usr/sbin/wipefs -a /dev/disk/by-partlabel/01-tmp-home
systemd-run /usr/local/bin/reset_home

25
sh/debian/ubuntu/system/usr/local/bin/reset_home diff.vendored

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Log stdout & stderr
exec > >(tee -i /tmp/reset_home.log) 2>&1
# Exit immediately if a command exits with a non-zero status.
set -e
# The value of this parameter is expanded like PS1 and the expanded value is the
# prompt printed before the command line is echoed when the -x option is set
# (see The Set Builtin). The first character of the expanded value is replicated
# multiple times, as necessary, to indicate multiple levels of indirection.
# \D{%F %T} prints date like this : 2019-12-31 23:59:59
PS4='-\D{%F %T} '
# Print commands and their arguments as they are executed.
set -x
# Make sure the mountpoints are free
loginctl terminate-user student
sleep 0.1
umount /home/student/.cache /home/student /mnt
umount /dev/disk/by-partlabel/01-home ||:
/usr/sbin/wipefs -a /dev/disk/by-partlabel/01-tmp-home
Loading…
Cancel
Save