version 1.17.8.1, 2007/10/30 19:19:26
|
version 1.17.8.2, 2008/02/06 20:41:57
|
|
|
| |
int ServerProcess::cimserver_fork() | int ServerProcess::cimserver_fork() |
{ | { |
getSigHandle()->registerHandler(SIGTERM, sigTermHandler); |
|
getSigHandle()->activate(SIGTERM); |
|
umask(S_IRWXG | S_IRWXO); | umask(S_IRWXG | S_IRWXO); |
| |
if (Executor::detectExecutor() == 0) | if (Executor::detectExecutor() == 0) |
{ | { |
// We don't need to fork if we're running with Privilege Separation | // We don't need to fork if we're running with Privilege Separation |
setsid(); |
|
return 0; | return 0; |
} | } |
| |
|
getSigHandle()->registerHandler(SIGTERM, sigTermHandler); |
|
getSigHandle()->activate(SIGTERM); |
getSigHandle()->registerHandler(PEGASUS_SIGUSR1, sigUsr1Handler); | getSigHandle()->registerHandler(PEGASUS_SIGUSR1, sigUsr1Handler); |
getSigHandle()->activate(PEGASUS_SIGUSR1); | getSigHandle()->activate(PEGASUS_SIGUSR1); |
| |
|
|
{ | { |
pid_t ppid = getppid(); | pid_t ppid = getppid(); |
if (id) | if (id) |
|
{ |
kill(ppid, SIGTERM); | kill(ppid, SIGTERM); |
|
} |
else | else |
|
{ |
|
if (Executor::detectExecutor() == 0) |
|
{ |
|
Executor::daemonizeExecutor(); |
|
} |
|
else |
|
{ |
kill(ppid, PEGASUS_SIGUSR1); | kill(ppid, PEGASUS_SIGUSR1); |
} | } |
|
} |
|
} |
| |
| |
// Platform specific run | // Platform specific run |