So i created ac program in unix. This is what it does.
1)It forks a process.
Child Process: Performs execv() on a alarm clock program which prints "Alarm rang" after 'x' seconds
Parent Process: Performs waitPID on child above. Then exits.
Output: So i ran it and i received the "Alarm rang after x seconds"
Everything is working fine. But now what i want is for the child process to run in the background. Meaning i do not want to see its output. but i want it to run and exit.
To make the child process run in the background, you need to make it a daemon process .
There are few steps to follow to make it a daemon process..
For a better explanation, see this .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.