Mullvad VPN daemon won't start on boot

I successfully installed the Mullvad VPN rpm and I can confirm it connects properly, but I have to manually start and enable it with systemctl enable mullvad-daemon.service and start the service every time I boot, so it appears that enabling it doesn’t save it in systemd. When I check the status of the daemon after boot, it isn’t found, and I have to start it.

Any systemd experts out there who can help me get this service properly configured on boot?

Here is the output once it is enabled and started:

 sudo systemctl status mullvad-daemon.service 
● mullvad-daemon.service - Mullvad VPN daemon
     Loaded: loaded (/etc/systemd/system/mullvad-daemon.service; enabled; vendor preset: disabled)
     Active: active (running) since Fri 2021-08-06 07:50:32 EDT; 7s ago
   Main PID: 6847 (mullvad-daemon)
      Tasks: 15 (limit: 2335)
        CPU: 71ms
     CGroup: /system.slice/mullvad-daemon.service
             └─6847 /opt/Mullvad VPN/resources/mullvad-daemon -v --disable-stdout-timestamps

Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_account_history
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_tunnel_state
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_settings
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_current_location
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_relay_locations
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_account_data
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_account_history
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_wireguard_key
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_current_version
Aug 06 07:50:35 localhost.localdomain mullvad-daemon[6847]: [mullvad_daemon::management_interface][DEBUG] get_version_info

You do not need to enable service to start it.

Here is the output once it is enabled and started

Output when it is enabled but not started after boot had probably been more interesting.

Show output of “systemctl cat mullvad-daemon.service”

# /etc/systemd/system/mullvad-daemon.service
# Systemd service unit file for the Mullvad VPN daemon

[Unit]
Description=Mullvad VPN daemon
Wants=network.target
After=network-online.target
After=NetworkManager.service
After=systemd-resolved.service
StartLimitBurst=5
StartLimitIntervalSec=20

[Service]
Restart=always
RestartSec=1
ExecStart=/opt/Mullvad\x20VPN/resources/mullvad-daemon -v --disable-stdout-timestamps

[Install]
WantedBy=multi-user.target

Thank you

Educated guess - it needs network and is started on boot before network is up. Are you using wicked or NetworkManager? If NetworkManager - do you use system or user connections?

I am using NetworkManager on KDE Plasma desktop. I am not sure about system vs user connections. How would I find that out? I just did a fresh install of Tumbleweed and have left all network settings as default if that helps answer the question.

After reboot, the service is not found when I check the status:

sudo systemctl status mullvad-daemon.service
Unit mullvad-daemon.service could not be found.

So I try to start it:
sudo systemctl start mullvad-daemon.service
Failed to start mullvad-daemon.service: Unit mullvad-daemon.service not found.

Service not found as noted above.

So I had to enable it first:
sudo systemctl enable mullvad-daemon.service

Then start it to finally get it working:
sudo systemctl start mullvad-daemon.service

I hope that helps diagnose the problem.

I was able to solve the issue by stopping the mullvad-daemon.service and disabling it:

sudo systemctl stop mullvad-daemon.service

[FONT=monospace]sudo systemctl disable mullvad-daemon.service

[/FONT]and then

sudo cp /opt/Mullvad\ VPN/resources/mullvad-daemon.service /etc/systemd/system/mullvad-daemon.service

Then enable and start the service again.

sudo systemctl enable mullvad-daemon.service
[FONT=monospace]sudo systemctl start mullvad-daemon.service
[/FONT]

For anyone else who has this problem just enter the above command to copy the mullvad-daemon.service file in /opt/ to the systemd /etc/ folder and it should work fine.

Thanks for your help @arvidjaar

Show output of “ls -lR /etc/systemd/system” immediately after boot and after you performed “systemctl enable mullvad-daemon.service”.

**bluetooth.target.wants**                      dbus-org.freedesktop.nm-dispatcher.service  **mdmonitor.service.wants**      **printer.target.wants** 
dbus-org.bluez.service                      default.target                              mullvad-daemon.service       **sockets.target.wants** 
dbus-org.fedoraproject.FirewallD1.service   **default.target.wants**                        **multi-user.target.wants**      **sysinit.target.wants** 
dbus-org.freedesktop.Avahi.service          **getty.target.wants**                          **network-online.target.wants**  **timers.target.wants** 
dbus-org.freedesktop.ModemManager1.service  **graphical.target.wants**                      network.service              xdm.service