Re: Bug#741930: reportbug: add current init system information
Hello,
sorry for resurrecting this post from such a long ago.
On Fri, Mar 21, 2014 at 9:19 PM, Sandro Tosi <morph@debian.org> wrote:
> Ok, I think we need a wider audience - what d-d thinks about it? bonus
> points if - in case we come out to add init info to every bug report -
> a proper way to retrieve the init running is provided :)
Could you try running the attached script on your machines (check the
code first!!) and report in a private email to me the output?
Corrections/comments are welcome to be public either on d-d and/or on
the bug report.
What I want to do is inspecting the running system, instead of relying
on the presence of directories (I will use this latter method if the
first fails).
Thanks,
--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
from __future__ import with_statement
import os
pid1 = ''
init = '/sbin/init'
try:
with open('/proc/1/cmdline') as f:
pid1 = 'PID 1 is '
# cmdline contains arguments separated by NULL char
init = f.read().split('\x00')[0]
except IOError:
# ignore if the file is not accessible
pass
initsystem = os.readlink(init)
print 'Init: %s%s linked to %s' % (pid1, init, initsystem)
Reply to: