Basically I want to login in my system and let the system to open for me my Web browser (Thorium). Since I' using Ubuntu 22.04 and I want to start the browser as user (and not as root), I followed this instruction carefully (using the --user option and putting my .service script in the systemd/user folder).
So I have now this configuration:
ubuntu@B1:/etc/systemd/user$ cat thorium.service [Unit] Description=Thorium Web Browser [Service] #User=myuser #Group=mypass ExecStart=/opt/scripts/thorium_start.sh [Install] WantedBy=default.target where the AppImage of Thorium is started from this script:
ubuntu@B1:/etc/systemd/user$ cat /opt/scripts/thorium_start.sh #!/bin/bash filename="/opt/thorium/Thorium.AppImage" logfile="/tmp/log.txt" echo "Starting Thorium" > ${logfile} echo date >> ${logfile} sleep 30 # <= Added because I though that probably a delay makes sense if [[ -f "$filename" ]]; then $filename; else echo "$filename not found"; fi and by the way:
ubuntu@B1:/etc/systemd/user$ systemctl --user is-enabled thorium.service enabled and
ubuntu@B1:/etc/systemd/user$ ls -l insgesamt 24 drwxr-xr-x 2 root root 4096 Aug 9 2022 ayatana-indicators.target.wants drwxr-xr-x 2 root root 4096 Aug 9 2022 default.target.wants drwxr-xr-x 2 root root 4096 Aug 9 2022 graphical-session-pre.target.wants drwxr-xr-x 2 root root 4096 Aug 9 2022 pipewire.service.wants lrwxrwxrwx 1 root root 52 Nov 28 2022 pipewire-session-manager.service -> /usr/lib/systemd/user/pipewire-media-session.service drwxr-xr-x 2 root root 4096 Jul 21 2023 sockets.target.wants -rwxr-xr-x 1 root root 152 Jul 11 23:15 thorium.service thus the .service file has been correctly configured to start at boot and has execution rights.
But the problem is that after login no broswer starts.
Doing from terminal a simple:
$./thorium_start.sh starts the browser as expected, so I do not think that the problem is the script.
Any help?
My system is:
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04.4 LTS" PRETTY_NAME="Ubuntu 22.04.4 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.4 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy