Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to list init daemons
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
WaMan
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jun 2002
Posts: 96

PostPosted: Sun Apr 20, 2003 3:53 am    Post subject: how to list init daemons Reply with quote

Is there a simple command that lists the services/daemons that are currently running?



Cheers,
Back to top
View user's profile Send private message
ferringb
Retired Dev
Retired Dev


Joined: 03 Apr 2003
Posts: 357

PostPosted: Sun Apr 20, 2003 6:24 am    Post subject: Re: how to list init daemons Reply with quote

WaMan wrote:
Is there a simple command that lists the services/daemons that are currently running?

Depends on what you're after... and pardon if I sound patronizing, I don't know what you know...
You can use ps to get a pretty good idea of what's running on your system- I personally make heavy use of 'ps aux' and 'ps acux';

offhand, and this may be wrong, a is for all users, u is for a more user friendly format, x has ps not limit itself to the controlling terminal (shows all processes), finally c, which reduces it down to the command name.

so under 'ps aux', the xmms would be listed as '/usr/bin/xmms', under 'ps acux' it would be listed as 'xmms'

Then there is also top , which lists the processes and [can] sort them via the most memory/cpu hungry...

Finally, if you're just after trying to find out what init scripts are ran at startup, take a look in /etc/runlevels/default/
Back to top
View user's profile Send private message
Jimbow
Guru
Guru


Joined: 18 Feb 2003
Posts: 597
Location: Silver City, NM

PostPosted: Sun Apr 20, 2003 6:59 am    Post subject: Reply with quote

In addition to the excellent suggestions ferringb gave, you can get another view of which services are running with "netstat -aut" (netstat is part of the net-tools package). It tells you what programs are listening for connections. Here is an example of the output on my system:
Code:
# netstat -aut
tcp        0      0 *:cvspserver            *:*                     LISTEN
tcp        0      0 *:gkrellmd              *:*                     LISTEN
tcp        0      0 localhost:spamd         *:*                     LISTEN
tcp        0      0 *:Xwindows              *:*                     LISTEN
tcp        0      0 localhost:631           *:*                     LISTEN
tcp        0      0 *:smtp                  *:*                     LISTEN
udp        0      0 *:631                   *:*

I then found out what program was listening on port 31 with the lsof program (part of lsof package):
Code:
# lsof -i:631
COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME
cupsd   1306 root    0u  IPv4   4455       TCP localhost:631 (LISTEN)
cupsd   1306 root    2u  IPv4   4456       UDP *:631


One distinct benefit of using netstat to look for services is that some systems use inetd or its equivalent to listen on ports instead of the actual daemons. When a client makes a connection, inetd starts up the appropriate daemon. This means a service might be available even though its daemon is not running and doesn't show up in ps.
_________________
After Perl everything else is just assembly language.
Back to top
View user's profile Send private message
dev
Apprentice
Apprentice


Joined: 06 Jul 2002
Posts: 248
Location: San Antonio, TX

PostPosted: Sun Apr 20, 2003 12:06 pm    Post subject: Reply with quote

This *might* be what you're looking for.. if you're used to mandrake/redhat.

https://forums.gentoo.org/viewtopic.php?t=24919&highlight=chkconfig
Back to top
View user's profile Send private message
WaMan
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jun 2002
Posts: 96

PostPosted: Sun Apr 20, 2003 1:46 pm    Post subject: Reply with quote

Thanks for the replys.

Certain deamons I start manually, instead of putting them in the default runlevel. And sometimes I can't remember what I started. I could grep through a ps looking for all my init scripts, but it seems there should be a way to see what has been spawned manually after boot.

Cheers
Back to top
View user's profile Send private message
Jimbow
Guru
Guru


Joined: 18 Feb 2003
Posts: 597
Location: Silver City, NM

PostPosted: Sun Apr 20, 2003 6:13 pm    Post subject: Reply with quote

You can get a list of /etc/init.d/* scripts that are running (started but not stopped) by doing
Code:
 ls /mnt/.init.d/started/

_________________
After Perl everything else is just assembly language.
Back to top
View user's profile Send private message
WaMan
Tux's lil' helper
Tux's lil' helper


Joined: 28 Jun 2002
Posts: 96

PostPosted: Sun Apr 20, 2003 11:01 pm    Post subject: Reply with quote

Excellent! That's what I'm talking about!

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum