public function safe_kill($pid, $signal, $log_message = '', $log_level = self::LOG_LEVEL_INFO)
	{
		if (!array_key_exists($pid, $this->forked_children))
		{
			return false;
		}

		$stat_pid_file = '/proc/' . $pid . '/stat';
		if (!file_exists($stat_pid_file))
		{
			$this->log('Unable to find info for PID ' . $pid . ' from ' . $stat_pid_file, self::LOG_LEVEL_DEBUG);
			return false;
		}

		$stat_pid_info = file_get_contents($stat_pid_file);
		if ($stat_pid_info === false)
		{
			$this->log('Unable to get info for PID ' . $pid, self::LOG_LEVEL_DEBUG);
			return false;
		}

		$stat_pid_info = explode(' ', $stat_pid_info);
		if (!array_key_exists(3, $stat_pid_info))
		{
			$this->log('Unable to find parent PID for PID ' . $pid, self::LOG_LEVEL_DEBUG);
			return false;
		}

		// the parent pid is the fourth entry in /proc/PID/stat
		if ($stat_pid_info[3] == getmypid())
		{
			if ($log_message)
			{
				$this->log($log_message, $log_level);
			}

			posix_kill($pid, $signal);
			return true;
		}

		$this->log('Failed to kill PID ' . $pid . ' with signal ' . $signal, self::LOG_LEVEL_WARN);
		return false;
	}