Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
    
@Rinzwind: it returns several services with + and -, but most of services are marked with ?. It is just installed ubuntu-server 11.04 –  zerkms Aug 6 '11 at 6:40
    
@Rinzwind: added the output sample to clarify what I mean –  zerkms Aug 6 '11 at 6:44

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
    
Yep, now looks much better. Could you please file a bug then? (I'm not proficient in ubuntu at all, and don't even know where their bug tracker is) ;-) –  zerkms Aug 6 '11 at 7:24
    
Of course, i'll do, if it is not signaled yet –  enzotib Aug 6 '11 at 7:26
    
ok. Checked your answer. PS: please add a reference to a bug then after, so I could track it ;-) –  zerkms Aug 6 '11 at 7:28
    
thanks for the reference. Surprisingly the bug committer chose the cron too ;-) –  zerkms Aug 6 '11 at 8:52
    
Thanks, that fixed most of the ?s, though not all. Among others Citadel is still showing a ?. –  Lance Roberts Aug 21 '11 at 20:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.