LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-22-2009, 09:36 AM   #1
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu 10.04, Debian Squeeze, Windoze 7
Posts: 512

Rep: Reputation: 34
Show list of running tasks from services / init.d in Debian / Ubuntu?


Hi there

I am currently creating a powersave program that is pretty simple:

Make a list of services / init.d "services" that are running, shut them down via init.d scripts (the proper way) for power save and then (since the list was saved) restart them later again.

I have tried this out and there is a lot of watts to save.

But how can I figure out which init.d services are running currently?
most init.d scripts under Debian / Ubuntu don't offer a status function (running / not running)

Is there a standardized way these services and servers log themselved in some directory so that I can know that they are running?

I can of course see a list of them running with ps, but not from which init.d script they originated.

Cheers

Markus
 
Old 01-23-2009, 05:00 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
This isn't foolproof, but you may be able to adapt it to your needs ... A lot of services will write a /var/run/*.pid file. In many case the asterisk (*) will be the name of the file in /etc/init.d. Sadly, this is not always the case.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show what services are running? lewkh Debian 8 07-22-2014 09:30 AM
Seeing which services are running on debian and identifying which I can remove Maverick1182 Debian 2 01-12-2009 09:31 AM
How do I get a list of services running on my computer? imsam Linux - Newbie 4 10-27-2004 12:59 AM
newbie: how to see see what services my machine is running under init.d ? sirpelidor Linux - Newbie 2 06-24-2004 02:20 PM
Command to show services running? AMDPwred Linux - General 12 03-03-2002 11:59 PM


All times are GMT -5. The time now is 11:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration