LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   daemon process (https://www.linuxquestions.org/questions/linux-networking-3/daemon-process-552558/)

mallikk_in 05-09-2007 07:08 AM

daemon process
 
what is the use of daemon process and how to make it as foreground process?
waiting for your reply..............

MensaWater 05-09-2007 07:17 AM

Sounds suspiciously like a test question. You might want to do your own homework.

mallikk_in 05-09-2007 07:49 AM

In my interview they asked me.thats why iam asking pls help me.i tried but i couldn't able to find out.

MensaWater 05-09-2007 08:20 AM

A daemon is a background process that waits for work to do. Typically it LISTENs on a specific port and when it gets a request does whatever it is designed for.

Some examples:
sendmail = Waits for requests to do mail
sshd = Waits for ssh (user login/command) requests
nfsd = Waits for requests from remote hosts to allow filesystems to be mounted from local host to remote host.

xinetd (or inetd) = Specialized daemon that is configured to listen for other items that you don't want running as daemons of their own. Some daemons have low usage so there is no reason to eat up CPU by running them all the time. By having xinetd LISTEN for their ports it can be used to only start the daemon when it knows there is a request for it. An example would be ftpd. ftpd is designed for allowing remote users to connect and transfer files. There is no reason for ftpd to be running all the time on most servers so it would typically only be started via xinetd (or inetd).

Most daemons are started at your boot up by init scripts. If you didn't start it from terminal you can't really bring it into the foreground later. You can actually start things as daemons from the command line by backgrounding them. This is done by putting "&" at the end of the command line. Also for such backgrounded processes to stay running after you log out of the terminal you would have to use the "nohup" command at the start of the command line. If you did background a job at command line you can bring it back to the foreground by using fg.

The following commands will give you more information:
man bash
Look at "fg", "bg", background in that man page.

man nohup

mallikk_in 05-09-2007 08:49 AM

thankyou very much for your help.


All times are GMT -5. The time now is 08:52 AM.