Ubuntu – Service –status-all –> what does the column with [ ? ],[ + ], and [ – ] mean

services

If I run the command "service –status-all", each (running?) service is listed in column format. The first column has either a [ ? ], [ + ], or [ – ] before the service name. What does this column represent? What does ?, +, and – mean?

Sorry if this is a simple question. I searched online for ~30 minutes before just coming here and asking.

I even found this: What do the symbols in service –status-all mean? where the "correct" answer states "It draws a [ + ] or [ – ] depending on whether the exit status was zero or nonzero, respectively.".

So, I guess my new question is what does status zero and nonzero(!?!?!) mean?

Best Answer

Well those are just exit codes. After something has done running, it can return an 8-bit integer (0-255) to indicate how it exited.

  • Zero (which is implied if nothing is returned) means the application got to the end of what it was supposed to do and exited naturally.
  • Non-zero codes (1-255) can mean whatever the application wants. The man page (man <command>) will usually show you what these codes mean.

In terms of the question, don't overthink it:

  • + means it's running,
  • - means it isn't (it might have crashed - it might never have started), and
  • ? means the services doesn't have a status command, so there's no way the service command can work out what's what.