You could use
initctl to request a list of the known jobs and instances and output the status of each to standard output:
#sudo initctl list
Note: It's important to prefix the command with
sudo (or be logged in as
root). If you don't have root privilages, you could get an error like "
unable to connect to system bus: failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory." Which is very confusing.
Filtering the results
initctl command might produce a large list of results that flow over many screens.
So, it might be better to pipe the standard output to a paginator program like
However, I prefer to pipe the output to a filter program like
grep like so:
# sudo initctl list | grep vmware
initctl but filters its results to exclude all lines of output unless they contain the phrase vmware.
Understanding the output
I ran the, grep-filtered, command (
sudo initctl list | grep vmware) and got the following output:
The first line confirmed, to me, that vmware-tools was running.
If there was no output at all, I'd deduce that vmware-tools was not running.
initctl manual page says, each line of output reflects a job's status in the format:
The job name is given first followed by the current goal and state
of the selected instance. The goal is either start or stop, the
status may be one of waiting, starting, pre-start, spawned,
post-start, running, pre-stop, stopping, killed or post-stop.
For your information, my machine was
Ubuntu 13.10 Saucy Salamander Final Beta.
initctl man page's section on
status for more info.
For the best introduction to Linux pipes etc. it's worth reading those 26, short, pages of that seminal article:
The Unix Time-Sharing System, by D. M. Ritchie and K. Thompson