Skip to content

Instantly share code, notes, and snippets.

View Rathgore's full-sized avatar

Mark McWilliams Rathgore

View GitHub Profile
@Rathgore
Rathgore / README-python-service-on-systemd-activated-socket.md
Created August 6, 2017 05:24 — forked from drmalex07/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at /opt/foo/serve.py.