diff --git a/docs/Autostart tips.md b/docs/Autostart tips.md index b885c8df9..c252ab94f 100644 --- a/docs/Autostart tips.md +++ b/docs/Autostart tips.md @@ -45,9 +45,6 @@ sudo cp docs/IoTuring.service /usr/lib/systemd/user/ mkdir -p ~/.local/share/systemd/user/ cp docs/IoTuring.service ~/.local/share/systemd/user/ -# Enable the automatic login of the user, so it can start after boot -loginctl enable-linger $(whoami) - systemctl --user daemon-reload systemctl --user edit IoTuring.service ``` @@ -71,6 +68,22 @@ systemctl --user enable IoTuring.service systemctl --user start IoTuring.service ``` +#### Start user service before login + +This is optional. Without this, IoTuring starts after login. + +```shell +# Enable the automatic login of the user, so IoTuring can start right after boot: +loginctl enable-linger $(whoami) + +# Copy the service which restarts IoTuring: +cp docs/IoTuring-restart.service ~/.local/share/systemd/user/ + +systemctl --user daemon-reload +systemctl --user enable IoTuring-restart.service +systemctl --user start IoTuring-restart.service +``` + ### As a system service with Systemd Some entities may not work if installed as a system service diff --git a/docs/IoTuring-restart.service b/docs/IoTuring-restart.service new file mode 100644 index 000000000..b6586e10a --- /dev/null +++ b/docs/IoTuring-restart.service @@ -0,0 +1,9 @@ +[Unit] +Description=Restart IoTuring after login + +[Service] +Type=oneshot +ExecStart=/usr/bin/systemctl --user restart IoTuring.service + +[Install] +WantedBy=graphical-session.target \ No newline at end of file