Skip to content
Snippets Groups Projects
Commit 00b1b841 authored by Florian Sesser's avatar Florian Sesser
Browse files

WIP: Convert Tahoe to receive its sockets from systemd

refs #122
parent 9c99fe11
No related branches found
No related tags found
2 merge requests!360update production,!359Make Systemd open a socket for the Tahoe web server
...@@ -115,6 +115,16 @@ in ...@@ -115,6 +115,16 @@ in
# Open up the firewall. # Open up the firewall.
# networking.firewall.allowedTCPPorts = flip mapAttrsToList cfg.introducers # networking.firewall.allowedTCPPorts = flip mapAttrsToList cfg.introducers
# (node: settings: settings.tub.port); # (node: settings: settings.tub.port);
# Make systemd open a port for us:
systemd.sockets.tahoe-web = {
description = "Tahoe Web Server Socket";
wantedBy = [ "sockets.target" ];
before = [ "multi-user.target" ];
socketConfig.Accept = true;
socketConfig.ListenStream = settings.tub.port;
};
systemd.services = flip mapAttrs' cfg.introducers (node: settings: systemd.services = flip mapAttrs' cfg.introducers (node: settings:
let let
pidfile = "/run/tahoe.introducer-${node}.pid"; pidfile = "/run/tahoe.introducer-${node}.pid";
...@@ -130,6 +140,8 @@ in ...@@ -130,6 +140,8 @@ in
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
PIDFile = pidfile; PIDFile = pidfile;
Twisted wants non-blocking sockets:
NonBlocking = true;
# Believe it or not, Tahoe is very brittle about the order of # Believe it or not, Tahoe is very brittle about the order of
# arguments to $(tahoe run). The node directory must come first, # arguments to $(tahoe run). The node directory must come first,
# and arguments which alter Twisted's behavior come afterwards. # and arguments which alter Twisted's behavior come afterwards.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment