Kaynağa Gözat

Detect running in LXC container using new method

It seems LXC 2.0 switched to using the systemd container interface
specification and one can no longer detect LXC containers using
/proc/1/cgroup (but I am leaving the old method, so that people using
distros with older versions of LXC can still use Gitian).

https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
pull/150/head
Joseph Bisch 3 yıl önce
ebeveyn
işleme
7f7c5f5ea8
No account linked to committer's email address
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1
    1
      target-bin/bootstrap-fixup.in

+ 1
- 1
target-bin/bootstrap-fixup.in Dosyayı Görüntüle

@@ -22,7 +22,7 @@ fi
echo '127.0.1.1 gitian' >> /etc/hosts

# If LXC
if grep /lxc/gitian /proc/1/cgroup > /dev/null; then
if grep /lxc/gitian /proc/1/cgroup > /dev/null || grep container=lxc /proc/1/environ > /dev/null; then
adduser --disabled-password --gecos ${DISTRIB_NAME,,} --quiet ${DISTRIB_NAME,,} || true
apt-get remove -y rsyslog || true
dpkg-divert --local --rename --add /sbin/initctl

Loading…
İptal
Kaydet