The tag has no wiki summary.

learn more… | top users | synonyms

24
votes
4answers
2k views

What's the difference between running a program as a daemon and forking it into background with '&'?

What are the practical differences from a sysadmin point of view when deploying services on a unix based system?
5
votes
2answers
1k views

Process descendants

I'm trying to build a process container. The container will trigger other programs. For example - a bash script that launches running background tasks with '&' usage. The important feature I'm ...
30
votes
2answers
3k views

Why is the default process creation mechanism fork?

The UNIX system call for process creation, fork(), creates a child process by copying the parent process. My understanding is that this is almost always followed by a call to exec() to replace the ...
12
votes
1answer
899 views

How does a fork bomb work?

WARNING DO NOT ATTEMPT TO RUN THIS ON A PRODUCTION MACHINE In reading the Wikipedia page on the topic I generally follow what's going on with the following code: :(){ :|:& };: excerpt of ...
9
votes
1answer
3k views

What's the difference between fork() and vfork()?

I would like to understand in detail the difference between fork() and vfork(). I was not able to digest the man page completely. I would also like to clarify one of my colleagues comment "In ...
5
votes
3answers
186 views

Coloring output of forked processes

I have a runscript that starts some processes and sends them to the background mongod & pid_mongo=$! redis-server & pid_redis=$! # etc. All these processes then output concurrently to ...
5
votes
1answer
234 views

Why is the following command killing a system?

Anyone understand the following code , running in bash ? :(){ :|:& };: It seems to be a "fork" bomb on Linux.
4
votes
2answers
1k views

Fork call and recursion

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { fork(); fork(); fork(); puts("hi"); return 0; } This program ...
0
votes
0answers
38 views

How to fork multiple processes from a same parent´╝č

I am trying to create multiple processes from a same parent, but it always ended up with more processes than expected. I couldn't figure out how to do it and need some help here. I found a piece of ...