dpkg fails to run preinst when using --admindir

Bug #606668 reported by yannickm
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: dpkg

Release: Ubuntu 9.10
dpkg version: 1.15.4ubuntu2.1

I'm running dpkg overriding the admin dir, so that i may run run it as non-root in my code unit tests (creating an ant deb creation task)

dpkg --install --force-all --admindir=createinstaller-complex/install/var/lib/dpkg --root=createinstaller-complex/install --instdir=createinstaller-complex/install createinstaller-complex/bmtest.deb

All goes well up to the point of executing the script, where strace shows:

11908 stat64("createinstaller-complex/install/var/lib/dpkg/tmp.ci/preinst", {st_mode=S_IFREG|0644, st_size=250, ...}) = 0
11908 chmod("createinstaller-complex/install/var/lib/dpkg/tmp.ci/preinst", 0755) = 0
11908 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7675788) = 11914
11908 rt_sigaction(SIGQUIT, {0x1, [], 0}, {0x1, [], 0}, 8) = 0
11908 rt_sigaction(SIGINT, {0x1, [], 0}, <unfinished ...>
11914 chroot("createinstaller-complex/install" <unfinished ...>
11908 <... rt_sigaction resumed> {SIG_DFL, [], 0}, 8) = 0
11914 <... chroot resumed> ) = 0
11908 waitpid(11914, <unfinished ...>
11914 chdir("/") = 0
11914 execve("/var/lib/dpkg/tmp.ci/preinst", ["/var/lib/dpkg/tmp.ci/preinst", "install"], [/* 26 vars */]) = -1 ENOENT (No such file or directory)

As you can see, up to that point, dpkgs always uses the right directory, and creates the preinst script in "createinstaller-complex/install/var/lib/dpkg/tmp.ci/preinst", however when it tried to execute it, it does so by calling "/var/lib/dpkg/tmp.ci/preinst", which is naturally wrong and makes the whole thing fail :-(

Revision history for this message
Raphaël Hertzog (hertzog) wrote :

/var/lib/dpkg/tmp.ci/preinst is not wrong because that's after a chroot("createinstaller-complex/install")... but I don't get why it fails.

Any way, can you try with a more recent dpkg? There have been lots of changes and your problem might have been fixed.

Changed in dpkg (Ubuntu):
status: New → Triaged
Changed in dpkg (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.