Bug#910770: dash: systemd-detect-virt fails to detect virtualized environment when run under dash

2018-10-15 Thread Andy Sparrow
On Wed, Oct 10, 2018 at 7:50 PM Michael Biebl  wrote:

> Am 11.10.18 um 03:53 schrieb Jonathan Nieder:
> Fwiw, I can't reproduce
>
> ...
>
> This is on stretch.
>

Works as expected on stretch.

Both moving parts - both systemd (215 -> 232) & dash (0.5.7 -> 0.5.8) - are
at different versions on Jessie vs Stretch.


Bug#910770: dash: systemd-detect-virt fails to detect virtualized environment when run under dash

2018-10-10 Thread Andy Sparrow
Hi,
> Do you have more details?
> What test does systemd-detect-virt use, and why is it failing on dash?

Good question(s); not looked at this in more detail.

>  What version of systemd are you using?

In the guest, systemd 215; which corresponds to whats in Jessie up to 8.11.

In the host, multiple versions; whatever GCE gives you in a Debian Jessie
instance, and whatever's main/upstream; currently 239. Doesn't seem to make
any difference.

Tried installing the Jessie systemd backport for other reasons, but it
wouldn't fly for dependency breakage (on ifup/down, I think).


Cheers,

Andy

On Wed, Oct 10, 2018 at 6:53 PM Jonathan Nieder  wrote:

> Hi,
>
> spuggy...@gmail.com wrote:
>
> > When run under dash, systemd-detect-virt returns "none" in a
> systemd-nspawn
> > chroot'd environment when it should not; same command under bash works
> > as expected.
>
> Do you have more details?  What test does systemd-detect-virt use, and
> why is it failing on dash?  What version of systemd are you using?
>
> Thanks,
> Jonathan
>
> > Because /bin/sh is linked to /bin/dash, this causes the MAKEDEV post-inst
> > script not to realize it's in a virtual environment (despite tests added
> > in 2.3.1-93 and 2.3.1-94 versions of makedev package to detect precisely
> > this situation).
> >
> > it will, therefore, attempt to inappropriately create devices in the
> > chroot. Which fails horribly, resulting in an uninstalled/unconfigured
> > package. (actually many, in a debootstrap run)
> >
> > Which makes it more awkward than it should be to build an OS image via
> > debootstrap in a systemd-nspawn container without hackery or workarounds.
> >
> > $ systemd-nspawn -D jessie-18-10-10/ /bin/bash -c "systemd-detect-virt"
> > Spawning container jessie-18-10-10 on
> /data/PXE/squashbuilder/jessie-18-10-10.
> > Press ^] three times within 1s to kill container.
> > systemd-nspawn
> > Container jessie-18-10-10 exited successfully.
> >
> > $ systemd-nspawn -D jessie-18-10-10/ /bin/dash -c "systemd-detect-virt"
> > Spawning container jessie-18-10-10 on
> /data/PXE/squashbuilder/jessie-18-10-10.
> > Press ^] three times within 1s to kill container.
> > none
> > Container jessie-18-10-10 failed with error code 1.
>


Bug#910770: dash: systemd-detect-virt fails to detect virtualized environment when run under dash

2018-10-10 Thread Michael Biebl
Am 11.10.18 um 03:53 schrieb Jonathan Nieder:
> Hi,
> 
> spuggy...@gmail.com wrote:
> 
>> When run under dash, systemd-detect-virt returns "none" in a systemd-nspawn
>> chroot'd environment when it should not; same command under bash works
>> as expected.
> 
> Do you have more details?  What test does systemd-detect-virt use, and
> why is it failing on dash?  What version of systemd are you using?

Fwiw, I can't reproduce

# machinectl shell debian
Connected to machine debian. Press ^] three times within 1s to exit session.
root@debian:~# systemd-detect-virt
systemd-nspawn
root@debian:~# dash
# systemd-detect-virt
systemd-nspawn

This is on stretch.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#910770: dash: systemd-detect-virt fails to detect virtualized environment when run under dash

2018-10-10 Thread Jonathan Nieder
Hi,

spuggy...@gmail.com wrote:

> When run under dash, systemd-detect-virt returns "none" in a systemd-nspawn
> chroot'd environment when it should not; same command under bash works
> as expected.

Do you have more details?  What test does systemd-detect-virt use, and
why is it failing on dash?  What version of systemd are you using?

Thanks,
Jonathan

> Because /bin/sh is linked to /bin/dash, this causes the MAKEDEV post-inst
> script not to realize it's in a virtual environment (despite tests added
> in 2.3.1-93 and 2.3.1-94 versions of makedev package to detect precisely
> this situation).
>
> it will, therefore, attempt to inappropriately create devices in the
> chroot. Which fails horribly, resulting in an uninstalled/unconfigured
> package. (actually many, in a debootstrap run)
>
> Which makes it more awkward than it should be to build an OS image via
> debootstrap in a systemd-nspawn container without hackery or workarounds.
>
> $ systemd-nspawn -D jessie-18-10-10/ /bin/bash -c "systemd-detect-virt"
> Spawning container jessie-18-10-10 on /data/PXE/squashbuilder/jessie-18-10-10.
> Press ^] three times within 1s to kill container.
> systemd-nspawn
> Container jessie-18-10-10 exited successfully.
>
> $ systemd-nspawn -D jessie-18-10-10/ /bin/dash -c "systemd-detect-virt"
> Spawning container jessie-18-10-10 on /data/PXE/squashbuilder/jessie-18-10-10.
> Press ^] three times within 1s to kill container.
> none
> Container jessie-18-10-10 failed with error code 1.



Bug#910770: dash: systemd-detect-virt fails to detect virtualized environment when run under dash

2018-10-10 Thread spuggy...@gmail.com
Package: dash
Version: 0.5.7-4+b1
Severity: important

Dear Maintainer,

When run under dash, systemd-detect-virt returns "none" in a systemd-nspawn
chroot'd environment when it should not; same command under bash works
as expected.

Because /bin/sh is linked to /bin/dash, this causes the MAKEDEV post-inst
script not to realize it's in a virtual environment (despite tests added
in 2.3.1-93 and 2.3.1-94 versions of makedev package to detect precisely
this situation).

it will, therefore, attempt to inappropriately create devices in the
chroot. Which fails horribly, resulting in an uninstalled/unconfigured
package. (actually many, in a debootstrap run)

Which makes it more awkward than it should be to build an OS image via
debootstrap in a systemd-nspawn container without hackery or workarounds.


$ systemd-nspawn -D jessie-18-10-10/ /bin/bash -c "systemd-detect-virt"
Spawning container jessie-18-10-10 on /data/PXE/squashbuilder/jessie-18-10-10.
Press ^] three times within 1s to kill container.
systemd-nspawn
Container jessie-18-10-10 exited successfully.

$ systemd-nspawn -D jessie-18-10-10/ /bin/dash -c "systemd-detect-virt"
Spawning container jessie-18-10-10 on /data/PXE/squashbuilder/jessie-18-10-10.
Press ^] three times within 1s to kill container.
none
Container jessie-18-10-10 failed with error code 1.


-- System Information:
Debian Release: 8.11
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.18.10-arch1-1-ARCH (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages dash depends on:
ii  debianutils  4.4+b1
ii  dpkg 1.17.27
ii  libc62.19-18+deb8u10

dash recommends no packages.

dash suggests no packages.

-- debconf information:
* dash/sh: true