1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-09-09 22:06:02 +00:00

Implement support for systemd(8) "socket activation"

This patch enables ngIRCd to work with listening sockets already
initialized and passed-in by systemd(8) and hereby to support on-demand
"socket activation".

systemd(8) uses two environment variables to pass information about the
sockets to ngIRCd, LISTEN_PID and LISTEN_FDS, and this mechanism only
kicks in when both variables are set. In all other cases, and therefore
in most installations out there, nothing changes at all.

Please note:
If socket activation is in effect, ngIRCd will not initialize any (other)
soeckets on its own! All sockets must be configured in the systemd(8)
socket unit configuration file in this case, see ./contrib/ngircd.socket
for example.

Probably it would be interesting to match passed-in sockets to configured
listening sockets and to initialize all the remaining ones not already
set up by systemd(8), but this is kept back for an other patch ...

See
 - <http://0pointer.de/blog/projects/socket-activation.html>
 - <http://0pointer.de/blog/projects/socket-activation2.html>
 - <http://www.freedesktop.org/software/systemd/man/systemd.socket.html>
This commit is contained in:
Alexander Barton
2013-02-04 21:46:20 +01:00
parent 84e24afd2f
commit 8ab097afb7
4 changed files with 85 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
#
# ngIRCd -- The Next Generation IRC Daemon
# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors
# Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,6 +17,7 @@ EXTRA_DIST = README \
ngIRCd-Logo.gif \
ngircd-redhat.init \
ngircd.service \
ngircd.socket \
ngircd.spec \
platformtest.sh \
systrace.policy

View File

@@ -30,6 +30,9 @@ ngircd-redhat.init
ngircd.service
- systemd(8) service unit configuration file.
ngircd.socket
- systemd(8) socket unit configuration file for "socket activation".
ngircd.spec
- RPM "spec" file.

10
contrib/ngircd.socket Normal file
View File

@@ -0,0 +1,10 @@
[Unit]
Description=Next Generation IRC Daemon (Socket)
[Socket]
ListenStream=6667
#ListenStream=6668
IPTOS=low-delay
[Install]
WantedBy=sockets.target