5

by this command service --status-all . I can find all services status. in every line there is + or - or ?. Easy to guess + and - which may be refer to running service and not running (I'm not sure).But do not know this ? symbol meaning before services.

Mohammad Reza Rezwani
  • 10,286
  • 36
  • 92
  • 128

1 Answers1

5

The question mark indicates that service was not able to determine the status of the running service since it did not find the status line in the related script in /etc/init.d

The service command has a snippet as follows:

if ! grep -qs "\Wstatus)" "$SERVICE"; then
    #printf " %s %-60s %s\n" "[?]" "$SERVICE:" "unknown" 1>&2
    echo " [ ? ]  $SERVICE" 1>&2
    continue

which indicates that it will mark the status of a service as [?] if it does not find a line which has the word status after any non-word character in the related service's file in /etc/init.d.

For example, I have the following cases to consider for this specific example

  • For [+] acpid, if I browse the file /etc/init.d/acpid I get the following line:

    status)
    status_of_proc "$ACPID" acpid
    

which I presume is what service is looking for.

  • For [?] apport, I don't find a line with the word status preceded by a non-word character which service was looking for. Thus, it prepends a [?] before the service name when you do a sudo service --status-all.

See also: An exactly similar question on Serverfault.

jobin
  • 27,708