Skip to content

Commit

Permalink
By user systemd service/socket
Browse files Browse the repository at this point in the history
Instead of having a socket for a static and predefined user http, this
patch allow to easily setup multiple sockets with your needed users.

This is particulary useful when you want have socket for dedicated user.

You can create an http socket (in /run/fcgiwrap-http.sock) with:
$ systemctl enable [email protected]

and if you need a socket for munin (in /run/fcgiwrap-munin.sock):
$ systemctl enable [email protected]
  • Loading branch information
seblu committed Apr 19, 2015
1 parent 4b2151e commit f74595c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ install: all
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@
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=/usr/sbin/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

0 comments on commit f74595c

Please sign in to comment.