A
A
Anton Tatarinov2018-11-23 14:38:54
linux
Anton Tatarinov, 2018-11-23 14:38:54

How to start iPerf3 after system startup automatically?

Good day!
Tell me how to start iPerf3 automatically after the system starts?
Did according to this instruction
The problem started after the step: Server autostart (service creation in systemd)
# sudo systemctl start iperfd
​​# sudo systemctl status iperfd

● iperfd.service - iPerf Service
   Loaded: loaded (/etc/systemd/system/iperfd.service; enabled; vendor preset: enabled)
   Active: failed (Result: start-limit-hit) since Fri 2018-11-23 14:11:30 MSK; 17min ago
  Process: 32526 ExecStart=/usr/bin/iperf3 -s -D -I /var/run/iperf3.pid (code=exited, status=0/SUCCESS)
 Main PID: 32527 (code=exited, status=1/FAILURE)

ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Service hold-off time over, scheduling restart.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Scheduled restart job, restart counter is at 5.
ноя 23 14:11:30 zabbix systemd[1]: Stopped iPerf Service.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Start request repeated too quickly.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Failed with result 'start-limit-hit'.
ноя 23 14:11:30 zabbix systemd[1]: Failed to start iPerf Service.

# sudo journalctl -xe
-- Начат процесс запуска юнита iperfd.service.
ноя 23 14:11:30 zabbix systemd[1]: Started iPerf Service.
-- Subject: Запуск юнита iperfd.service завершен
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Процесс запуска юнита iperfd.service был завершен.
--
-- Результат: RESULT.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Service hold-off time over, scheduling restart.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Scheduled restart job, restart counter is at 5.
-- Subject: Назначен автоматический перезапуск юнита
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Назначен автоматический перезапуск юнита iperfd.service, так как для него был задан
-- параметр Restart=.
ноя 23 14:11:30 zabbix systemd[1]: Stopped iPerf Service.
-- Subject: Завершена остановка юнита iperfd.service.
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Процесс остановки юнита iperfd.service был завершен.
--
-- Результат: RESULT.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Service hold-off time over, scheduling restart.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Scheduled restart job, restart counter is at 5.
-- Subject: Назначен автоматический перезапуск юнита
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Назначен автоматический перезапуск юнита iperfd.service, так как для него был задан
-- параметр Restart=.
ноя 23 14:11:30 zabbix systemd[1]: Stopped iPerf Service.
-- Subject: Завершена остановка юнита iperfd.service.
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Процесс остановки юнита iperfd.service был завершен.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Start request repeated too quickly.
ноя 23 14:11:30 zabbix systemd[1]: iperfd.service: Failed with result 'start-limit-hit'.
ноя 23 14:11:30 zabbix systemd[1]: Failed to start iPerf Service.
-- Subject: Ошибка юнита iperfd.service
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Произошел сбой юнита iperfd.service.

/etc/systemd/system/iperfd.service
[Unit]
Description=iPerf Service
After=network.target

[Service]
Type=forking
PIDFile=/var/run/iperf3.pid
ExecStart=-/usr/bin/iperf3 -s -D -I /var/run/iperf3.pid
ExecReload=/usr/bin/kill -HUP $MAINPID
Restart=always

[Install]
WantedBy=multi-user.target

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Svistunov, 2018-11-29
@C_Smoke

There is an error in the instructions.

ExecStart= - /usr/bin/iperf3

The hyphen before specifying the path to the executable file is not needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question