Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mac OS 10.7 / CentOS 6(servers) / xubuntu 13.04
Posts: 1,186
Rep:
"Services" are defined as daemons that run in the background and do various different tasks. Some services might have several daemons associated with them. Not all applications that you install will provide a daemon or service.
Since you are on CentOS you can check the status of services by running the following command:
# chkconfig --list
If you want to list only services that are currently running:
# service --status-all
For example, if you have the httpd service running, but you have no need to serve web content using Apache you will want to disable that service by running this command:
# service httpd stop
You can also configure services to start by using chkconfig. So say you had a need to run mysqld at start-up you would do:
# chkconfig mysqld on
I hope this information is a good starting point for you, if you have any other specific questions I will be happy to try to answer them for you.
Distribution: Mac OS 10.7 / CentOS 6(servers) / xubuntu 13.04
Posts: 1,186
Rep:
As far as I know (and someone can correct me) there is no mapping of RPMs installed to daemons that exist. Often times it is self explantory (mysql package provides mysqld, snmp package provides snmpd, etc). Are there are any specifc daemons that you are curious about? Is there something in particular you are wishing to accomplish or just looking for information?
Are there are any specifc daemons that you are curious about? Is there something in particular you are wishing to accomplish or just looking for information?
I'm not concentrating on any specific daemon....
I'm trying to find a link between the applications we install and the daemons that are running .... so something like if i install an application and forget about ... suppose i never use it later ... the daemon of that application may keep running and it will use my resources... so when i find such a daemon i may be able to find the application and remove it from my system ...
for every file you installed there is an entry in the package management system - database, therefore you can ask the system "how it was installed, which package(s) contain(s) that file". But you can create services by yourself (using system commands) and in that case there will be no package associated with it. http://prefetch.net/articles/yum.html (see whatprovides)
I'm trying to find a link between the applications we install and the daemons that are running .... so something like if i install an application and forget about ... suppose i never use it later ... the daemon of that application may keep running and it will use my resources... so when i find such a daemon i may be able to find the application and remove it from my system ...
For running processes, you can try to use 'ps' or 'pstree' (pstree is probably clearer, but may not be part of a default install). so something like
Code:
ps -ejH
will give you an indented list that tells you which processes have spawned which other processes. Of course, it doesn't tell you if, for example, OfficeApp1 would spawn lots of services (if it ran), but you haven't run OfficeApp1. There might be some help for that from package management (all the 'depends' and 'requires' stuff), but, if it isn't running, you may well not be interested.
In any case, I should point out that a daemon that isn't doing anything probably isn't using much in the way of resources in order to (not) do it. There is probably a security aspect (...if you don't run it, it isn't available to exploit...), but except for situations such as embedded, which tend to be very resource constrained, it is more a matter of feeling that you have practised 'good hygiene' than liberating a mass of unused processors cycles, to make your computer suddenly feel speedy.
that means services started by the system, not by your apps. As a first tip you can always check the pid of the parent process.
Yes, that's right. Sorry.
There are a number of useful tools for finding out which process/program runs a service.
Personally I prefer to use a GUI for this, specifically KDE and a program called "ksysguard". It will tell you exactly what owns each process. I am sure there are many programs that are better for doing this. I am not familiar with all of the commands above, but I am sure they also help in that.
The ones described by salasi for sure works.
But for what a process is and how they work, then you should also look into systemd etc.
to display a "process tree" that shows the relationships among processes (AKA services). I'm not sure it does exactly what you want, but it should help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.