- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- pid becoming 1
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2006 11:20 AM
04-23-2006 11:20 AM
One day i read a post on this forum that a process can't be killed if its pid becomes 1.
I couldn't understand in what situation a process can acquire pid number of 1.
I know only init deamon has pid of 1.
Can anyone explain how can a process achieve pid of 1 ?
Why some processes can't be killed with $kill -9 ?
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2006 11:30 AM
04-23-2006 11:30 AM
Re: pid becoming 1
A proccess can aquire PPID=1 if it is started by init proccess or in some cases when their the parent proccess of the proccess gets killed then this running proccess PPID becomes 1. But never will a proccess other than init has PID=1
Second question..
Some proccess can not be killed with -9 option if they are waiting for some resource. Say some proccess is doing some IO, maybe writing for to disk and until it is completed the proccess wont get detached and killed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2006 11:42 AM
04-23-2006 11:42 AM
SolutionAll processes must be associated with a parent. When a child process terminates (normally or abnormally) the parent process that spawned ("forked") it can check its status in the process table. A side-effect of the status check is that the pid of the child is removed from the system process table --- a very desirable thing, since the process table has a finite size. You will remember that the kernel parameter 'nfile' sets the overall number of slots in the process table.
If the parent process dies before its child, the responsibility of "reaping" (checking a child's status and removing its pid from the process table) is given to 'init' (whose pid=1). That is, the parent-less child process is adopted by 'init'.
Processes that are in kernel code or most notablly are waiting on an I/O, cannot be killed (even with the untrappable signal 9). For a proceess to be killed, it must first be able to run again.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2006 08:38 PM
04-23-2006 08:38 PM
Re: pid becoming 1
When a child process becomes orphan, its PPID will become 1. You can find more information at http://en.wikipedia.org/wiki/Orphan_process
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2006 01:22 AM
04-24-2006 01:22 AM
Re: pid becoming 1
What are the commands to find out:-
1) a process is in kernel mode
2) a process is waiting for i/o
Thanks,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2006 01:30 AM
04-24-2006 01:30 AM
Re: pid becoming 1
If you have glance installated , you can run glance and then press s and give pid of a process, this will show you the % time spent by that process in various states like system(kernel mode), user mode, interrupt etc etc.
Its really hard to know the instantaneous state of a process as there are lots of processes running on your system getting their bit of CPU time every few milliseconds. But the glance I mentione above will show you for what that process is waiting - IO , Nice , System, shared memory etc.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2006 02:02 AM
04-24-2006 02:02 AM
Re: pid becoming 1
Once a process has a parent of 1, you can't do a kill -9 because its parent is the entire system. The results of allowing this would be catastrophic. Sometimes however, a regular kill can get the process.
You can lean a lot about a process as follows:
UNIX95=1
then use ps
The man page is full of dozens of wonderful options.
glance gpm is a quicker less fun (fun defined as cool geek tricks) way to answer your second questions.
SEP
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2006 02:46 AM
04-24-2006 02:46 AM
Re: pid becoming 1
The problem with all determinations of the state of an active process is that a probe is only a snapshot in time and may not reflect what the process was doing at any instant. A process will oscillate between user and kernel mode. In user mode, variables are store, subroutines in the user's code are executed. In kernel moce, system calls are executed.
You can use 'ps' and look at the value of the 'flags' and 'state' to determine some of a process's state. For example, for all processes or a process by name, you could do:
# UNIX95= -e -o comm,pid,ppid,flags,state
# UNIX95= -C syslogd -o comm,pid,ppid,flags,state
Perhaps this helps.
Regards!
...JRF...