cryptdisks failure when called from udev
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cryptsetup (Ubuntu) |
Fix Released
|
Low
|
Reinhard Tartler |
Bug Description
Binary package hint: cryptsetup
Today I configured encrypted backup on an external hard drive, mostly based on
http://
For convenience of testing I first set it up on a laptop running Debian sid/Lenny. Part of the config includes a udev rule which I placed in /etc/udev/
KERNEL=="sd?1", ATTRS{serial}
SYMLINK+
This worked fine. On plugging the hard drive cable into a USB port on the laptop, udev creates the symlink, calls cryptdisks to create the mapping (via an entry in /etc/crypttab), and a user can then mount the drive.
The same configuration on a PC running Ubuntu 7.10 did not work. When run from udev (and only then) the cryptdisks call failed with
exec: 34: env: not found
I found that I could make it work by removing some lines from
/lib/cryptdisks
# Always output to console
stdin=`readlink /proc/self/fd/0`
if [ "${stdin#
exec env ON_VT=yes /usr/bin/openvt -f -c `fgconsole` -w $0 "$@"
fi
The lines are not present in the current Debian sid package, Version 2:1.0.5-1.
Whether this is the best or correct way I have no idea, but the encrypted backup now works on 7.10.
About the PC,
$ uname -a
Linux carbon 2.6.22-14-server #1 SMP Tue Dec 18 05:52:24 UTC 2007 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 7.10
Release: 7.10
Codename: gutsy
cryptsetup is Version: 3.0.0-3ubuntu2.
Thanks for any comments.
This problem was also found and solved as outlined when usuing encrypted filesystem with CONCURENCY=shell (with none it works perfectly)
Call to /etc/init. d/cryptdisks will fail with the same message, removing this lines helped and everthing works now