[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#968096: marked as done (reportbug: Can't detect OpenRC as init)



Your message dated Tue, 27 Oct 2020 20:39:38 +0000
with message-id <E1kXVko-000ABx-11@fasolo.debian.org>
and subject line Bug#968096: fixed in reportbug 7.8.0
has caused the Debian Bug report #968096,
regarding reportbug: Can't detect OpenRC as init
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
968096: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968096
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: reportbug
Version: 7.7.0
Severity: normal

Dear Maintainer,

Currently reportbug does not detect openrc as init system. (The same seems to 
apply to s6, but I never used s6).
What makes this a bit more complicated is, that it is possible to use openrc 
as 
a service manager and supervisor, but something else — eg sysv-init — as the 
actual init-system.
Or use openrc as init, but leave (some or all) process supervision to s6
  https://github.com/OpenRC/openrc/blob/master/s6-guide.md
.

I've attached patches that afaik should allow OpenRC to be correctly detected 
in 
a "normal" setup and also added a patch to check the name of the actual pid 1 
process, which should work for an openrc+sysv configuration.
I'm not sure what to do with openrc+s6 (and I never used both in conjunction) 
or
if this even matters.

Regards
Nils König

(Below information generated with patched reportbug; see attached patches)

-- Package-specific info:

-- System Information:
Debian Release: 10.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (10, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.12-pc3+fs (SMP w/16 CPU threads)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not 
set
Shell: /bin/sh linked to /usr/bin/dash
Init: openrc (via /run/openrc)
PID 1: openrc-init
LSM: AppArmor: enabled

Versions of packages reportbug depends on:
ii  apt                1.8.2.1
ii  python3            3.7.3-1
ii  python3-reportbug  7.7.0+openrc+pid1
ii  sensible-utils     0.0.12

reportbug recommends no packages.

Versions of packages reportbug suggests:
pn  claws-mail                                            <none>
pn  debconf-utils                                         <none>
ii  debsums                                               2.2.3
pn  default-mta | postfix | exim4 | mail-transport-agent  <none>
pn  dlocate                                               <none>
pn  emacs-bin-common                                      <none>
ii  file                                                  1:5.35-4+deb10u1
ii  gnupg                                                 2.2.12-1+deb10u1
pn  python3-urwid                                         <none>
pn  reportbug-gtk                                         <none>
ii  xdg-utils                                             1.1.3-1+deb10u1

Versions of packages python3-reportbug depends on:
ii  apt                1.8.2.1
ii  file               1:5.35-4+deb10u1
ii  python3            3.7.3-1
ii  python3-apt        1.8.4.1
ii  python3-debian     0.1.35
ii  python3-debianbts  3.0.2
ii  python3-requests   2.21.0-1
ii  sensible-utils     0.0.12

python3-reportbug suggests no packages.

-- no debconf information


From eee54657ee872be51dcb4aced65d96d2b22818cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nils=20K=C3=B6nig?= <nkoe@gylk.de>
Date: Sat, 8 Aug 2020 01:02:12 +0200
Subject: [PATCH 1/2] reportbug/utils.py: Detect OpenRC as init

OPenRC's init is shipped as /sbin/openrc-init, but its mere
prescence does not indicate if OpenRC is actually used.
Therefore attempt to detect OpenRC by checking for its run-folder.
The caveat is, that openrc may be used as the service manager, but not
as the actual pid1 init system.
---
 reportbug/utils.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/reportbug/utils.py b/reportbug/utils.py
index a1c68b3..beb4828 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -1207,6 +1207,8 @@ def get_init_system():
         init = 'upstart (via init_is_upstart())'
     elif os.path.isfile('/run/runit.stopit'):
         init = 'runit (via /run/runit.stopit)'
+    elif os.path.isdir('/run/openrc'):
+        init = 'openrc (via /run/openrc)'
     elif os.path.isfile('/sbin/init') and not os.path.islink('/sbin/init'):
         init = 'sysvinit (via /sbin/init)'
 
-- 
2.20.1

From 292891d9e85b1339c1e0364d1f83dfbaba0dba8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nils=20K=C3=B6nig?= <nkoe@gylk.de>
Date: Sat, 8 Aug 2020 01:12:12 +0200
Subject: [PATCH 2/2] reportbug/bugreport.py, reportbug/utils.py: Check PID 1
 name

It is possible to create setups, in which service-management and
pid1-init are done by different programms, eg openrc with sysv-init.
To have better chances at correctly identifying these setups, check the
PID 1 command name.
---
 reportbug/bugreport.py |  3 +++
 reportbug/utils.py     | 13 +++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/reportbug/bugreport.py b/reportbug/bugreport.py
index 920e045..d334852 100644
--- a/reportbug/bugreport.py
+++ b/reportbug/bugreport.py
@@ -83,6 +83,7 @@ class bugreport(object):
         debinfo = ''
         shellpath = utils.realpath('/bin/sh')
         init = utils.get_init_system()
+        pid1 = utils.get_pid1_name()
         lsminfo = utils.get_lsm_info()
         taint_flags = utils.get_kernel_taint_flags()
 
@@ -190,6 +191,8 @@ class bugreport(object):
             debinfo += 'Shell: /bin/sh linked to %s\n' % shellpath
         if init:
             debinfo += 'Init: %s\n' % init
+        if pid1:
+            debinfo += 'PID 1: %s\n' % pid1
         if lsminfo:
             debinfo += 'LSM: %s\n' % lsminfo
 
diff --git a/reportbug/utils.py b/reportbug/utils.py
index beb4828..feeb093 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -1214,6 +1214,19 @@ def get_init_system():
 
     return init
 
+def get_pid1_name():
+    """Get command name of pid-1.
+    This may help in some init+service configurations"""
+
+    pid1 = 'unable to detect'
+
+    if os.path.isfile('/proc/1/comm') and os.access('/proc/1/comm', os.R_OK):
+        pfile = open('/proc/1/comm')
+        pid1 = pfile.read().rstrip('\n')
+        pfile.close()
+
+    return pid1
+
 def get_lsm_info():
     """Determines the linux security module enabled on the current machine
 
-- 
2.20.1

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: reportbug
Source-Version: 7.8.0
Done: Nis Martensen <nis.martensen@web.de>

We believe that the bug you reported is fixed in the latest version of
reportbug, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 968096@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Nis Martensen <nis.martensen@web.de> (supplier of updated reportbug package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 25 Oct 2020 09:21:16 +0100
Source: reportbug
Architecture: source
Version: 7.8.0
Distribution: unstable
Urgency: medium
Maintainer: Reportbug Maintainers <debian-reportbug@lists.debian.org>
Changed-By: Nis Martensen <nis.martensen@web.de>
Closes: 717563 877850 964846 964987 965977 966480 968096
Changes:
 reportbug (7.8.0) unstable; urgency=medium
 .
   [ Anuradha Weeraman ]
   * reportbug/debbugs.py: Fix crash with stable-pu update request
     (Closes: #964987)
 .
   [ Nis Martensen ]
   * mailer.py,submit.py: only run MUA in terminal if needed (Closes: #964846)
   * reportbug/submit.py: use message_from_binary_file to attach messages
     (Closes: #966480)
   * bin/reportbug:
     - use raw string for regexp
     - do not submit without pseudoheaders
     - Fix crash in offer_configuration (Closes: #965977)
     - drop empty recipients from listcc
     - Warn that X-Debbugs-Cc via headers are now unreliable
   * man/reportbug.conf.5: fix bts help hint
   * man/*: updates for list-cc* and headers
   * reportbug/ui/gtk_ui.py:
     - editor: fix report split
     - Make pseudoheaders editable in Editor
     - Update empty buffer string
     - Always set window title
     - switch editor: TextView → SourceView
     - editor: do not rewrap pseudoheaders
     - Editor: show other buffer in monospace font
     - fix GetListPage
     - fix crash in _get_multiline
     - show "Thanks" in message, not in title
   * debian/control:
     - update package description
     - add dependency on gir1.2-gtksource-3.0
   * reportbug/bugreport.py: add second newline to empty body
   * reportbug/utils.py:
     - get_init_system: detect OpenRC (Closes: #968096)
     - fix test failure in get_init_system
   * test/test_utils.py: fix test_get_init_system
   * bin/reportbug, reportbug/urlutils.py: fix proxy support
     (Closes: #717563, #877850)
   * New release
Checksums-Sha1:
 c0a97d1eadc1ae45dc022f1bea79f118f9ac1a1b 1860 reportbug_7.8.0.dsc
 3acf0a5e1948da3054ba177ac83ace9697b7953d 200200 reportbug_7.8.0.tar.xz
 0eff32df1907353823095ba9bb53e1b9de03a604 7684 reportbug_7.8.0_amd64.buildinfo
Checksums-Sha256:
 64e6c43172a76f203ba3f1f42cd45022c923f1b03bcab6fbae972af9777c987f 1860 reportbug_7.8.0.dsc
 f1d0052c2b607f05107c0035e95df1cfdb3b1a109dea50b8fe5c422aead0fd14 200200 reportbug_7.8.0.tar.xz
 30472c315538838ee5f20e971cab7f8abfbb5003826fec2e95ac4b5942aecad0 7684 reportbug_7.8.0_amd64.buildinfo
Files:
 75f461faa146e113a0cccc671d728ed7 1860 utils standard reportbug_7.8.0.dsc
 64545839e2b54c9a67883a3edc37aa96 200200 utils standard reportbug_7.8.0.tar.xz
 6aa93308dfab138e56afb6c85cf1665a 7684 utils standard reportbug_7.8.0_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEElwagcOR0bw2C8YAgINUE/crqn1AFAl+Yel0ACgkQINUE/crq
n1AtuxAAo3bZjjHbhTaqRFvM+s5lI9DGNQUSx1zyd35RnN81ZUqV+1Zf3DD4KJzF
8WxDdFZ+EfW1QYAW6jAeXpVk9iwdk27s27TxEwe8qRnnskKXkDBCfA2d0eU7x5sD
BMzhBjrlkd07x/h2nMnIiYRI9eEy56S5daeyLDYYKygSX0tfw4iT9sUZhhLb6D8e
etZvBgBO9y8icVj7iLQfEcQiicfKHxz1vP8r8qdzDZX+8x8eWxx7uLBSkQ5TqLtU
IG9DA09080xmkK9q4+IsKVdNvN3798oXbxb7mXFSXM5mR9ZpsQcUrnlk3CHwoPtE
vkmZrZ2MN9J2j0gJvenr9oKNDPeyyHtjVNCEF5t5ZrimfTBlyta77q5ZOwQbP2+b
RMxDs7VxmbVzVC7fr1ml/NVzjXJzN/TdP8ar+DRUhKU4UadT/AgWitWgECkgfudS
qZ+KjPvTG7oBLcc3eFoAy5fUBTj4UUmzq7SlTHXyQvq3lfRJ8z8fplCX3sNOA12I
ve+tpaDZXqlcPAHfyFid0xractxkuHjO39nmMu6fCFy7MkkUu88N7wGb/EoLYQHt
MirXgZ10bLBpzEAmR6Qi9HQctNR+0DhMY/UjGULBfw0YpX9f5eN4lBruqOpzUj0r
uk9sRvRJT4zFFmPchZLAmvuMOvNtBskukiG3PRcHp1N+wIyOwto=
=gacI
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: