Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

run daemon from a shell

Posted on 2002-03-21
19
Medium Priority
?
372 Views
Last Modified: 2010-04-20
hello,

when I run a daemon from a shell(with &), it always creates 6 pids. It looks very noisy. I am wondering why & how to get rid of this?

Regards,
Edward
0
Comment
Question by:luqiyi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 3
  • 3
  • +2
19 Comments
 
LVL 4

Expert Comment

by:MFCRich
ID: 6886263
Which daemon? Which distro?
0
 

Author Comment

by:luqiyi
ID: 6886336
any application/daemon running background.
0
 

Author Comment

by:luqiyi
ID: 6886339
on Linux
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
LVL 1

Expert Comment

by:Sixpax
ID: 6886415
What is it you are wanting to get rid of?  You want to run a daemon but you don't want it to start any processes?

Are you wanting it to run automatically at boot up instead of from the command line perhaps?
0
 

Author Comment

by:luqiyi
ID: 6886570
on Linux
0
 
LVL 4

Expert Comment

by:MFCRich
ID: 6886573
Different daemons require different command-line options and configurations.

Linux? Thats the OS but what about the distro? (eg RedHat 7.2)
0
 

Author Comment

by:luqiyi
ID: 6886602
eg. the httpd

ps -ef

root      1137     1  0 Mar20 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    1138  1137  0 Mar20 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    1139  1137  0 Mar20 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    1140  1137  0 Mar20 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    1141  1137  0 Mar20 ?        00:00:00 /usr/local/apache/bin/httpd
nobody    1142  1137  0 Mar20 ?        00:00:00 /usr/local/apache/bin/httpd

actually there is only one process, comes with 6 pid. some applications need to do this. but why linux? and why I HAVE TO start the daemon at boot up. I just want to start them on command line, just like 'foo &'.

Rgds,
Edward

0
 

Author Comment

by:luqiyi
ID: 6886632
I mean why linux forces applications fork 6 children? /Ed
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6886709
chanhge the value of
   StartServers
in your httpd.conf
0
 
LVL 4

Accepted Solution

by:
MFCRich earned 450 total points
ID: 6887013
Linux doesn't do it -- Apache does.

This is part of its design and helps it to perform its job quickly.
0
 

Author Comment

by:luqiyi
ID: 6887038
I tried this, set it to 0 and 1, now I kill the old process and restart it again, and I got 9 pids:)))

And what does this option mean? How do I control this for any other daemons?

Regards,
Edward
0
 

Author Comment

by:luqiyi
ID: 6887085
MFCRich, right, it looks like the application itself doing this. I just wrote a simple loop program, and it runs fine. Is there anyway I can force the daemon not to do this?

Rgds,
Edward
0
 

Author Comment

by:luqiyi
ID: 6887092
where can I find any documents explaining how it works and how it performs job quickly?
0
 
LVL 4

Expert Comment

by:newmang
ID: 6887094
Look at the MinSpareServers and MaxSpareServers settings as well. Apache will create more servers to ensure there are always MinSpareServers available to service requests from clients and will then start killing off spare servers when MaxSpareServers are in existence but this does not always happen immediately. I wouldn't worry too much about the spare servers, if you did clamp them down so only one server was operating then Apache would have to spawn a new server process each time a user request came in - this would extend the response time for your users.

This is a tuning issue as each server consumes resources (especially if mod-perl is loaded) but you need enough spare server processes active to respond to peaks in client requests.

Hope this helps - Gavin
0
 

Author Comment

by:luqiyi
ID: 6887200
where can I find any documents explaining how it works and how it performs job quickly?
0
 

Author Comment

by:luqiyi
ID: 6887213
Thanks very much, Gavin. /Ed
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6887992
could you please explain the grading?
All you need to know about your multiple httpd problem can be found in httpd.conf, this file is documented as good as it's man-page.
0
 

Author Comment

by:luqiyi
ID: 7527391
ahoffmann,

Sorry I can only give the points to one person. I think EE should be improved because I want to give everyone who helped me, that points.

Thanks again.
Edward
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7529717
So you mean that my suggestion with the description in the graded answer helped you. That's ok ;-)
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question