Public bug reported:

Binary package hint: cryptsetup

Today I configured encrypted backup on an external hard drive, mostly based on
http://www.saout.de/tikiwiki/tiki-index.php?page=EncryptedDeviceUsingLUKS

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/rules.d/50-nick.rules:

   KERNEL=="sd?1", ATTRS{serial}=="DEF10BBE1D0D", NAME="$kernel", \
      SYMLINK+="bakker", RUN+="/usr/sbin/invoke-rc.d cryptdisks restart 
cryptbak"

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/cryptdisks.functions.  These are lines 30-34:

   # Always output to console
   stdin=`readlink /proc/self/fd/0`
   if [ "${stdin#/dev/null}" != "$stdin" ] && [ "$ON_VT" != "yes" ]; then
       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.

** Affects: cryptsetup (Ubuntu)
     Importance: Undecided
         Status: New

-- 
cryptdisks failure when called from udev
https://bugs.launchpad.net/bugs/178829
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to