Esteemed community,
I am trying to dynamically mount a non-system, encrypted partition on a external hard drive on Fedora 42 using Veracrypt from the veracrypt-1.26.14-1.src.rpm. To this end, I created a rule ACTION=="add", SUBSYSTEM=="block", ATTRS{serial}=="1239238573726448294", RUN+="/home/amica/mount_veracrypt.sh" for the userspace device manager (udev) which executes a script containing the following command veracrypt --text --non-interactive --mount "$DEVICE_PATH" --keyfiles="$KEYFILE" "$MOUNT_POINT" when the device becomes connected. While the script mounts the partition successfully if executed from my standard user account using sudo it fails to do so when the device becomes connected and the UDEV rule gets triggered. Logging the script's error stream I get this generic error:
As I am unsure how to proceed from here, I decided to seek your advice. How would you start comparing the difference in environment from which the script is executed in the two scenarios (manually vs triggered by udev rule)? Any suggestion is appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Esteemed community,
I am trying to dynamically mount a non-system, encrypted partition on a external hard drive on Fedora 42 using Veracrypt from the veracrypt-1.26.14-1.src.rpm. To this end, I created a rule
ACTION=="add", SUBSYSTEM=="block", ATTRS{serial}=="1239238573726448294", RUN+="/home/amica/mount_veracrypt.sh"for the userspace device manager (udev) which executes a script containing the following commandveracrypt --text --non-interactive --mount "$DEVICE_PATH" --keyfiles="$KEYFILE" "$MOUNT_POINT"when the device becomes connected. While the script mounts the partition successfully if executed from my standard user account usingsudoit fails to do so when the device becomes connected and the UDEV rule gets triggered. Logging the script's error stream I get this generic error:As I am unsure how to proceed from here, I decided to seek your advice. How would you start comparing the difference in environment from which the script is executed in the two scenarios (manually vs triggered by udev rule)? Any suggestion is appreciated.