LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, Debian Buster Stable, Windoze 7
Posts: 684

Rep: Reputation: 56
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



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 10 05-14-2019 04:31 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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:23 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration