Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am stop5 on github.
  • I am stop5 (https://keybase.io/stop5) on keybase.
  • I have a public key ASAj_fjq5L14c_HKNSbLrnvFvygHbaOR5GGkVkgLIwGfpAo

To claim this, I am signing this object:

@stop5
stop5 / README-python-service-on-systemd-activated-socket.md
Created January 20, 2018 09:39 — 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.