Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 168691 - truecrypt not properly unmounted
Summary: truecrypt not properly unmounted
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-28 09:01 UTC by Jakob Truelsen
Modified: 2007-08-11 08:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
A patch that fixes the problem in most cases (halt.patch,402 bytes, patch)
2007-02-28 09:03 UTC, Jakob Truelsen
Details | Diff
Patch for halt.sh (halt.patch,311 bytes, patch)
2007-02-28 15:34 UTC, Jakob Truelsen
Details | Diff
A patch for the ebuild (truecrypt-4.2a-r3.patch,393 bytes, patch)
2007-02-28 15:35 UTC, Jakob Truelsen
Details | Diff
The stop part og the addon (truecrypt-4.2a-stop.sh,254 bytes, text/plain)
2007-02-28 15:36 UTC, Jakob Truelsen
Details
truecrypt-stop.sh (truecrypt-stop.sh,263 bytes, text/plain)
2007-03-01 17:21 UTC, Alon Bar-Lev (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jakob Truelsen 2007-02-28 09:01:31 UTC
If a truecrypt drive is mounted... / cannot be remounted as read only (similar to dm-crypt).. This yields improper halt..

Reproducible: Always

Steps to Reproduce:
1. Mount a file with truecrypt
2. Shutdown

Actual Results:  
Bad shutdown

Expected Results:  
God shutdown

truecrypt -d
Comment 1 Jakob Truelsen 2007-02-28 09:03:25 UTC
Created attachment 111526 [details, diff]
A patch that fixes the problem in most cases

This fixes the problem if there are no nested mounts (and who would make them?)
Comment 2 SpanKY gentoo-dev 2007-02-28 14:54:40 UTC
this is not how we want to do things anymore

truecrypt should implement at least a stop addon which we would call via `stop_addon truecrypt`

see the dm-crypt addons as an example
Comment 3 Jakob Truelsen 2007-02-28 15:34:04 UTC
Created attachment 111575 [details, diff]
Patch for halt.sh

A better patch for halt.sh
Comment 4 Jakob Truelsen 2007-02-28 15:35:18 UTC
Created attachment 111576 [details, diff]
A patch for the ebuild

Make the ebuild install the addon
Comment 5 Jakob Truelsen 2007-02-28 15:36:22 UTC
Created attachment 111577 [details]
The stop part og the addon

Make truecrypt "dismount" its mappings
Comment 6 Alon Bar-Lev (RETIRED) gentoo-dev 2007-02-28 18:31:03 UTC
SpanKY: I don't understand exactly what you wish us to do here... It seems not wise to patch the halt script...
Maybe it should dynamically find the addons?
Comment 7 SpanKY gentoo-dev 2007-03-01 06:45:06 UTC
the addons belong with the respective ebuilds ... so you need to review/approve/merge the proposed addon here before we update baselayout

yes, it should prob be a bit more dynamic in baselayout, but we'll worry about that later ... 1.12.x will include an explicit call to stop_addon
Comment 8 Alon Bar-Lev (RETIRED) gentoo-dev 2007-03-01 17:21:24 UTC
Created attachment 111713 [details]
truecrypt-stop.sh

OK, added to portage, truecrypt-4.2a-r3.
With minor modifications...
Comment 9 Roy Marples (RETIRED) gentoo-dev 2007-03-02 21:08:07 UTC
(In reply to comment #7)
> yes, it should prob be a bit more dynamic in baselayout, but we'll worry about
> that later ... 1.12.x will include an explicit call to stop_addon

I'm hopeful that we can have them as init scripts with baselayout-2. I'm not saying that's a design goal, but in theory it should be possible for everything including udev/devfs to be an init script.
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2007-04-02 11:12:20 UTC
basesystem: Can you please add your side?
Comment 11 Roy Marples (RETIRED) gentoo-dev 2007-04-02 11:57:50 UTC
Added to our svn repo.
Comment 12 Alon Bar-Lev (RETIRED) gentoo-dev 2007-06-13 09:18:50 UTC
uberlord: When can I close this one?
Comment 13 Alon Bar-Lev (RETIRED) gentoo-dev 2007-06-23 09:17:38 UTC
base-system: please decide when we can close this issue.
Comment 14 Thorsten Kampe 2007-08-10 11:58:46 UTC
The addon script (or truecrypt) is buggy. When no truecrypt volumes are mounted, halt.sh shows the failed umounting of the non-existing truecrypt volumes like this in red [!!].

Obviously it is no error when no truecrypt volumes are mounted.
Comment 15 Alon Bar-Lev (RETIRED) gentoo-dev 2007-08-10 12:19:04 UTC
Please suggest how to solve this...
As the only bug may be:
/usr/bin/truecrypt -d
And by your report this returns none zero if no mount is available...

Is there any other command that can return if any is mounted? So we may execute the above only if something is mounted?
Comment 16 Jakob Truelsen 2007-08-10 13:03:36 UTC
one can do
truecrypt -l 2>&1 | grep -q  "No volumes mapped" || truecrypt -d

though it will not display any errormessages from truecrypt -1 but that is prob ok

Comment 17 Thorsten Kampe 2007-08-10 13:52:10 UTC
I think it would make more sense to see if truecrypt gives different error codes depending on whether there are real errors or just no volumes to unmount. And only pass the real errors to halt.sh
Comment 18 Alon Bar-Lev (RETIRED) gentoo-dev 2007-08-10 21:55:39 UTC
Jakob:
Can you please try:
truecrypt -l 2>&1 && truecrypt -d
Comment 19 Alon Bar-Lev (RETIRED) gentoo-dev 2007-08-11 00:24:04 UTC
Opps...

Jakob:
Can you please try:
truecrypt -l > /dev/null 2>&1 && truecrypt -d
Comment 20 Jakob Truelsen 2007-08-11 07:42:27 UTC
(In reply to comment #19)
> Opps...
> 
> Jakob:
> Can you please try:
> truecrypt -l > /dev/null 2>&1 && truecrypt -d
> 

As you can se from the following, the one with grep that I proposed, works, The one you proposed does not

geneshaft jakobt # truecrypt volume.tc /mnt/stuff/
geneshaft jakobt # truecrypt -l 2>&1 | grep -q  "No volumes mapped" || truecrypt -d; echo $?
0
geneshaft jakobt # truecrypt -l 2>&1 | grep -q  "No volumes mapped" || truecrypt -d; echo $?
0
geneshaft jakobt # truecrypt volume.tc /mnt/stuff/
geneshaft jakobt # truecrypt -l > /dev/null 2>&1 && truecrypt -d; echo $?
0
geneshaft jakobt # truecrypt -l > /dev/null 2>&1 && truecrypt -d; echo $?
1
  
Comment 21 Jakob Truelsen 2007-08-11 07:49:10 UTC
One could also do
! truecrypt -l > /dev/null 2>&1  || truecrypt -d; echo $?

But that would indicate that all went well also if some error occured in "truecrypt -l"
Comment 22 Alon Bar-Lev (RETIRED) gentoo-dev 2007-08-11 08:46:26 UTC
OK.
Added the last.
Thanks.

Please re-emerge the package.

I am also closing this as it seems baselayout now activate this one... :)