LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-22-2013, 11:04 PM   #1
Nikhil_Lagwankar
Member
 
Registered: Aug 2013
Location: Pune
Distribution: Centos, Ubuntu, Fedora
Posts: 36

Rep: Reputation: 0
What are services ???


Hi,


I've been trying to search this for a long time..

What exactly is a service in linux. Is it anyway related to applications. When i install a .rpm, how do I find out if it has started any service.

My main aim is to find all services in the OS and classify them into some meaningful groups. So i need the above info.

I'm working on CentOS 6.4 system.
 
Old 09-22-2013, 11:24 PM   #2
sxa
Senior Member
 
Registered: Aug 2003
Location: Austin, TX
Distribution: Mac OS 10.7 / CentOS 6(servers) / xubuntu 13.04
Posts: 1,186

Rep: Reputation: 49
"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.
 
Old 09-22-2013, 11:49 PM   #3
Nikhil_Lagwankar
Member
 
Registered: Aug 2013
Location: Pune
Distribution: Centos, Ubuntu, Fedora
Posts: 36

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sxa View Post
Not all applications that you install will provide a daemon or service.
Hey thanks for the quick reply..

how can i find which application started that service?

Last edited by Nikhil_Lagwankar; 09-23-2013 at 12:20 AM.
 
Old 09-23-2013, 12:47 AM   #4
sxa
Senior Member
 
Registered: Aug 2003
Location: Austin, TX
Distribution: Mac OS 10.7 / CentOS 6(servers) / xubuntu 13.04
Posts: 1,186

Rep: Reputation: 49
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?
 
Old 09-23-2013, 01:08 AM   #5
Nikhil_Lagwankar
Member
 
Registered: Aug 2013
Location: Pune
Distribution: Centos, Ubuntu, Fedora
Posts: 36

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sxa View Post
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 ...
 
Old 09-23-2013, 01:33 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,913

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
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)
 
Old 09-23-2013, 02:19 AM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by Nikhil_Lagwankar View Post
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.
 
Old 09-24-2013, 04:49 AM   #8
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,832
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by Nikhil_Lagwankar View Post
Hey thanks for the quick reply..

how can i find which application started that service?
Systemd or System V (init / runlevels) controles the daemons / services on startup.

/etc will give you info or systemctl

Last edited by zeebra; 09-24-2013 at 05:01 AM.
 
Old 09-24-2013, 05:08 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,913

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
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.
 
Old 09-24-2013, 05:20 AM   #10
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,832
Blog Entries: 17

Rep: Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638Reputation: 638
Quote:
Originally Posted by pan64 View Post
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.
 
Old 09-24-2013, 08:58 PM   #11
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,341
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Try

Code:
ps -ejH
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.

See man ps for more information.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
services-admin/Services deardron Ubuntu 7 09-22-2006 08:32 PM
Media Services on Linux platform similar to Windows Media Services happyok Linux - Software 3 05-27-2006 04:36 PM
TightVNC Ver terminal Services.. also looking for terminal Services for linux 2782d4 Linux - Security 3 05-20-2004 02:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:42 PM.

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