Rclone.service is not loaded properly: Invalid argument

https://file.io/tFNSFu

That link doesn’t work as it gives an error:

image

So if you you run:

systemctl daemon-reload
systemctl start rclone

and assuming it doesn’t work, what does

journalctl -u rclone

Show at the end of the logs?

Feb 03 16:40:00 onlines2m systemd[1]: /etc/systemd/system/rclone.service:10: Missing '='.
Feb 03 16:41:55 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 16:41:55 onlines2m systemd[1]: /etc/systemd/system/rclone.service:9: Ignoring unknown escape sequences: "\"
Feb 03 16:41:55 onlines2m systemd[1]: /etc/systemd/system/rclone.service:10: Missing '='.
Feb 03 16:42:04 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 16:42:04 onlines2m systemd[1]: /etc/systemd/system/rclone.service:9: Ignoring unknown escape sequences: "\"
Feb 03 16:42:04 onlines2m systemd[1]: /etc/systemd/system/rclone.service:10: Missing '='.
-- Reboot --
Feb 03 16:45:57 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 16:45:57 onlines2m systemd[1]: /etc/systemd/system/rclone.service:9: Ignoring unknown escape sequences: "\"
Feb 03 16:45:57 onlines2m systemd[1]: /etc/systemd/system/rclone.service:10: Missing '='.
Feb 03 16:46:11 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 16:46:11 onlines2m systemd[1]: /etc/systemd/system/rclone.service:9: Ignoring unknown escape sequences: "\"
Feb 03 16:46:11 onlines2m systemd[1]: /etc/systemd/system/rclone.service:10: Missing '='.
Feb 03 16:50:14 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 16:50:14 onlines2m systemd[1]: /etc/systemd/system/rclone.service:9: Ignoring unknown escape sequences: "\"
Feb 03 16:50:14 onlines2m systemd[1]: /etc/systemd/system/rclone.service:10: Missing '='.
Feb 03 17:11:04 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 17:11:04 onlines2m systemd[1]: /etc/systemd/system/rclone.service:9: Ignoring unknown escape sequences: "\"
Feb 03 17:11:04 onlines2m systemd[1]: /etc/systemd/system/rclone.service:10: Missing '='.
lines 59-97/97 (END)

Are you using a Windows machine or something and transferring the file back and forth?

You have Windows line feeds at the end of each line.

cat -vet rclone.service
root@gemini:/etc/systemd/system cat test.service^M$
[Unit]^M$
Description=RClone Service^M$
RequiresMountsFor=/home/mfmaa03/media/gsuite^M$
After=network-online.target^M$
^M$
[Service]^M$
Type=simple^M$
ExecStart=/usr/bin/rclone mount gsuite: /home/mfmaa03/media/gsuite \^M$
   --config /home/mfmaa03/.rclone.conf \^M$
   --allow-non-empty \^M$
   --allow-other \^M$
   --vfs-cache-mode writes \^M$
   --max-transfer 750G^M$
ExecStop=/bin/fusermount -uz /home/mfmaa03/media/gsuite^M$
Restart=always^M$
RestartSec=10^M$
User=mfmaa03^M$
Group=mfmaa03^M$
^M$
[Install]^M$

I haven’t used a Windows machine in forever so not sure how to fix other than transferring in ascii or just using vi on the Linux box and pasting the file in.

I did a copy / paste of your file and it works fine.

Yes im using windows PC and WinSCP to send the files

You need to transfer the file in ASCII mode so the line feeds get fixed or edit the file on your Linux machine.

any idea how to do that in windows ?

i made a new file over your template and now i get this error:

root@onlines2m:~# systemctl status rclone
● rclone.service - RClone Service
   Loaded: loaded (/etc/systemd/system/rclone.service; bad; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sun 2019-02-03 17:35:42 +03; 6s ago
  Process: 31721 ExecStart=/usr/bin/rclone mount gsuite: /home/mfmaa03/media/gsuite --config /home/mfmaa03/.rclone.conf --allow-non-empty --allow-other --vfs-cache-mode writes --max-transfer 750G (code=exited,
 Main PID: 31721 (code=exited, status=1/FAILURE)
lines 1-5/5 (END)

So without seeing the file you made nor the log, I would just say it is still wrong :slight_smile:

You’d need to include the file you made and the journalctl -u rclone output so I can see the error.

Feb 03 17:41:41 onlines2m systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 17:41:41 onlines2m systemd[1]: rclone.service: Failed with result 'exit-code'.
Feb 03 17:41:51 onlines2m systemd[1]: rclone.service: Service hold-off time over, scheduling restart.
Feb 03 17:41:51 onlines2m systemd[1]: rclone.service: Scheduled restart job, restart counter is at 53.
Feb 03 17:41:51 onlines2m systemd[1]: Stopped RClone Service.
Feb 03 17:41:51 onlines2m systemd[1]: Started RClone Service.
Feb 03 17:41:51 onlines2m rclone[580]: 2019/02/03 15:41:51 NOTICE: Config file "/home/mfmaa03/.rclone.conf" not found - using defaults
Feb 03 17:41:51 onlines2m rclone[580]: 2019/02/03 15:41:51 Failed to create file system for "gsuite:": didn't find section in config file
Feb 03 17:41:51 onlines2m systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 17:41:51 onlines2m systemd[1]: rclone.service: Failed with result 'exit-code'.
Feb 03 17:42:01 onlines2m systemd[1]: rclone.service: Service hold-off time over, scheduling restart.
Feb 03 17:42:01 onlines2m systemd[1]: rclone.service: Scheduled restart job, restart counter is at 54.
Feb 03 17:42:01 onlines2m systemd[1]: Stopped RClone Service.
Feb 03 17:42:01 onlines2m systemd[1]: Started RClone Service.
Feb 03 17:42:01 onlines2m rclone[608]: 2019/02/03 15:42:01 NOTICE: Config file "/home/mfmaa03/.rclone.conf" not found - using defaults
Feb 03 17:42:01 onlines2m rclone[608]: 2019/02/03 15:42:01 Failed to create file system for "gsuite:": didn't find section in config file
Feb 03 17:42:01 onlines2m systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 17:42:01 onlines2m systemd[1]: rclone.service: Failed with result 'exit-code'.
Feb 03 17:42:12 onlines2m systemd[1]: rclone.service: Service hold-off time over, scheduling restart.
Feb 03 17:42:12 onlines2m systemd[1]: rclone.service: Scheduled restart job, restart counter is at 55.
Feb 03 17:42:12 onlines2m systemd[1]: Stopped RClone Service.
Feb 03 17:42:12 onlines2m systemd[1]: Started RClone Service.
Feb 03 17:42:12 onlines2m rclone[633]: 2019/02/03 15:42:12 NOTICE: Config file "/home/mfmaa03/.rclone.conf" not found - using defaults
Feb 03 17:42:12 onlines2m rclone[633]: 2019/02/03 15:42:12 Failed to create file system for "gsuite:": didn't find section in config file
Feb 03 17:42:12 onlines2m systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 17:42:12 onlines2m systemd[1]: rclone.service: Failed with result 'exit-code'.
Feb 03 17:42:22 onlines2m systemd[1]: rclone.service: Service hold-off time over, scheduling restart.
Feb 03 17:42:22 onlines2m systemd[1]: rclone.service: Scheduled restart job, restart counter is at 56.
Feb 03 17:42:22 onlines2m systemd[1]: Stopped RClone Service.
Feb 03 17:42:22 onlines2m systemd[1]: Started RClone Service.
Feb 03 17:42:22 onlines2m rclone[669]: 2019/02/03 15:42:22 NOTICE: Config file "/home/mfmaa03/.rclone.conf" not found - using defaults
Feb 03 17:42:22 onlines2m rclone[669]: 2019/02/03 15:42:22 Failed to create file system for "gsuite:": didn't find section in config file
Feb 03 17:42:22 onlines2m systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 17:42:22 onlines2m systemd[1]: rclone.service: Failed with result 'exit-code'.
Feb 03 17:42:23 onlines2m systemd[1]: Stopped RClone Service.

i never thought it would be this difficult

It failed because the path to your config file isn’t right.

root@gemini:/etc/systemd/system cat test.service
[Unit]
Description=RClone Service
RequiresMountsFor=/home/mfmaa03/media/gsuite
After=network-online.target

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

[Install]
WantedBy=default.target
root@onlines2m:~# systemctl status rclone
● rclone.service - RClone Service
   Loaded: loaded (/etc/systemd/system/rclone.service; bad; vendor preset: enabled)
   Active: inactive (dead)

Feb 03 18:04:06 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 18:04:06 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Missing '='.
root@onlines2m:~#

journalctl -u

Feb 03 17:42:22 onlines2m rclone[669]: 2019/02/03 15:42:22 NOTICE: Config file "/home/mfmaa03/.rclone.conf" not found - using defaults
Feb 03 17:42:22 onlines2m rclone[669]: 2019/02/03 15:42:22 Failed to create file system for "gsuite:": didn't find section in config file
Feb 03 17:42:22 onlines2m systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Feb 03 17:42:22 onlines2m systemd[1]: rclone.service: Failed with result 'exit-code'.
Feb 03 17:42:23 onlines2m systemd[1]: Stopped RClone Service.
-- Reboot --
Feb 03 18:04:06 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Assignment outside of section. Ignoring.
Feb 03 18:04:06 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Missing '='.

As the user, you should run:

felix@gemini:~$ rclone config file
Configuration file is stored at:
/data/rclone/rclone.conf

That shows you were the rclone config file is and that should match the same path to the --config location.

You need to get the file transferred over properly as that last log shows you still have Windows line feeds and such. I’m not sure how to do that as I don’t use Windows other than looking at WinSCP and seeing to make that work.

does this mean its working ?
i can see the mount

● rclone.service - RClone Service
   Loaded: loaded (/etc/systemd/system/rclone.service; bad; vendor preset: enabled)
   Active: active (running) since Sun 2019-02-03 19:32:04 +03; 6s ago
 Main PID: 14671 (rclone)
    Tasks: 17 (limit: 4915)
   CGroup: /system.slice/rclone.service
           └─14671 /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

Feb 03 19:32:04 onlines2m systemd[1]: Started RClone Service.
Feb 03 19:32:11 onlines2m systemd[1]: /etc/systemd/system/rclone.service:1: Missing '='.
root@onlines2m:~#

Yes, that’s the process that’s running. Good job!