inetd service replaced by systemd magic

Here is a service I used to have configured within inetd:
9999           stream  tcp     nowait  approx  /usr/sbin/approx /usr/sbin/approx
Now, let’s replace this with systemd form.

We need to define a listening socket and an associated service.

We create the socket description file: /etc/systemd/system/approx.socket

Description=caching proxy server for Debian archive files



Then, the associated service: /etc/systemd/system/approx.service

Description=caching proxy server for Debian archive files


Finaly, we enable the socket and service

sudo systemctl enable approx.socket
sudo systemctl start approx.socket

We can verify the whole thing works:

systemctl status approx.socket
● approx.socket - caching proxy server for Debian archive files
Loaded: loaded (/etc/systemd/system/approx.socket; enabled; vendor preset: enabled)
Active: active (listening) since mar 2015-08-18 09:04:13 CEST; 3 days ago
Listen: [::]:9999 (Stream)
Accepted: 83; Connected: 0

That’s it folks !


Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.