27class UnixFork final :
public AbstractFork
31 explicit UnixFork(
int process,
int threads,
bool setupSignals, QObject *parent =
nullptr);
36 virtual int exec(
bool lazy,
bool master)
override;
38 virtual void restart()
override;
42 bool createProcess(
bool respawn);
43 void decreaseWorkerRespawn();
51 static void stopWSGI(
const QString &pidfile);
53 static bool setUmask(
const QByteArray &valueStr);
54 static bool setGidUid(
const QString &gid,
const QString &uid,
bool noInitgroups);
55 static void chownSocket(
const QString &filename,
const QString &uidGid);
57 static int idealProcessCount();
58 static int idealThreadCount();
68 int setupUnixSignalHandlers();
69 void setupSocketPair(
bool closeSignalsFD,
bool createPair);
70 bool createChild(
const Worker &worker,
bool respawn);
71 static void signalHandler(
int signal);
72 void setupCheckChildTimer();
73 void postFork(
int workerId);
75 QHash<qint64, Worker> m_childs;
76 QVector<Worker> m_recreateWorker;
77 QSocketNotifier *m_signalNotifier =
nullptr;
78 QTimer *m_checkChildRestart =
nullptr;
82 bool m_terminating =
false;