Knowledge

Orphan process

Source 📝

22: 205:
twice, running the desired process in the grandchild, and immediately terminating the child. The grandchild process is now orphaned, and is not adopted by its grandparent, but rather by init. Higher-level alternatives circumvent the shell's hangup handling, either telling the child process to ignore
153:
and occurs automatically. Even though technically the process has a system process as its parent, it is still called an orphan process since the process that originally created it no longer exists. In other systems orphaned processes are immediately terminated by the kernel. Most Unix systems have
214:
in either case). In any event, the session id (process id of the session leader, the shell) does not change, and the process id of the session that has ended is still in use until all orphaned processes either terminate or change session id (by starting a new session via
196:
It is sometimes desirable to intentionally orphan a process, usually to allow a long-running job to complete without further user attention, or to start an indefinitely running service or agent; such processes (without an associated session) are known as
300:
From Linux 3.4 onwards processes can issue the prctl() system call with the PR_SET_CHILD_SUBREAPER option, and as a result they, not process #1, will become the parent of any of their orphaned descendant
246:
Expiration is a technique where each process is allotted a certain amount of time to finish before being killed. If need be a process may "ask" for more time to finish before the allotted time expires.
233:
A server process is also said to be orphaned when the client that initiated the request unexpectedly crashes after making the request while leaving the server process running.
236:
These orphaned processes waste server resources and can potentially leave a server starved for resources. However, there are several solutions to the orphan process problem:
226:
so that processes not designed to be used as services respond correctly to system signals. An alternative to keep processes running without orphaning them is to use a
149:
any orphaned process will be immediately adopted by an implementation-defined system process: the kernel sets the parent to this process. This operation is called
243:
Reincarnation is a technique in which machines periodically try to locate the parents of any remote computations; at which point orphaned processes are killed.
230:
and run the processes in a detached session (or a session that becomes detached), so the session is not terminated and the process is not orphaned.
295: 177:
mechanism in most Unix-like operating systems can be used to help protect against accidental orphaning, where in coordination with the user's
86: 58: 65: 189:, when the shell exits, because it is the "session leader" (its session id equals its process id), the corresponding 105: 39: 72: 43: 281: 332: 210:), or removing the job from the job table or telling the shell to not send SIGHUP on session end (by using 54: 261: 198: 312: 173:
A process can be orphaned unintentionally, such as when the parent process terminates or crashes. The
32: 193:
ends, and the shell sends SIGHUP to all its jobs (internal representation of process groups).
166:, and Linux systems, an orphan process may be reparented to a "subreaper" process instead of 79: 227: 8: 123: 202: 186: 131: 240:
Termination is the most commonly used technique; in this case the orphan is killed.
185:), rather than letting them continue to run as orphans. More precisely, as part of 146: 223: 256: 127: 326: 211: 190: 174: 159: 201:, particularly if they are indefinitely running. A low-level approach is to 181:
will try to terminate all the child processes with the "hangup" signal (
178: 158:
as the system process to which orphans are reparented, but in modern
143: 21: 222:
To simplify system administration, it is often desirable to use a
163: 182: 207: 319:, by Erik W. Troan and Michael K. Johnson, Jul 8, 2005 46:. Unsourced material may be challenged and removed. 317:The Process Model of Linux Application Development 296:"New parent process when the parent process dies" 324: 106:Learn how and when to remove this message 325: 134:, though it remains running itself. 44:adding citations to reliable sources 15: 13: 14: 344: 282:"What is a "subreaper" process?" 20: 31:needs additional citations for 313:10.6.4 Orphaned Process Groups 288: 274: 1: 267: 137: 7: 250: 10: 349: 228:terminal multiplexer 40:improve this article 333:Process (computing) 154:historically used 206:SIGHUP (by using 116: 115: 108: 90: 340: 304: 303: 292: 286: 285: 278: 218: 147:operating system 130:has finished or 124:computer process 111: 104: 100: 97: 91: 89: 55:"Orphan process" 48: 24: 16: 348: 347: 343: 342: 341: 339: 338: 337: 323: 322: 308: 307: 294: 293: 289: 280: 279: 275: 270: 253: 224:service wrapper 216: 140: 112: 101: 95: 92: 49: 47: 37: 25: 12: 11: 5: 346: 336: 335: 321: 320: 306: 305: 287: 272: 271: 269: 266: 265: 264: 262:Daemon process 259: 257:Zombie process 252: 249: 248: 247: 244: 241: 139: 136: 128:parent process 120:orphan process 114: 113: 28: 26: 19: 9: 6: 4: 3: 2: 345: 334: 331: 330: 328: 318: 314: 310: 309: 302: 297: 291: 283: 277: 273: 263: 260: 258: 255: 254: 245: 242: 239: 238: 237: 234: 231: 229: 225: 220: 213: 209: 204: 200: 194: 192: 191:login session 188: 184: 180: 176: 175:process group 171: 169: 165: 161: 160:DragonFly BSD 157: 152: 148: 145: 135: 133: 129: 125: 121: 110: 107: 99: 96:February 2016 88: 85: 81: 78: 74: 71: 67: 64: 60: 57: –  56: 52: 51:Find sources: 45: 41: 35: 34: 29:This article 27: 23: 18: 17: 316: 299: 290: 276: 235: 232: 221: 195: 172: 167: 155: 151:re-parenting 150: 141: 119: 117: 102: 93: 83: 76: 69: 62: 50: 38:Please help 33:verification 30: 187:job control 301:processes. 268:References 132:terminated 66:newspapers 217:setsid(2) 144:Unix-like 138:Unix-like 327:Category 251:See also 199:daemons 164:FreeBSD 80:scholar 212:disown 183:SIGHUP 126:whose 82:  75:  68:  61:  53:  208:nohup 179:shell 142:In a 122:is a 87:JSTOR 73:books 203:fork 168:init 156:init 59:news 315:", 219:). 118:An 42:by 329:: 298:. 170:. 162:, 311:" 284:. 109:) 103:( 98:) 94:( 84:· 77:· 70:· 63:· 36:.

Index


verification
improve this article
adding citations to reliable sources
"Orphan process"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
computer process
parent process
terminated
Unix-like
operating system
DragonFly BSD
FreeBSD
process group
shell
SIGHUP
job control
login session
daemons
fork
nohup
disown
service wrapper
terminal multiplexer
Zombie process

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.