summaryrefslogtreecommitdiffhomepage
path: root/plugins/fcgi/fastcgiprocess.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-13 16:20:42 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-13 16:20:42 +0100
commitd14582a1d92e036780166a0b5ec0494d7353cc75 (patch)
treeb14c7d52f8bdbe511a2efb25aae45a565db202d0 /plugins/fcgi/fastcgiprocess.h
parentbde446bcc08483707dc20a0bbf85ad70bc9d1496 (diff)
Implemented and tested managed FCGI application start, separated out process check functions to libreichwein
Diffstat (limited to 'plugins/fcgi/fastcgiprocess.h')
-rw-r--r--plugins/fcgi/fastcgiprocess.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/fcgi/fastcgiprocess.h b/plugins/fcgi/fastcgiprocess.h
new file mode 100644
index 0000000..07b6539
--- /dev/null
+++ b/plugins/fcgi/fastcgiprocess.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <filesystem>
+#include <string>
+
+#include <ext/stdio_filebuf.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+
+class FastCGIProcess
+{
+public:
+ FastCGIProcess(const std::filesystem::path& exe_path, const std::string& host, unsigned short port);
+ FastCGIProcess(const std::filesystem::path& exe_path, const std::filesystem::path& socket_path);
+ ~FastCGIProcess();
+ bool is_running();
+
+private:
+ void start();
+ void stop();
+
+ pid_t m_pid{};
+ std::string m_command;
+ std::string m_host;
+ unsigned short m_port{};
+ std::filesystem::path m_socket_path;
+};