Rclone.service is not loaded properly: Invalid argument

Thank you very for all your help.
but when i rebooted the server i had to restart the service Manually how can i make at Auto on reboot?

You need to enable it.

systemctl enable rclone

i did but get this error:
Failed to enable unit: File rclone.service: Invalid argument

Guessing you still have some issues with the 1st line of the file. Extra character or something.

i will try to fix it you have been a big help
tanks

Can I suggest these scripts?

https://github.com/comio/rclone-tools

copying mount.rclone into /usr/sbin, you can use the standard fstab approach to mount remote filesystems.

ciao

luigi

1 Like

You might want to change them from simple to notify for your systemd stuff.

thank you for the help my rclone.service is now working with no errors but is Animosity022 said i changed the simple to notify.
but after all that work when i try to systemctl enable rclone i get Failed to enable unit: File rclone.service: Invalid argument !

root@onlines2m:~# systemctl start rclone
root@onlines2m:~# systemctl status rclone
● rclone.service - RClone Service
   Loaded: loaded (/etc/systemd/system/rclone.service; bad; vendor preset: enabled)
   Active: active (running) since Mon 2019-02-04 18:48:02 +03; 1s ago
  Process: 9240 ExecStop=/bin/fusermount -uz /home/mfmaa03/media/gsuite (code=exited, status=0/SUCCESS)
 Main PID: 9264 (rclone)
    Tasks: 14 (limit: 4915)
   CGroup: /system.slice/rclone.service
           └─9264 /usr/bin/rclone mount gsuite: /home/mfmaa03/media/gsuite --config /home/mfmaa03/.config/rclone/rclone.conf --allow-non-empty --allow-o

Feb 04 18:48:02 onlines2m systemd[1]: Started RClone Service.

You have a reuiresmountfor which is the same thing you are mounting? I’m guessing that might be an issue as well as you’d normally wait for something else to mount if you wanted to and than mount it.

i have update my files and now no errors but sill when i try to systemctl enable rclone i get Failed to enable unit: File rclone.service: Invalid argument !

[Unit]
Description=RClone Service
Documentation=http://rclone.org/docs/
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount gsuite: /home/mfmaa03/media/gsuite --config /home/mfmaa03/.config/rclone/.config --allow-non-empty --allow-other --vfs-cache-mode writes --max-transfer 750G
ExecStop=/usr/bin/fusermount -uz /home/mfmaa03/media/gsuite
Restart=always
RestartSec=5
User=mfmaa03
Group=mfmaa03

[Install]
WantedBy=default.target

mfmaa03@onlines2m:~$ systemctl status rclone
● rclone.service - RClone Service
   Loaded: loaded (/etc/systemd/system/rclone.service; bad; vendor preset: enabled)
   Active: active (running) since Tue 2019-02-05 20:08:07 +03; 12min ago
 Main PID: 8333 (rclone)
    Tasks: 20 (limit: 4915)
   CGroup: /system.slice/rclone.service
           └─8333 /usr/bin/rclone mount gsuite: /home/mfmaa03/media/gsuite --config /home/mfmaa03/.config/rclone/rclone.conf --allow-non-empty --allow-other --vfs-cache-mode writes --max-transfer 750G

I think he’s supposed to have one gsuite: is the remote and he’s mounting to /home/mfmaa03/media/gsuite

Yeah :stuck_out_tongue_winking_eye: I looked too fast

Does this return something?

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 Fri 2019-02-01 09:38:25 EST; 4 days ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget

What’s the output for this command as well?

felix@gemini:/etc/systemd/system/multi-user.target.wants$ ls -al /etc/systemd/system/multi-user.target.wants
total 8
drwxr-xr-x  2 root root 4096 Feb  5 13:10 .
drwxr-xr-x 11 root root 4096 Feb  3 09:14 ..
lrwxrwxrwx  1 root root   35 Aug 25 17:27 apcupsd.service -> /lib/systemd/system/apcupsd.service
lrwxrwxrwx  1 root root   36 Aug 25 17:56 automark.service -> /etc/systemd/system/automark.service
lrwxrwxrwx  1 root root   36 Aug 25 17:59 autoscan.service -> /etc/systemd/system/autoscan.service
lrwxrwxrwx  1 root root   40 Aug 25 17:34 avahi-daemon.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx  1 root root   42 Aug 25 17:03 binfmt-support.service -> /lib/systemd/system/binfmt-support.service
lrwxrwxrwx  1 root root   33 Sep  1 08:43 caddy.service -> /etc/systemd/system/caddy.service
lrwxrwxrwx  1 root root   41 Aug 25 16:29 console-setup.service -> /lib/systemd/system/console-setup.service
lrwxrwxrwx  1 root root   32 Aug 25 16:29 cron.service -> /lib/systemd/system/cron.service
lrwxrwxrwx  1 root root   37 Jan 17 15:23 duplicati.service -> /lib/systemd/system/duplicati.service
lrwxrwxrwx  1 root root   34 Aug 25 16:48 gmedia.service -> /etc/systemd/system/gmedia.service
lrwxrwxrwx  1 root root   46 Aug 25 17:25 grafana-server.service -> /usr/lib/systemd/system/grafana-server.service
lrwxrwxrwx  1 root root   38 Aug 25 17:38 homebridge.service -> /etc/systemd/system/homebridge.service
lrwxrwxrwx  1 root root   36 Aug 25 17:23 influxdb.service -> /lib/systemd/system/influxdb.service
lrwxrwxrwx  1 root root   38 Aug 25 16:36 irqbalance.service -> /lib/systemd/system/irqbalance.service
lrwxrwxrwx  1 root root   38 Sep  3 15:40 lm-sensors.service -> /lib/systemd/system/lm-sensors.service
lrwxrwxrwx  1 root root   35 Aug 26 20:27 mongodb.service -> /lib/systemd/system/mongodb.service
lrwxrwxrwx  1 root root   35 Aug 25 17:27 netdata.service -> /etc/systemd/system/netdata.service
lrwxrwxrwx  1 root root   48 Sep  3 16:53 netfilter-persistent.service -> /lib/systemd/system/netfilter-persistent.service
lrwxrwxrwx  1 root root   38 Aug 25 16:29 networking.service -> /lib/systemd/system/networking.service
lrwxrwxrwx  1 root root   34 Aug 25 17:19 nzbget.service -> /etc/systemd/system/nzbget.service
lrwxrwxrwx  1 root root   32 Aug 25 17:19 ombi.service -> /etc/systemd/system/ombi.service
lrwxrwxrwx  1 root root   35 Sep  3 23:05 openvpn.service -> /lib/systemd/system/openvpn.service
lrwxrwxrwx  1 root root   38 Aug 25 17:21 php7.0-fpm.service -> /lib/systemd/system/php7.0-fpm.service
lrwxrwxrwx  1 root root   43 Dec 18 06:25 plexmediaserver.service -> /lib/systemd/system/plexmediaserver.service
lrwxrwxrwx  1 root root   35 Aug 25 18:09 postfix.service -> /lib/systemd/system/postfix.service
lrwxrwxrwx  1 root root   34 Aug 25 17:19 radarr.service -> /etc/systemd/system/radarr.service
lrwxrwxrwx  1 root root   36 Aug 26 00:26 rc-local.service -> /etc/systemd/system/rc-local.service
lrwxrwxrwx  1 root root   36 Aug 25 16:29 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx  1 root root   33 Aug 25 16:41 rsync.service -> /lib/systemd/system/rsync.service
lrwxrwxrwx  1 root root   35 Aug 25 16:29 rsyslog.service -> /lib/systemd/system/rsyslog.service
lrwxrwxrwx  1 root root   36 Sep  4 06:29 rtorrent.service -> /etc/systemd/system/rtorrent.service
lrwxrwxrwx  1 root root   34 Aug 25 17:19 sonarr.service -> /etc/systemd/system/sonarr.service
lrwxrwxrwx  1 root root   31 Aug 25 16:32 ssh.service -> /lib/systemd/system/ssh.service
lrwxrwxrwx  1 root root   36 Aug 25 17:19 tautulli.service -> /etc/systemd/system/tautulli.service
lrwxrwxrwx  1 root root   33 Aug 26 20:27 unifi.service -> /lib/systemd/system/unifi.service
lrwxrwxrwx  1 root root   39 Sep 13 08:48 uptimerobot.service -> /etc/systemd/system/uptimerobot.service
root@onlines2m:~# 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 Tue 2019-02-05 20:05:43 +03; 1h 49min ago
     Docs: man:systemd.special(7)
           https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
root@onlines2m:~# /etc/systemd/system/multi-user.target.wants$ ls -al /etc/systemd/system/multi-user.target.wants
-bash: /etc/systemd/system/multi-user.target.wants$: No such file or directory

What operating system are you running?

What operating system are you running?

Ubuntu server 18.04

That’s odd as I’d expect that to be there as I’m Debian.

What does

ls -al /etc/systemd/system

show?

root@onlines2m:~# ls -al /etc/systemd/system
total 44
drwxr-xr-x 10 root root 4096 Feb  3 22:51 .
drwxr-xr-x  5 root root 4096 Jan 25 15:11 ..
lrwxrwxrwx  1 root root   42 Jan 25 21:23 dbus-fi.w1.wpa_supplicant1.service -> /lib/systemd/system/wpa_supplicant.service
lrwxrwxrwx  1 root root   40 Jan 25 21:23 dbus-org.freedesktop.ModemManager1.service -> /lib/systemd/system/ModemManager.service
lrwxrwxrwx  1 root root   53 Jan 25 21:23 dbus-org.freedesktop.nm-dispatcher.service -> /lib/systemd/system/NetworkManager-dispatcher.service
lrwxrwxrwx  1 root root   44 Jan 25 15:03 dbus-org.freedesktop.resolve1.service -> /lib/systemd/system/systemd-resolved.service
drwxr-xr-x  2 root root 4096 Jan 25 15:14 default.target.wants
drwxr-xr-x  2 root root 4096 Jan 25 15:18 getty.target.wants
drwxr-xr-x  2 root root 4096 Jan 25 21:23 graphical.target.wants
drwxr-xr-x  2 root root 4096 Feb  5 18:31 multi-user.target.wants
drwxr-xr-x  2 root root 4096 Feb  5 18:30 network-online.target.wants
-rw-r--r--  1 root root  543 Feb  3 23:42 rclone.service
lrwxrwxrwx  1 root root    9 Jan 25 16:40 samba-ad-dc.service -> /dev/null
drwxr-xr-x  2 root root 4096 Jan 25 21:23 sockets.target.wants
lrwxrwxrwx  1 root root   31 Jan 25 15:16 sshd.service -> /lib/systemd/system/ssh.service
drwxr-xr-x  2 root root 4096 Jan 25 15:13 sysinit.target.wants
lrwxrwxrwx  1 root root   35 Jan 25 15:04 syslog.service -> /lib/systemd/system/rsyslog.service
drwxr-xr-x  2 root root 4096 Jan 25 15:05 timers.target.wants
root@onlines2m:~#