diff --git a/docs/2-usage/17-start-on-boot.md b/docs/2-usage/17-start-on-boot.md index f8730ec2..f64cf32e 100644 --- a/docs/2-usage/17-start-on-boot.md +++ b/docs/2-usage/17-start-on-boot.md @@ -16,7 +16,8 @@ Create a _systemd_ service: ```sh sudo tee /etc/systemd/system/mediamtx.service >/dev/null << EOF [Unit] -Wants=network.target +After=network-online.target +Wants=network-online.target [Service] ExecStart=/usr/local/bin/mediamtx /usr/local/etc/mediamtx.yml [Install] @@ -24,6 +25,12 @@ WantedBy=multi-user.target EOF ``` +Enable a _wait-online_ service to make sure that _MediaMTX_ is started after network has been properly initialized: + +```sh +sudo systemctl enable systemd-networkd-wait-online.service +``` + If SELinux is enabled (for instance in case of RedHat, Rocky, CentOS++), add correct security context: ```sh