Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by BharathKumarRaju DasaraRaju
at 2024-08-01 20:33:33
Point:500 Replies:7 POST_ID:828659USER_ID:11540
Topic:
Linux;Unix Operating Systems;Linux Distributions
could you please help me on my clarifications.
1). As of my understanding if we execute any program (or) or even simple command like ls ....the process will create with the same name of the program which we executed.If 10 users run the same telnet program in a server machine it means all the processes has same name how system differentiate them...is it by different PID's?
2).What happens when we execute the sevice httpd stop... I would like to know the how the processes will be killed. IF all httpd process klled still i found some of the processes like " root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd " which are root owned processes not be killed. I manually went and killed and restarted the apache then it works finally well.
[root@localhost ~]# ps -eaf | grep -i httpd
root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2118 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2119 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2120 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2121 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2122 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2123 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2124 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2125 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
My Aim is to know the how init take cares of all the processes in the unix/linux system.
in the above example root owned PPID 1 that is init how it comes here i mean for the apache processes
1). As of my understanding if we execute any program (or) or even simple command like ls ....the process will create with the same name of the program which we executed.If 10 users run the same telnet program in a server machine it means all the processes has same name how system differentiate them...is it by different PID's?
2).What happens when we execute the sevice httpd stop... I would like to know the how the processes will be killed. IF all httpd process klled still i found some of the processes like " root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd " which are root owned processes not be killed. I manually went and killed and restarted the apache then it works finally well.
[root@localhost ~]# ps -eaf | grep -i httpd
root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2118 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2119 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2120 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2121 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2122 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2123 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2124 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2125 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
My Aim is to know the how init take cares of all the processes in the unix/linux system.
in the above example root owned PPID 1 that is init how it comes here i mean for the apache processes
Author: BharathKumarRaju DasaraRaju replied at 2024-08-06 07:20:14
@Tintin ....Thank you so much fro your reply....since i was not able to access the net i was not able to reply instantly thank you.
Author: BharathKumarRaju DasaraRaju replied at 2024-08-02 01:37:41
@duncanb7
oh iam sorry....thanks for reminding...will remove one question
oh iam sorry....thanks for reminding...will remove one question
Expert: duncanb7 replied at 2024-08-01 22:40:57
Is it same or similar topic as the following link ?
http://www.experts-exchange.com/OS/Linux/Q_28202050.html
http://www.experts-exchange.com/OS/Linux/Q_28202050.html
Accepted Solution
Expert: Tintin replied at 2024-08-01 21:45:38
500 points GOOD
If your parent apache process isn't cleanly dieing all the time, then it indicates an issue with your environment.
Best to look in your apache logs to see if there are any clues.
If you have orphaned apache processes after trying a clean shutdown, eg:
service apache stop
/etc/init.d/apache stop
etc
then you can clean up with
pkill httpd
Assuming your system has the pkill command.
Best to look in your apache logs to see if there are any clues.
If you have orphaned apache processes after trying a clean shutdown, eg:
service apache stop
/etc/init.d/apache stop
etc
then you can clean up with
pkill httpd
Assuming your system has the pkill command.
Author: BharathKumarRaju DasaraRaju replied at 2024-08-01 21:31:16
@Tintin...
This is the one line script i have used lol :) :)
Could you implement it and let me know whether it is useful or not? Which i executed this script after stopping the apache(httpd)
ps -eaf | grep -i httpd | grep "<1>" | awk '{ print $2}' | xargs kill -9
This is the one line script i have used lol :) :)
Could you implement it and let me know whether it is useful or not? Which i executed this script after stopping the apache(httpd)
ps -eaf | grep -i httpd | grep "<1>" | awk '{ print $2}' | xargs kill -9
Author: BharathKumarRaju DasaraRaju replied at 2024-08-01 21:18:11
@Tintin
Thank you so much for your answer.
Okay in below case all the apache processes have same PPID 2111 except root...all the process has been killed except root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd
when i was stopping ....when it will be killed. some i manually went and killed it and again i started the apache....i would like to write an automatic script to kill all these processes not only apache but also what are the all the web servers present on my machine...could you please suggest me whether my ideas is good or not?
[root@localhost ~]# ps -eaf | grep -i httpd
root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2118 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2119 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2120 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2121 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2122 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2123 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2124 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2125 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
Thank you so much for your answer.
Okay in below case all the apache processes have same PPID 2111 except root...all the process has been killed except root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd
when i was stopping ....when it will be killed. some i manually went and killed it and again i started the apache....i would like to write an automatic script to kill all these processes not only apache but also what are the all the web servers present on my machine...could you please suggest me whether my ideas is good or not?
[root@localhost ~]# ps -eaf | grep -i httpd
root 2111 1 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2118 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2119 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2120 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2121 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2122 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2123 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2124 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
apache 2125 2111 0 19:31 ? 00:00:00 /usr/sbin/httpd
Expert: Tintin replied at 2024-08-01 21:09:36
When apache is started it is started as the root user. This process is spawned by init, hence the Parent PID (PPID) is 1.
When this process has started, it then spawns all the child processes as the apache user.
When it comes time to shutdown apache, the signal is sent to the parent process and it shutdowns all the child processes at which point it ends.
When this process has started, it then spawns all the child processes as the apache user.
When it comes time to shutdown apache, the signal is sent to the parent process and it shutdowns all the child processes at which point it ends.