diff --git a/Autostart-on-Linux.md b/Autostart-on-Linux.md index 8762281..aaf1f99 100644 --- a/Autostart-on-Linux.md +++ b/Autostart-on-Linux.md @@ -1,3 +1,50 @@ +## Systemd ## +Modern Linux systems have been updated to use the new systemd standard. The method is very simple and involves creating a service file then enabling it. + +**Create the service file** + +_Be sure to modify the user, group, mono path and install directory._ + +Create the file lidarr.service with the content: +``` +[Unit] +Description=Lidarr Daemon +After=network.target + +[Service] +User={User account for Lidarr} +Group={Group account for Lidarr} +Type=simple +ExecStart=/usr/bin/mono /opt/Lidarr/Lidarr.exe -nobrowser +TimeoutStopSec=20 +KillMode=process +Restart=on-failure +[Install] +WantedBy=multi-user.target +``` + +**Move the file to your system directory** + +Typically located in `/etc/systemd/system/`, **verify before proceeding**. Will differ based on distribution. + +```bash +mv lidarr.service /etc/systemd/system/ +``` + +**Add Lidarr to startup** + +```bash +systemctl enable lidarr.service +``` + +**Start Lidarr service** + +Start Lidarr via systemd and verify status. + +```bash +systemctl start lidarr.service +systemctl status lidarr.service +``` ## Init.d Script (Debian/Ubuntu) ##