Establish Logging */ $pid_logger = pcntl_fork(); if (!$pid_logger) { /* We run the logger as a seporate fork so that it can constantly run a blocking listen for log messages from the other processes and components of this application. All other processes including the master send their logs via IPC to the logger fork. */ $pid_child = getmypid(); $log = new logger(); $log->set_queue_listener(&$msg_queue, MESSAGE_LOG, MESSAGE_MAX_SIZE); $log->set_logfile($config["SMStoXMPP"]["app_log"]); if (isset($options_set["verbose"])) { $log->set_stdout(); } if (isset($options_set["debug"])) { $log->set_debug(); } $log->debug("Launched logger fork"); $log->debug("[child {$pid_child}] is logging worker "); /* Run as a non-privileged user. Considering we are running as a long running process, we should definetely run as a non-privileged user to protect in case of a worst-case exploit. Note that this doesn't apply unless the process is launched by the root user, such as when started by init