Systemctl service starts manually, but not on boot

What is the problem you are having with rclone?

I have created a systemctl service that will start manually using "systemctl start rclone", but it does not start automatically on boot.

What is your rclone version (output from rclone version)

rclone v1.51.0-330-g98c34e41-beta (same issue with stable release)

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 20.04 LTS

Which cloud storage system are you using? (eg Google Drive)

Google Drive (Cache)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

N/A

The systemctl service:

# /etc/systemd/system/rclone.service
[Unit]
Description=PlexDrive (rclone)
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
User=andrew
Group=andrew
ExecStart=/usr/bin/rclone mount PlexDrive: /home/andrew/plexdrive \
        --config /home/andrew/.config/rclone/rclone.conf \
        --allow-other \
        --log-file /home/andrew/rclone.log \
        --vfs-cache-mode writes
ExecStop=/bin/fusermount -uz /home/andrew/plexdrive
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Other Info:
Systemctl status rclone shows:

● rclone.service - PlexDrive (rclone)
     Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: enabled)
     Active: inactive (dead)

journalctl -u rclone.service -b shows:

--Logs begin at Sun 2020-05-10 18:53:24 UTC, end at Thu 2020-06-04 22:15:37 UTC. --
-- No entries --

There are no entries in the rclone log file after a reboot.

Noob question but i have to ask..., Did you enabled the service? ex: systemctl enable rclone.service

Yes I have the service enabled, tried disabling it and re enabling as well to no avail.

Is that service running on your system?

You should see something like:

felix@gemini:/etc/systemd/system$ systemctl status network-online.target
● network-online.target - Network is Online
     Loaded: loaded (/lib/systemd/system/network-online.target; static; vendor preset: enabled)
     Active: active since Sun 2020-05-31 17:11:15 EDT; 4 days ago
       Docs: man:systemd.special(7)
             https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

May 31 17:11:15 gemini systemd[1]: Reached target Network is Online.

Yes. Here is the output:

● network-online.target - Network is Online
     Loaded: loaded (/lib/systemd/system/network-online.target; static; vendor preset: enabled)
     Active: active since Thu 2020-06-04 22:10:36 UTC; 14h ago
       Docs: man:systemd.special(7)
             https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

Jun 04 22:10:36 plex03 systemd[1]: Reached target Network is Online.

Does the service start when you try?

systemctl start rclone

Does that work?

If so, just disable and re-enable it.

systemctl disable rclone
systemctl enable rclone

Share the output and test by rebooting.

Wow, okay! I did this a few times yesterday, but with "sudo systemctl..." instead of having systemctl prompt for a password.

Seems disabling and enabling worked this time without sudo.

Thank you for your help!

I have noticed at times if a name changes or something, systemd services can get confused and usually a disable/enable does the trick.

Happy you got it working!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.