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?
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?