Devuan bug report logs - #392
When pid1==runit, mis-detects container and doesn't start

version graph

Package: eudev; Maintainer for eudev is Devuan Dev Team <devuan-dev@lists.dyne.org>; Source for eudev is src:eudev.

Reported by: KORN Andras <korn-debbugs@elan.rulez.org>

Date: Sun, 9 Feb 2020 10:48:02 UTC

Severity: normal

Found in version 3.2.9-4

Done: Svante Signell <svante.signell@gmail.com>

Full log


Message #15 received at 392@bugs.devuan.org (full text, mbox, reply):

Received: (at 392) by bugs.devuan.org; 10 Feb 2020 14:38:12 +0000
Return-Path: <korn-392=bugs.devuan.org@elan.rulez.org>
Delivered-To: devuanbugs@dyne.org
Received: from tupac3.dyne.org [195.169.149.119]
	by doc.devuan.org with IMAP (fetchmail-6.4.0.beta4)
	for <debbugs@localhost> (single-drop); Mon, 10 Feb 2020 14:38:12 +0000 (UTC)
Received: from flamant.cae-engineering.hu (flamant.cae-engineering.hu [62.210.203.57])
	by vm6.ganeti.dyne.org (Postfix) with ESMTP id EDEC4F60B29
	for <392@bugs.devuan.org>; Mon, 10 Feb 2020 15:36:20 +0100 (CET)
Received: (qmail 4969 invoked from network); 10 Feb 2020 15:36:19 +0100
Received: from flamant.amavis.cae-engineering.hu (HELO localhost) (172.18.30.131)
  by flamant.qmail.cae-engineering.hu with ESMTP; 10 Feb 2020 15:36:19 +0100
X-Virus-Scanned: by amavisd-new-2.7.1 (20120429) at cae-engineering.hu
Received: from unknown ([172.18.30.1])
	by localhost (flamant.amavis.cae-engineering.hu [172.18.30.131]) (amavisd-new, port 1628)
	id JULzoAQjyJpB for <392@bugs.devuan.org>;
	Mon, 10 Feb 2020 15:36:13 +0100 (CET)
Received: from akorn-home.user.vpn.cae-engineering.hu (HELO hellgate.av.hu) (172.18.28.253)
  by flamant.cae-engineering.hu with ESMTP; 10 Feb 2020 15:36:13 +0100
Received: (qmail 8638 invoked by uid 1000); 10 Feb 2020 15:36:13 +0100
Date: Mon, 10 Feb 2020 15:36:13 +0100
From: KORN Andras <korn-debbugs@elan.rulez.org>
To: 392@bugs.devuan.org
Subject: Re: When pid1==runit, mis-detects container and doesn't start
Message-ID: <20200210143613.nflqmqpsrwrmljs5@hellgate>
References: <20200209103448.lancgj764wum4y4x@hellgate>
 <handler.392.B.15812445703844.ack@bugs.devuan.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <handler.392.B.15812445703844.ack@bugs.devuan.org>
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled
	version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tupac3.dyne.org
Hi,

> So the name of pid 1 for runit-init is runit?
> Then the test could be
> -q "init\|runit\|systemd"
> 
> What about other init systems, like openrc-init? Perhaps the test should be
> reversed if ps -p1 | -q "container tests here" instead.

runit is a perfectly viable init system for a container, so detecting that
pid1==runit gives no clue whether you're inside a container or not.

> > Perhaps use virt-what to detect containers instead?
>
> I've been looking for methods to detect containers, but have not found virt-
> what. Do you have a link or a description?

Sure:

Package: virt-what
Status: install ok installed
Priority: extra
Section: admin
Installed-Size: 48
Maintainer: Debian Libvirt Maintainers <pkg-libvirt-maintainers@lists.alioth.debian.org>
Architecture: amd64
Version: 1.19-1
Depends: dmidecode, libc6 (>= 2.4)
Description: detect if we are running in a virtual machine
 Virt-what is a shell script which can be used to detect if the program is
 running in a virtual machine (VM).
 .
 The program prints out a list of "facts" about the virtual machine, derived
 from heuristics. One fact is printed per line.
Description-md5: 5d47386fbabb50c244e6526dada61a44
Homepage: https://people.redhat.com/~rjones/virt-what/

% apt-cache policy virt-what                                                                                                                                                                                                                                                         =79%
virt-what:
  Installed: 1.19-1
  Candidate: 1.19-1
  Version table:
 *** 1.19-1 500
        500 http://packages.devuan.org/merged unstable/main amd64 Packages
        100 /var/lib/dpkg/status
     1.15-1+deb9u1 500
        500 http://packages.devuan.org/merged ascii/main amd64 Packages

Note that while virt-what detects lxc, it doesn't currently correctly detect
all versions of linux-vserver.

Best regards,

AndrĂ¡s

Ps. I only found your reply by accident. I'm not subscribed do the Devuan
mailing lists and bugs.devuan.org doesn't seem to have Cc'd me. Please Cc me
explicitly.

-- 
  Illegal copies are not theft. Theft removes the original; a copy is a copy.

Send a report that this bug log contains spam.


Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Wed Apr 24 16:13:51 2024;