-
Notifications
You must be signed in to change notification settings - Fork 11
Deploying on Ubuntu and other Linux distros with systemd
Snawoot edited this page Sep 28, 2023
·
1 revision
Put compiled dtlspipe binary to /usr/local/bin/dtlspipe
Put file with following contents into /etc/systemd/system/dtlspipe-server.service
:
[Unit]
Description=dtlspipe server
Documentation=https://github.com/Snawoot/dtlspipe/
After=network.target network-online.target
Requires=network-online.target
[Service]
EnvironmentFile=/etc/default/dtlspipe-server
DynamicUser=yes
StateDirectory=dtlspipe
Environment=HOME=%S/dtlspipe
ExecStart=/usr/local/bin/dtlspipe $OPTIONS
TimeoutStopSec=5s
PrivateTmp=true
ProtectSystem=full
[Install]
WantedBy=default.target
Put file with following contents into /etc/default/dtlspipe-server
:
OPTIONS=server 0.0.0.0:2815 127.0.0.1:56218
DTLSPIPE_PSK=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
where OPTIONS
are corresponding command line arguments and DTLSPIPE_PSK
is PSK. We pass it as an env variable to hide it from process command line in the process list like ps -ef
.
Set actual listen address instead of 0.0.0.0:2815
.
Set actual destination UDP endpoint instead of 127.0.0.1:56218
.
Execute following commands as root:
systemctl daemon-reload
systemctl enable --now dtlspipe-server