Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve systemd units #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@ datarootdir =

.PHONY: clean distclean

all: fcgiwrap
all: fcgiwrap systemd/[email protected] systemd/[email protected]
install: all
install -d -m 755 $(targetdir)
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@
install -m 644 systemd/fcgiwrap@.socket $(DESTDIR)@systemdsystemunitdir@
install -m 644 systemd/fcgiwrap@.service $(DESTDIR)@systemdsystemunitdir@
endif

LDLIBS = -lfcgi @systemd_LIBS@
CFLAGS = @AM_CFLAGS@

fcgiwrap: fcgiwrap.c

systemd/[email protected]: systemd/[email protected]
$(SED) -e 's,[@]sbindir[@],@sbindir@,g' < $< > $@

systemd/[email protected]: systemd/[email protected]
$(SED) -e 's,[@]sbindir[@],@sbindir@,g' < $< > $@

#>+ 21
clean:
-rm -f fcgiwrap
-rm -f systemd/[email protected] systemd/[email protected]

#>+ 21
distclean: clean
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ AC_SUBST([AM_CFLAGS])
# Checks for programs.
AC_PROG_CC
PKG_PROG_PKG_CONFIG
AC_PROG_SED

# Create the config.h.
AC_CONFIG_HEADERS([config.h])
Expand Down
11 changes: 0 additions & 11 deletions systemd/fcgiwrap.service

This file was deleted.

8 changes: 0 additions & 8 deletions systemd/fcgiwrap.socket

This file was deleted.

7 changes: 7 additions & 0 deletions systemd/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Simple CGI Server for user %I
After=nss-user-lookup.target

[Service]
ExecStart=@sbindir@/fcgiwrap -s /run/fcgiwrap-%I.sock
User=%I
8 changes: 8 additions & 0 deletions systemd/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=fcgiwrap socket for user %I

[Socket]
ListenStream=/run/fcgiwrap-%I.sock

[Install]
WantedBy=sockets.target