version 1.15, 2007/05/25 18:35:22
|
version 1.16, 2007/06/13 21:26:00
|
|
|
#include <unistd.h> | #include <unistd.h> |
| |
#include <Pegasus/Common/Signal.h> | #include <Pegasus/Common/Signal.h> |
|
#include <Pegasus/Common/Executor.h> |
| |
#define MAX_WAIT_TIME 240 | #define MAX_WAIT_TIME 240 |
| |
|
|
| |
int ServerProcess::cimserver_fork(void) | int ServerProcess::cimserver_fork(void) |
{ | { |
#if defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) |
|
|
|
getSigHandle()->registerHandler(SIGTERM, sigTermHandler); | getSigHandle()->registerHandler(SIGTERM, sigTermHandler); |
getSigHandle()->activate(SIGTERM); | getSigHandle()->activate(SIGTERM); |
umask(S_IRWXG | S_IRWXO); | umask(S_IRWXG | S_IRWXO); |
| |
|
if (Executor::detectExecutor() == 0) |
|
{ |
|
// We don't need to fork if we're running with Privilege Separation |
return 0; | return 0; |
|
} |
#else /* !defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ |
|
| |
getSigHandle()->registerHandler(PEGASUS_SIGUSR1, sigUsr1Handler); | getSigHandle()->registerHandler(PEGASUS_SIGUSR1, sigUsr1Handler); |
getSigHandle()->activate(PEGASUS_SIGUSR1); | getSigHandle()->activate(PEGASUS_SIGUSR1); |
getSigHandle()->registerHandler(SIGTERM, sigTermHandler); |
|
getSigHandle()->activate(SIGTERM); |
|
| |
pid_t pid; | pid_t pid; |
if( (pid = fork() ) < 0) | if( (pid = fork() ) < 0) |
|
|
getSigHandle()->deactivate(PEGASUS_SIGUSR1); | getSigHandle()->deactivate(PEGASUS_SIGUSR1); |
getSigHandle()->deactivate(SIGTERM); | getSigHandle()->deactivate(SIGTERM); |
| |
return(0); |
return 0; |
|
|
#endif /* !defined(PEGASUS_ENABLE_PRIVILEGE_SEPARATION) */ |
|
} | } |
| |
| |