aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2012-08-21 05:47:22 -0700
committerFurkan Sahin <furkan-dev@proton.me>2012-08-21 05:47:22 -0700
commit5e1ef6b183c81895c0ae1f441dfdd18b470438ef (patch)
tree13957856c3125301f3967d8a2cf81c2711c33c20
parent2bf8dc712b62a026cb07600d1c551946fc653d7c (diff)
parenta0d0d1d6e7c5adf109895d727b3ec190e652c8de (diff)
Merge pull request #7 from falconindy/systemd
add systemd unit files for installation
-rw-r--r--Makefile.in5
-rw-r--r--configure.ac8
-rw-r--r--systemd/fcgiwrap.service11
-rw-r--r--systemd/fcgiwrap.socket8
4 files changed, 32 insertions, 0 deletions
diff --git a/Makefile.in b/Makefile.in
index 8d538b4..647d98b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,6 +9,11 @@ install: all
install -m 755 fcgiwrap $(targetdir)
install -d -m 755 $(man8dir)
install -m 644 fcgiwrap.8 $(man8dir)
+ifneq ("@systemdsystemunitdir@", "")
+ install -d -m 755 $(DESTDIR)@systemdsystemunitdir@
+ install -m 644 systemd/fcgiwrap.socket $(DESTDIR)@systemdsystemunitdir@
+ install -m 644 systemd/fcgiwrap.service $(DESTDIR)@systemdsystemunitdir@
+endif
fcgiwrap: fcgiwrap.c
@CC@ @AM_CFLAGS@ fcgiwrap.c -o fcgiwrap -lfcgi @systemd_LIBS@ @LDFLAGS@
diff --git a/configure.ac b/configure.ac
index 4388cd4..296ea75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,14 @@ if test "x$with_systemd" != "xno"; then
fi
AM_CONDITIONAL(HAVE_LIBSSL, [test "x$have_systemd" = "xyes"])
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != xno -a "x$have_systemd" != xno; then
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h],, [AC_MSG_ERROR([fcntl.h header missing])])
AC_CHECK_HEADERS([limits.h stdlib.h string.h unistd.h],, [AC_MSG_ERROR([at least one important system header file is missing])])
diff --git a/systemd/fcgiwrap.service b/systemd/fcgiwrap.service
new file mode 100644
index 0000000..7b010c9
--- /dev/null
+++ b/systemd/fcgiwrap.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Simple CGI Server
+After=nss-user-lookup.target
+
+[Service]
+ExecStart=/usr/sbin/fcgiwrap
+User=http
+Group=http
+
+[Install]
+Also=fcgiwrap.socket
diff --git a/systemd/fcgiwrap.socket b/systemd/fcgiwrap.socket
new file mode 100644
index 0000000..dc074f1
--- /dev/null
+++ b/systemd/fcgiwrap.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=fcgiwrap Socket
+
+[Socket]
+ListenStream=/run/fcgiwrap.sock
+
+[Install]
+WantedBy=sockets.target