July 2018
Beginner to intermediate
668 pages
16h 29m
English
In Linux, there are three different ways to start a daemon:
But historically, there is only one primary method to create a new process—this is done by using the fork() function; the function takes its name from this bifurcation process. So, let's analyze the fork() function closely because it is the key topic of this recipe:
pid := fork();if (pid < 0) then raise Exception.Create('Error in forking the process');// If we got a good PID, then we can KILL the parent process.if (pid > 0) thenbegin Log('3. INTO FORK - PARENT PROCESS - EXIT SUCCESS'); Halt(EXIT_SUCCESS);end;// Daemon execution here...
The fork() function is used to create a new process. Once executed, we ...
Read now
Unlock full access