[OmniOS-discuss] cannot remove temp dir

Matthieu Paindavoine ctordtor at yahoo.fr
Thu May 9 10:28:26 EDT 2013


Hello,

I am new to OmniOS. I am trying to setup a Haskell development environment and ran against a bump that's preventing me from completing the task. I mentioned this problem yesterday on IRC and got some help, but no definitive solution.

The Haskell build tool is cabal, and after successfully installing the Haskell compiler (ghc-7.4.2) I want to update the build tool. But this step fails, and the log indicates that it cannot remove a temporary directory it created.

I tried to remove it manually (rm -fr /tmp/foo as root) but it fails:
rm: cannot remove '/tmp/foo': File exists
but there is nothing in that directory.

Here is the /tmp directory

total 8126
drwxr-xr-x 23 root root      25 May  8 22:55 ..
drwx------  3 root root     117 May  9 13:23 cabal-install-1.16.0.2-21814
[...]
drwxrwxrwt  8 root sys      925 May  9 16:07 . 
and here is the /tmp/cabal-install-1.16.0.2-21814

total 8
drwx------ 3 root root 117 May  9 13:23 .
drwxrwxrwt 8 root sys  985 May  9 16:10 ..
Some funny facts!
If I try (as it was kindly suggested to me on IRC #omnios) unlink, then this works fine.
If I try to zpool scrub, there is no problem.
If I try to mkdir -m 0700 /tmp/bar; cd /tmp/bar; touch baz; cd /tmp; rm -fr bar
 it runs fine...
If I reboot, /tmp dir is emptied fine.

Below you'll find 

1: the steps I used:
2: the output of the build log, with the error at the end
3: the output of truss when i execute rm -fr /tmp/foo

Thanks for your help

Matthieu

Install a 'bloody' OmniOS from DVD.
Update system with pkg refresh and image-update
Install developer packages
pfexec pkg install \ developer/gcc47 \ developer/object-file \ developer/linker \ developer/library/lint \ developer/build/gnu-make \ system/header \ system/library/math/header-math \ archiver/gnu-tar
update path to include /opt/gcc-4.7.2
download binary distribution of ghc-7.0.3 and install in /opt/ghc-7.0.3
update path and ld_library_path
download source distribution of ghc-7.4.2 and install in /opt/ghc-7.4.2
update path and ld_library_path
download cabal-install and execute bootstrap.sh
update path and ld_library_path
execute cabal install --global cabal-install 
searching for ghc in path.
found ghc at /opt/ghc-7.4.2/bin/ghc
("/opt/ghc-7.4.2/bin/ghc",["--numeric-version"])
/opt/ghc-7.4.2/bin/ghc is version 7.4.2
[...]
Downloading cabal-install-1.16.0.2...
[...]
Downloaded to
/root/.cabal/packages/hackage.haskell.org/cabal-install/1.16.0.2/cabal-install-1.16.0.2.tar.gz
Extracting
/root/.cabal/packages/hackage.haskell.org/cabal-install/1.16.0.2/cabal-install-1.16.0.2.tar.gz
to /tmp/cabal-install-1.16.0.2-21814...
[...]
Using internal setup method with build-type Simple and args:
["install","--verbose=3"]
directory dist/doc/html/cabal-install does exist: False
creating /usr/local/share/doc/cabal-install-1.16.0.2
Installing LICENSE to /usr/local/share/doc/cabal-install-1.16.0.2/LICENSE
Installing executable(s) in /usr/local/bin
creating /usr/local/bin
Installing executable dist/build/cabal/cabal to /usr/local/bin/cabal
("/usr/bin/strip",["/usr/local/bin/cabal"])
World file is already up to date.
cabal: Error: some packages failed to install:
cabal-install-1.16.0.2 failed while downloading the package. The exception was:
/tmp/cabal-install-1.16.0.2-21814: removeDirectory: already exists (File exists)


truss rm -fr /tmp/cabal-install-1.16.0.2-21814 2>&1 | tee /tmp/truss:

execve("/usr/gnu/bin/rm", 0x08047D24, 0x08047D34)  argc = 3
sysinfo(SI_MACHINE, "i86pc", 257)		= 6
mmap(0x00000000, 32, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFB0000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFA0000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEF90000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEF80000
memcntl(0xFEFB6000, 47484, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
memcntl(0x08050000, 24204, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
resolvepath("/usr/gnu/bin/rm", "/usr/gnu/bin/rm", 1023) = 15
sysconfig(_CONFIG_PAGESIZE)			= 4096
stat64("/usr/gnu/bin/rm", 0x080479B8)		= 0
open("/var/ld/ld.config", O_RDONLY)		Err#2 ENOENT
stat64("/usr/local/lib/libc.so.1", 0x080471D8)	Err#2 ENOENT
stat64("/opt/ghc-7.4.2/lib/libc.so.1", 0x080471D8) Err#2 ENOENT
stat64("/opt/ghc-7.0.2/lib/libc.so.1", 0x080471D8) Err#2 ENOENT
stat64("./libc.so.1", 0x080471D8)		Err#2 ENOENT
stat64("/lib/libc.so.1", 0x080471D8)		= 0
resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
open("/lib/libc.so.1", O_RDONLY)		= 3
mmapobj(3, MMOBJ_INTERPRET, 0xFEFA0CA8, 0x08047244, 0x00000000) = 0
close(3)					= 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEE20000
memcntl(0xFEE30000, 244676, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEE10000
getcontext(0x080477F8)
getrlimit(RLIMIT_STACK, 0x080477F0)		= 0
getpid()					= 22973 [22971]
lwp_private(0, 1, 0xFEE12A40)			= 0x000001C3
setustack(0xFEE12AA0)
sysi86(SI86FPSTART, 0xFEF7DF8C, 0x0000133F, 0x00001F80) = 0x00000001
brk(0x0808C1E0)					= 0
brk(0x0808E1E0)					= 0
ioctl(0, TCGETA, 0x08047C4E)			= 0
getprivimplinfo(0x080473B0, 2076)		= 0
mmap(0x00010000, 65536, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEDF0000
sysconfig(_CONFIG_NGROUPS)			= 16
zone_lookup(0x00000000)				= 0
zone_getattr(0, ZONE_ATTR_PRIVSET, 0xFEE10248, 12) = 12
getppriv(PRIV_EFFECTIVE, {ffffffffffffffffffffffff}) = 0
setppriv(PRIV_SET, PRIV_EFFECTIVE, {fffffffffffffbffffffffff}) = 0
sysconfig(_CONFIG_PAGESIZE)			= 4096
lstat64("/", 0x08047BF0)			= 0
lstat64("cabal-install-1.16.0.2-21814", 0x0808D684) = 0
open64("cabal-install-1.16.0.2-21814", O_RDONLY|O_NONBLOCK|O_NOCTTY|O_NOFOLLOW) = 3
fcntl(3, F_SETFD, 0x00000001)			= 0
fstat64(3, 0x08047A20)				= 0
getdents64(3, 0xFEE14000, 8192)			= 48
getdents64(3, 0xFEE14000, 8192)			= 0
close(3)					= 0
rmdir("cabal-install-1.16.0.2-21814")		Err#17 EEXIST
open64("/usr/gnu/lib/charset.alias", O_RDONLY|O_NOFOLLOW) Err#2 ENOENT
fcntl(1, F_GETFL)				= 2
fstat64(2, 0x08046B90)				= 0
rm: write(2, " r m :  ", 4)				= 4
cannot remove 'cabal-install-1.16.0.2-21814'write(2, " c a n n o t   r e m o v".., 44)	= 44
: write(2, " :  ", 2)				= 2
File existswrite(2, " F i l e   e x i s t s", 11)		= 11 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20130509/4998f545/attachment-0001.html>


More information about the OmniOS-discuss mailing list