UpstartInitctlList - Command initctl --system list

Parser to parse the output of initctl --system list command.

class insights.parsers.upstart.UpstartInitctlList(context, extra_bad_lines=None)[source]

Bases: insights.core.CommandParser

Class to parse the output of initctl command. It allows a system administrator to communicate and interact with the Upstart init(8) daemon and list the services managed by Upstart init.

Sample output:

rc stop/waiting
vmware-tools start/running
tty (/dev/tty3) start/running, process 9499
tty (/dev/tty2) start/running, process 9495
tty (/dev/tty1) start/running, process 9493
tty (/dev/tty6) start/running, process 9507
tty (/dev/tty5) start/running, process 9505
tty (/dev/tty4) start/running, process 9502
tty (/dev/ttyS0) start/running, process 9509
plymouth-shutdown stop/waiting
control-alt-delete stop/waiting
rcS-emergency stop/waiting
readahead-collector stop/waiting
kexec-disable stop/waiting
quit-plymouth stop/waiting
rcS stop/waiting
prefdm stop/waiting
init-system-dbus stop/waiting
ck-log-system-restart stop/waiting
readahead stop/waiting
ck-log-system-start stop/waiting
splash-manager stop/waiting
start-ttys stop/waiting
readahead-disable-services stop/waiting
ck-log-system-stop stop/waiting
rcS-sulogin stop/waiting
serial stop/waiting
Raises

SkipException -- When nothing need to parse.

data

Daemon details are stored as list of str.

Type

list

tty

Device details are stored with status and process id.

Type

dict

daemon_proc

Daemon status are stored with its dameon name and status.

Type

dict

Examples

>>> type(upstart_obj)
<class 'insights.parsers.upstart.UpstartInitctlList'>
>>> upstart_obj.upstart_managed('vmware-tools')
'vmware-tools start/running'
>>> upstart_obj.daemon_status('vmware-tools')
'start/running'
>>> upstart_obj.daemon_status('start-ttys')
'stop/waiting'
>>> upstart_obj.dev_status('/dev/tty4')
'stop/waiting'
>>> upstart_obj.upstart_managed('/dev/tty3')
'tty (/dev/tty3) start/running, process 9499'
>>> upstart_obj.daemon_proc['quit-plymouth']
'stop/waiting'
>>> upstart_obj.tty['/dev/tty4']['status']
'stop/waiting'
>>> sorted(upstart_obj.data)[0]
'ck-log-system-restart stop/waiting'
daemon_status(daemon)[source]
Parameters

daemon (str) -- The daemon name

Returns

This method will return the status of the process start/running or stop/waiting if it is managed by upstart else it will return None.

Return type

(str)

dev_status(dev)[source]
Parameters

dev (str) -- The tty device name

Returns

This method will return the status of the tty device start/running or stop/waiting, along with process-ID if it is managed by upstart else it will return None.

Return type

(str)

parse_content(content)[source]

This method must be implemented by classes based on this class.

upstart_managed(daemon)[source]
Parameters

daemon (str) -- The daemon name

Returns

This method returns the status of daemon service if it is managed by upstar else it will return None.

Return type

(str)