Start iperdf3 deamon at startup

I want headless server (running Ubuntu Server 19.10) to be listening for iperf3 request constantly, even after reboot. Currently, I can run it on the terminal using the -c and -d flags which runs it as a daemon (which I think just means in the background).

sudo iperf3 -s -D

But I want it start in this mode all the time on boot, so it is always listening in the background.

When I've done this kind of before, it's involved systemd, which I am not familiar with too much. Don't think there was mention of systemd when I read up on iperf3 program, so is it even compatible with it (or is that statement itself nonsensical?)

Only ever used systemd in very limited ways before when been instructed to in tutorials so not up to speed on its scope.

1
задан 18 June 2020 в 09:57

1 ответ

Так как Ubuntu, похоже, не предоставляет системный сервис для iperf3d, нам придется напишите сами.

См. https: //gist.github.com / auipga / 64be019018ef311deba2211ced316f5e , и я процитирую его здесь.

[Unit]
Description=iperf3 server
After=syslog.target network.target auditd.service

[Service]
ExecStart=/usr/bin/iperf3 -s

[Install]
WantedBy=multi-user.target

поместите этот файл в /etc/systemd/system/iperf3.service , а затем sudo systemctl enable iperf3 .

2
ответ дан 19 June 2020 в 21:23

Другие вопросы по тегам:

Похожие вопросы: