Article 5QZ8V Can't run cryptsetup from udev?

Can't run cryptsetup from udev?

by
DaRkBoDoM
from LinuxQuestions.org on (#5QZ8V)
Hi there,

i have setup an udev rule to trigger a script when a USB drive containing a cryptsetup key-file is inserted:

Code:KERNEL=="sd[a-z]1", ATTRS{model}=="MyUSB", SYMLINK+="mysymlink", RUN+="/usr/local/bin/usbkmount"The script then mounts the USB drive and runs

Code:/sbin/cryptsetup --key-file /mnt/mysymlink/KEY luksOpen "$PHY_DEV" deviceMy problem is: everything runs fine if i run the script from the shell but, when the script runs from UDEV, i instead get an error:

Code:Cannot use serpent-cbc-essiv:sha256 cipher for keyslot encryption.
Keyslot open failed.What could be different in the enviroment of the script between the shell and udev and preventing it from loading the cyper? Any ideas?latest?d=yIl2AUoC8zA latest?i=T4eMC6gn8IU:I1LsDkA6obg:F7zBnMy latest?i=T4eMC6gn8IU:I1LsDkA6obg:V_sGLiP latest?d=qj6IDK7rITs latest?i=T4eMC6gn8IU:I1LsDkA6obg:gIN9vFwT4eMC6gn8IU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments