[Pkg-sysvinit-devel] Bug#687399: sysvinit.postinst fails under debootstrap --variant=fakechroot when /dev/initctl exists
Roger Leigh
rleigh at codelibre.net
Wed Sep 12 21:30:13 UTC 2012
On Wed, Sep 12, 2012 at 09:03:26AM -0400, Daniel Kahn Gillmor wrote:
> If i have a GNU/Linux system with /dev/initctl present, and i
> debootstrap with --variant=fakechroot as a non-privileged user, the
> debootstrap fails with :
>
> Setting up sysvinit (2.88dsf-32) ...
> sysvinit: creating /run/initctl
> ln: failed to create symbolic link `/dev/initctl.new': Permission denied
> dpkg: error processing sysvinit (--configure):
> subprocess installed post-installation script returned error exit status 1
> Setting up e2fsprogs (1.42.5-1) ...
> Errors were encountered while processing:
> sysvinit
>
> This appears to be because this stanza is not wrapped in an ischroot test:
>
> # Replace old control channel (if present) with symlink
> if [ -e "$OLDINITCTL" ]; then
> ln -s "$INITCTL" "$OLDINITCTL.new"
> mv "$OLDINITCTL.new" "$OLDINITCTL"
> fi
>
> I suspect the same issue might be true for this other stanza later in
> the postinst:
>
> # Remove old pipe if present. No longer in use after re-exec.
> if [ "$OLDINITCTL" ] && [ -p "$OLDINITCTL" ]
> then
> rm -f "$OLDINITCTL"
> fi
We should probably wrap all of the restart logic (except the inittab
stuff) in ischroot checks. Messing with the host's /dev is not
worth risking. There was a reason why we did it this way though; it
wasn't unintentional. I'll have to remember the reasoning, since I
don't want to break something else by accident. Possibly vservers/lxc
or some other chroot-like thing.
However, why is the host's /dev accessible when bootstrapping--it
certainly shouldn't be bind mounted. Is this something which
fakechroot is doing?
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools
`- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
More information about the Pkg-sysvinit-devel
mailing list