10

After executing the command service --status-all I get a listing of all the services on my machine. I get an output like this.

[ ? ]  acpi-fakekey
[ ? ]  acpi-support
[ + ]  acpid
[ - ]  anacron
[ + ]  apache2
[ + ]  atd
[ - ]  bootlogd

What does a ? mean? I have always assumed a + means the process is started and a - means the process is stoppped. What state is a service preceded by ? in?

Here's the contents of my /proc/version file incase it helps anyone to answer me.

Linux version 2.6.32-5-amd64 (Debian 2.6.32-45)

Thanks in advance!

Grenville
  • 203
  • 2
  • 6

1 Answers1

7

The question mark in the output of service --status-all is printed when the /usr/sbin/service script does not find status line in the case structure in the related script under /etc/init.d.

If you look at the /usr/sbin/service script, you can find an if statement like this:

if ! grep -qs "\Wstatus)" "$SERVICE"; then
    #printf " %s %-60s %s\n" "[?]" "$SERVICE:" "unknown" 1>&2
    echo " [ ? ]  $SERVICE" 1>&2
    continue
else
Khaled
  • 35,688
  • 8
  • 69
  • 98
  • 1
    ... and since that regular expression is not correct, it will also falsely print a `?` if the `status)` line does not have a non-"[:alnum:]" character in front of it. – faker Nov 07 '12 at 17:02