14

Is there a way to get precise list of services with "is running"/"is not running" statuses specified.

service --status-all

outputs more than 30 ? services.

Why is that output is so not informative? Is it that difficult to determine if service is running or not? And how to get the exact statuses for all services?

zerkms@ubuntu-server-11:~$ sudo service --status-all 2>&1|grep cron
 [ ? ]  cron
zerkms@ubuntu-server-11:~$ sudo service cron status
cron start/running, process 804
zerkms
  • 1,472
  • @Rinzwind: it returns several services with + and -, but most of services are marked with ?. It is just installed ubuntu-server 11.04 – zerkms Aug 06 '11 at 06:40
  • @Rinzwind: added the output sample to clarify what I mean – zerkms Aug 06 '11 at 06:44

1 Answers1

6

It seems a bug in the service script. Changing the grep pattern in line 77 with this gives better results:

"\(^\|\W\)status)"

Edit

Found a bug report in Debian on this. A patch is available, functionally equivalent to what I write above: service doesn't correctly parse "cron" init.d. Launchpad do not recognize the project sysvinit-utils.

enzotib
  • 93,831