Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook into SDDM close-down routine to ensure ZFS homedirs are unmount without hardcoded homedirs #102

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next
Hook into SDDM close-down routine to ensure ZFS homedirs are unmount …
…without hardcoded homedirs
  • Loading branch information
panicketchup committed May 22, 2020
commit 0da743696d0afb093cf95c905a33acbce27ead32
@@ -8,16 +8,12 @@
# CAVEATS: Assumes that the user homedir is always /usr/home/[username]
# This will need to be fixed later
# ===============================
ulist=$(users)
for dir in $(ls /usr/home)
do
echo "${ulist}" | grep -q "${dir}"
if [ $? -ne 0 ] ; then
#User not logged in any more
mount | grep -q "on /usr/home/${dir} type zfs"
if [ $? -eq 0 ] ; then
#Homedir is a still-mounted ZFS dataset
zfs unmount -f /usr/home/${dir}
fi
fi
done

ulist=$(last | awk 'NR==1 {print $1}' | grep -f - /etc/passwd | cut -d":" -f6 | tee)

if [ $? -ne '0' ] ; then
exit
else
umount -R ${ulist}
zfs unmount -f ${ulist}
fi