Skip to content

Commit 992a313

Browse files
authored
Merge pull request #1362 from ikedas/systemd_socket by xavierba & ikedas
Add unit/socket files to make use of multiwatch
2 parents 4270e6c + cb4ea42 commit 992a313

23 files changed

+139
-48
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ Makefile
4040
/po/sympa/stamp-po
4141
/po/web_help/remove-potcdate.sed
4242
/po/web_help/stamp-po
43-
/src/etc/script/sympa
43+
/service/sympa
44+
/service/*.service
45+
/service/*.socket
46+
/service/sympa-tmpfiles.conf
4447
/src/lib/stamp-man3
4548
/src/lib/stamp-man1
4649
/src/lib/Sympa/Constants.pm

Makefile.am

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
# $Id$
2-
31
# Sympa - SYsteme de Multi-Postage Automatique
42
#
53
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
64
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
75
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
86
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
9-
# Copyright 2017, 2018, 2019 The Sympa Community. See the AUTHORS.md file at
10-
# the top-level directory of this distribution and at
7+
# Copyright 2017, 2018, 2019, 2022 The Sympa Community. See the
8+
# AUTHORS.md file at the top-level directory of this distribution and at
119
# <https://github.com/sympa-community/sympa.git>.
1210
#
1311
# This program is free software; you can redistribute it and/or modify
@@ -23,7 +21,7 @@
2321
# You should have received a copy of the GNU General Public License
2422
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2523

26-
SUBDIRS = src default doc po www
24+
SUBDIRS = src default doc po service www
2725

2826
check_SCRIPTS = \
2927
t/01_Conf.t \

configure.ac

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# configure.ac - Top-level configure.in for Sympa
2-
# $Id$
32
#
43
# Sympa - SYsteme de Multi-Postage Automatique
54
#
65
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
76
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
87
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
98
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
10-
# Copyright 2017, 2018, 2019, 2020, 2021 The Sympa Community. See the
9+
# Copyright 2017, 2018, 2019, 2020, 2021, 2022 The Sympa Community. See the
1110
# AUTHORS.md file at the top-level directory of this distribution and at
1211
# <https://github.com/sympa-community/sympa.git>.
1312
#
@@ -663,11 +662,10 @@ AC_CONFIG_FILES([
663662
po/Makefile
664663
po/sympa/Makefile.in
665664
po/web_help/Makefile.in
665+
service/Makefile
666666
src/Makefile
667667
src/bin/Makefile
668668
src/cgi/Makefile
669-
src/etc/Makefile
670-
src/etc/script/Makefile
671669
src/lib/Makefile
672670
src/libexec/Makefile
673671
src/sbin/Makefile

src/etc/script/Makefile.am service/Makefile.am

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
# $Id$
2-
31
# Sympa - SYsteme de Multi-Postage Automatique
42
#
5-
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
6-
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
7-
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
8-
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
9-
# Copyright 2018 The Sympa Community. See the AUTHORS.md file at the
10-
# top-level directory of this distribution and at
3+
# Copyright 2022 The Sympa Community. See the
4+
# AUTHORS.md file at the top-level directory of this distribution and at
115
# <https://github.com/sympa-community/sympa.git>.
126
#
137
# This program is free software; you can redistribute it and/or modify
@@ -35,20 +29,29 @@ units_DATA = \
3529
sympa-task.service \
3630
sympa.service
3731
noinst_DATA = \
38-
sympasoap.service \
39-
wwsympa.service \
32+
sympasoap-spawn-fcgi.service \
33+
wwsympa-spawn-fcgi.service \
34+
sympasoap-multiwatch.service \
35+
sympasoap-multiwatch.socket \
36+
wwsympa-multiwatch.service \
37+
wwsympa-multiwatch.socket \
4038
sympa-tmpfiles.conf
4139
endif
4240

4341
EXTRA_DIST = \
42+
README.md \
4443
sympa.in \
4544
sympa-archive.servicein \
4645
sympa-bounce.servicein \
4746
sympa-outgoing.servicein \
4847
sympa-task.servicein \
4948
sympa.servicein \
50-
sympasoap.servicein \
51-
wwsympa.servicein \
49+
sympasoap-spawn-fcgi.servicein \
50+
sympasoap-multiwatch.servicein \
51+
sympasoap-multiwatch.socketin \
52+
wwsympa-spawn-fcgi.servicein \
53+
wwsympa-multiwatch.servicein \
54+
wwsympa-multiwatch.socketin \
5255
sympa-tmpfiles.confin
5356

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

80+
.socketin.socket: Makefile
81+
@rm -f $@
82+
$(AM_V_GEN)$(SED) \
83+
-e 's|--piddir--|$(piddir)|' \
84+
< $(srcdir)/$@in > $@
85+
7786
.confin.conf: Makefile
7887
@rm -f $@
7988
$(AM_V_GEN)$(SED) \

service/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Files to support service management
2+
===================================
3+
4+
SysVinit
5+
--------
6+
7+
* sympa
8+
9+
Generic init script for the system derived from System V.
10+
11+
Systemd
12+
-------
13+
14+
* sympa-archive.service
15+
* sympa-bounce.service
16+
* sympa-outgoing.service
17+
* sympa-task.service
18+
* sympa.service
19+
20+
Units for Sympa services. Copy these files into Systemd system directory.
21+
22+
* sympa-tmpfiles.conf
23+
24+
Definition of ephemeral directory.
25+
26+
* wwsympa-multiwatch.service
27+
* wwsympa-multiwatch.socket
28+
* sympasoap-multiwatch.service
29+
* sympasoap-multiwatch.socket
30+
31+
Units for WWSympa and SympaSOAP, using multiwatch. Copy these files as
32+
`wwsympa.service`, `wwsympa.socket` and so on into Systemd system
33+
directory.
34+
35+
* wwsympa-spawn-fcgi.service
36+
* sympasoap-spawn-fcgi.service
37+
38+
Units for WWSympa and SympaSOAP, using spawn-fcgi. Copy these files as
39+
`wwsympa.service`, `wwsympa.socket` and so on into Systemd system
40+
directory.
41+
42+
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[Unit]
2+
Description=Sympa SOAP interface FastCGI backend
3+
After=sympa.service
4+
Requires=sympasoap.socket
5+
6+
[Service]
7+
User=--USER--
8+
Group=--GROUP--
9+
ExecStart=/usr/bin/multiwatch \
10+
-f $SOAP_FCGI_CHILDREN -- \
11+
--execcgidir--/sympa_soap_server.fcgi
12+
StandardOutput=null
13+
StandardInput=socket
14+
StandardError=journal
15+
Environment="SOAP_FCGI_CHILDREN=2"
16+
EnvironmentFile=-/etc/default/sympa
17+
EnvironmentFile=-/etc/sysconfig/sympa
18+
Restart=always
19+
RestartSec=5
20+
21+
[Install]
22+
Also=sympasoap.socket
23+
WantedBy=multi-user.target

service/sympasoap-multiwatch.socketin

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=Sympa SOAP interface socket
3+
4+
[Socket]
5+
SocketUser=nobody
6+
SocketMode=0600
7+
ListenStream=--piddir--/sympasoap.socket
8+
9+
[Install]
10+
WantedBy=sockets.target
File renamed without changes.

service/wwsympa-multiwatch.servicein

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[Unit]
2+
Description=Sympa web interface FastCGI backend
3+
After=sympa.service
4+
Requires=wwsympa.socket
5+
6+
[Service]
7+
User=--USER--
8+
Group=--GROUP--
9+
ExecStart=/usr/bin/multiwatch \
10+
-f $WWS_FCGI_CHILDREN -- \
11+
--execcgidir--/wwsympa.fcgi
12+
StandardOutput=null
13+
StandardInput=socket
14+
StandardError=journal
15+
Environment="WWS_FCGI_CHILDREN=5"
16+
EnvironmentFile=-/etc/default/sympa
17+
EnvironmentFile=-/etc/sysconfig/sympa
18+
Restart=always
19+
RestartSec=5
20+
21+
[Install]
22+
Also=wwsympa.socket
23+
WantedBy=multi-user.target

service/wwsympa-multiwatch.socketin

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=Sympa web interface socket
3+
4+
[Socket]
5+
SocketUser=nobody
6+
SocketMode=0600
7+
ListenStream=--piddir--/wwsympa.socket
8+
9+
[Install]
10+
WantedBy=sockets.target
File renamed without changes.

src/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
# You should have received a copy of the GNU General Public License
2121
# along with this program. If not, see <http://www.gnu.org/licenses/>.
2222

23-
SUBDIRS = bin cgi etc lib libexec sbin
23+
SUBDIRS = bin cgi lib libexec sbin
2424

src/etc/Makefile.am

-23
This file was deleted.

src/etc/script/.gitignore

-2
This file was deleted.

0 commit comments

Comments
 (0)