Skip to content

Commit

Permalink
Merge pull request #1362 from ikedas/systemd_socket by xavierba & ikedas
Browse files Browse the repository at this point in the history
Add unit/socket files to make use of multiwatch
  • Loading branch information
ikedas authored Apr 17, 2022
2 parents 4270e6c + cb4ea42 commit 992a313
Show file tree
Hide file tree
Showing 23 changed files with 139 additions and 48 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ Makefile
/po/sympa/stamp-po
/po/web_help/remove-potcdate.sed
/po/web_help/stamp-po
/src/etc/script/sympa
/service/sympa
/service/*.service
/service/*.socket
/service/sympa-tmpfiles.conf
/src/lib/stamp-man3
/src/lib/stamp-man1
/src/lib/Sympa/Constants.pm
Expand Down
8 changes: 3 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# $Id$

# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file at
# the top-level directory of this distribution and at
# Copyright 2017, 2018, 2019, 2022 The Sympa Community. See the
# AUTHORS.md file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -23,7 +21,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

SUBDIRS = src default doc po www
SUBDIRS = src default doc po service www

check_SCRIPTS = \
t/01_Conf.t \
Expand Down
6 changes: 2 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# configure.ac - Top-level configure.in for Sympa
# $Id$
#
# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2017, 2018, 2019, 2020, 2021 The Sympa Community. See the
# Copyright 2017, 2018, 2019, 2020, 2021, 2022 The Sympa Community. See the
# AUTHORS.md file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
Expand Down Expand Up @@ -663,11 +662,10 @@ AC_CONFIG_FILES([
po/Makefile
po/sympa/Makefile.in
po/web_help/Makefile.in
service/Makefile
src/Makefile
src/bin/Makefile
src/cgi/Makefile
src/etc/Makefile
src/etc/script/Makefile
src/lib/Makefile
src/libexec/Makefile
src/sbin/Makefile
Expand Down
33 changes: 21 additions & 12 deletions src/etc/script/Makefile.am → service/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# $Id$

# Sympa - SYsteme de Multi-Postage Automatique
#
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
# Copyright 2018 The Sympa Community. See the AUTHORS.md file at the
# top-level directory of this distribution and at
# Copyright 2022 The Sympa Community. See the
# AUTHORS.md file at the top-level directory of this distribution and at
# <https://github.com/sympa-community/sympa.git>.
#
# This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -35,20 +29,29 @@ units_DATA = \
sympa-task.service \
sympa.service
noinst_DATA = \
sympasoap.service \
wwsympa.service \
sympasoap-spawn-fcgi.service \
wwsympa-spawn-fcgi.service \
sympasoap-multiwatch.service \
sympasoap-multiwatch.socket \
wwsympa-multiwatch.service \
wwsympa-multiwatch.socket \
sympa-tmpfiles.conf
endif

EXTRA_DIST = \
README.md \
sympa.in \
sympa-archive.servicein \
sympa-bounce.servicein \
sympa-outgoing.servicein \
sympa-task.servicein \
sympa.servicein \
sympasoap.servicein \
wwsympa.servicein \
sympasoap-spawn-fcgi.servicein \
sympasoap-multiwatch.servicein \
sympasoap-multiwatch.socketin \
wwsympa-spawn-fcgi.servicein \
wwsympa-multiwatch.servicein \
wwsympa-multiwatch.socketin \
sympa-tmpfiles.confin

CLEANFILES = $(init_SCRIPTS) $(units_DATA) $(noinst_DATA)
Expand All @@ -74,6 +77,12 @@ sympa: sympa.in Makefile
-e 's|--sbindir--|$(sbindir)|' \
< $(srcdir)/$@in > $@

.socketin.socket: Makefile
@rm -f $@
$(AM_V_GEN)$(SED) \
-e 's|--piddir--|$(piddir)|' \
< $(srcdir)/$@in > $@

.confin.conf: Makefile
@rm -f $@
$(AM_V_GEN)$(SED) \
Expand Down
42 changes: 42 additions & 0 deletions service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Files to support service management
===================================

SysVinit
--------

* sympa

Generic init script for the system derived from System V.

Systemd
-------

* sympa-archive.service
* sympa-bounce.service
* sympa-outgoing.service
* sympa-task.service
* sympa.service

Units for Sympa services. Copy these files into Systemd system directory.

* sympa-tmpfiles.conf

Definition of ephemeral directory.

* wwsympa-multiwatch.service
* wwsympa-multiwatch.socket
* sympasoap-multiwatch.service
* sympasoap-multiwatch.socket

Units for WWSympa and SympaSOAP, using multiwatch. Copy these files as
`wwsympa.service`, `wwsympa.socket` and so on into Systemd system
directory.

* wwsympa-spawn-fcgi.service
* sympasoap-spawn-fcgi.service

Units for WWSympa and SympaSOAP, using spawn-fcgi. Copy these files as
`wwsympa.service`, `wwsympa.socket` and so on into Systemd system
directory.


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions service/sympasoap-multiwatch.servicein
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Unit]
Description=Sympa SOAP interface FastCGI backend
After=sympa.service
Requires=sympasoap.socket

[Service]
User=--USER--
Group=--GROUP--
ExecStart=/usr/bin/multiwatch \
-f $SOAP_FCGI_CHILDREN -- \
--execcgidir--/sympa_soap_server.fcgi
StandardOutput=null
StandardInput=socket
StandardError=journal
Environment="SOAP_FCGI_CHILDREN=2"
EnvironmentFile=-/etc/default/sympa
EnvironmentFile=-/etc/sysconfig/sympa
Restart=always
RestartSec=5

[Install]
Also=sympasoap.socket
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions service/sympasoap-multiwatch.socketin
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Sympa SOAP interface socket

[Socket]
SocketUser=nobody
SocketMode=0600
ListenStream=--piddir--/sympasoap.socket

[Install]
WantedBy=sockets.target
File renamed without changes.
23 changes: 23 additions & 0 deletions service/wwsympa-multiwatch.servicein
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Unit]
Description=Sympa web interface FastCGI backend
After=sympa.service
Requires=wwsympa.socket

[Service]
User=--USER--
Group=--GROUP--
ExecStart=/usr/bin/multiwatch \
-f $WWS_FCGI_CHILDREN -- \
--execcgidir--/wwsympa.fcgi
StandardOutput=null
StandardInput=socket
StandardError=journal
Environment="WWS_FCGI_CHILDREN=5"
EnvironmentFile=-/etc/default/sympa
EnvironmentFile=-/etc/sysconfig/sympa
Restart=always
RestartSec=5

[Install]
Also=wwsympa.socket
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions service/wwsympa-multiwatch.socketin
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Sympa web interface socket

[Socket]
SocketUser=nobody
SocketMode=0600
ListenStream=--piddir--/wwsympa.socket

[Install]
WantedBy=sockets.target
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

SUBDIRS = bin cgi etc lib libexec sbin
SUBDIRS = bin cgi lib libexec sbin

23 changes: 0 additions & 23 deletions src/etc/Makefile.am

This file was deleted.

2 changes: 0 additions & 2 deletions src/etc/script/.gitignore

This file was deleted.

0 comments on commit 992a313

Please sign in to comment.