Skip to content

Commit

Permalink
systemd does not allow mount/umount in udev anymore. how fun.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Jan 9, 2024
1 parent 48769a2 commit 3e2f1ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions toxblinkenwall/process_usb_drive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,16 @@ usb_device_to_use="$usb_device""1"
rm -Rf "$mount_dir"/ >> "$logfile" 2>&1
mkdir -p "$mount_dir" >> "$logfile" 2>&1
echo "mounting $usb_device_to_use ..." >> "$logfile"
echo mount "$usb_device_to_use" "$mount_dir" >> "$logfile"
mount "$usb_device_to_use" "$mount_dir" >> "$logfile" 2>&1
echo systemd-mount --collect "$usb_device_to_use" "$mount_dir" >> "$logfile"
systemd-mount --collect "$usb_device_to_use" "$mount_dir" >> "$logfile" 2>&1
res=$?

if [ $res -ne 0 ]; then
echo "ERROR:mounting $usb_device_to_use" >> "$logfile"
echo "UNmounting $usb_device_to_use ..." >> "$logfile"
umount -f "$mount_dir" >> "$logfile" 2>&1
echo umount -f "$usb_device_to_use" >> "$logfile"
umount -f "$usb_device_to_use" >> "$logfile" 2>&1
systemd-umount "$mount_dir" >> "$logfile" 2>&1
echo systemd-umount "$usb_device_to_use" >> "$logfile"
systemd-umount "$usb_device_to_use" >> "$logfile" 2>&1
rm -Rf "$mount_dir"/ >> "$logfile" 2>&1
exit 1
fi
Expand Down Expand Up @@ -449,9 +449,9 @@ fi
# --------- IMPORT ---------

echo "UNmounting $usb_device_to_use ..." >> "$logfile"
umount -f "$mount_dir" >> "$logfile" 2>&1
echo umount -f "$usb_device_to_use" >> "$logfile"
umount -f "$usb_device_to_use" >> "$logfile" 2>&1
systemd-umount "$mount_dir" >> "$logfile" 2>&1
echo systemd-umount "$usb_device_to_use" >> "$logfile"
systemd-umount "$usb_device_to_use" >> "$logfile" 2>&1
rm -Rf "$mount_dir"/ >> "$logfile" 2>&1


Expand Down

0 comments on commit 3e2f1ce

Please sign in to comment.