Error creating mount service

Hi!

I have a problem when I try to run an RClone mount service

Here is my version of RClone:

  • os/version: ubuntu 20.04 (64 bit)
  • os/kernel: 5.11.0-1028-oracle (aarch64)
  • os/type: linux
  • os/arch: arm64
  • go/version: go1.17.2
  • go/linking: static
  • go/tags: none

I have this in the output of systemctl status:
● onedrive1.service - Onedrive 1 Mount Service
Loaded: loaded (/etc/systemd/system/onedrive1.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2022-02-28 02:38:23 UTC; 7s ago
Process: 2551 ExecStart=/usr/bin/rclone mount --config=/home/ubuntu/.config/rclone/rclone.conf -–user-agent=ubuntu –-allow-other -–timeout=1h -–poll- int>
Main PID: 2551 (code=exited, status=1/FAILURE)

Feb 28 02:38:23 instance-20220226-1243 rclone[2551]: --vfs-write-wait duration Time to wait for in-sequence write before giving error (>
Feb 28 02:38:23 instance-20220226-1243 rclone[2551]: --volname string Set the volume name (supported on Windows and OSX only)
Feb 28 02:38:23 instance-20220226-1243 rclone[2551]: --write-back-cache Makes kernel buffer writes before sending them to rclone>
Feb 28 02:38:23 instance-20220226-1243 rclone[2551]: Use "rclone [command] --help" for more information about a command.
Feb 28 02:38:23 instance-20220226-1243 rclone[2551]: Use "rclone help flags" for to see the global flags.
Feb 28 02:38:23 instance-20220226-1243 rclone[2551]: Use "rclone help backends" for a list of supported services.
Feb 28 02:38:23 instance-20220226-1243 rclone[2551]: 02/28/2022 02:38:23 Fatal error: unknown shorthand flag: 'â' in --user-agent=ubuntu
Feb 28 02:38:23 instance-20220226-1243 systemd[1]: onedrive1.service: Main process exited, code=exited, status=1/FAILURE
Feb 28 02:38:23 instance-20220226-1243 systemd[1]: onedrive1.service: Failed with result 'exit-code'.
Feb 28 02:38:23 instance-20220226-1243 systemd[1]: Failed to start Onedrive 1 Mount Service.

My service configuration is this:
[Unit]
Description= Onedrive 1 Mount Service
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount
--config=/home/ubuntu/.config/rclone/rclone.conf
--user-agent=ubuntu
--allow-other
--timeout=1h
--poll-interval=15s
--dir-cache-time=1000h
--–cache-dir=/mnt/cloud/cache/onedrive1
--vfs-write-wait duration=1s
--vfs-cache-mode=full
--vfs-cache-max-size=15G
--vfs-cache-max-age=12h
crypt-onedrive1: /mnt/cloud/onedrive1
ExecStop=/bin/fusermount -uz /mnt/cloud/onedrive1
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

I looked for similar errors on the internet and found none.

In your service file, you need \ after the trailing lines:

[Unit]
Description= Onedrive 1 Mount Service
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount crypt-onedrive1: /mnt/cloud/onedrive1 \
--config=/home/ubuntu/.config/rclone/rclone.conf \
--user-agent=ubuntu \
--allow-other \
--timeout=1h \
--poll-interval=15s \
--dir-cache-time=1000h \
--–cache-dir=/mnt/cloud/cache/onedrive1 \
--vfs-write-wait duration=1s \
--vfs-cache-mode=full \
--vfs-cache-max-size=15G \
--vfs-cache-max-age=12h
ExecStop=/bin/fusermount -uz /mnt/cloud/onedrive1
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

and I moved the mount part up with the options after.

So, I did exactly like that, but I didn't succeed.

● onedrive1.service - Onedrive 1 Mount Service
Loaded: loaded (/etc/systemd/system/onedrive1.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2022-02-28 04:49:26 UTC; 3s ago
Process: 4943 ExecStart=/usr/bin/rclone mount crypt-onedrive1: /mnt/cloud/onedrive1 --config=/home/ubuntu/.config/rclone/rclone.conf -–user-agent ubuntu –-allow-other -–timeout=1h -–poll-interval=15s -–dir-cache-time=1000h -–cache-d>
Main PID: 4943 (code=exited, status=1/FAILURE)

Feb 28 04:49:26 instance-20220226-1243 rclone[4943]: --vfs-write-wait duration Time to wait for in-sequence write before giving error (default 1s)
Feb 28 04:49:26 instance-20220226-1243 rclone[4943]: --volname string Set the volume name (supported on Windows and OSX only)
Feb 28 04:49:26 instance-20220226-1243 rclone[4943]: --write-back-cache Makes kernel buffer writes before sending them to rclone (without this, writethrough caching is used) (not supported on Windows)
Feb 28 04:49:26 instance-20220226-1243 rclone[4943]: Use "rclone [command] --help" for more information about a command.
Feb 28 04:49:26 instance-20220226-1243 rclone[4943]: Use "rclone help flags" for to see the global flags.
Feb 28 04:49:26 instance-20220226-1243 rclone[4943]: Use "rclone help backends" for a list of supported services.
Feb 28 04:49:26 instance-20220226-1243 rclone[4943]: 2022/02/28 04:49:26 Fatal error: unknown shorthand flag: 'â' in -–user-agent
Feb 28 04:49:26 instance-20220226-1243 systemd[1]: onedrive1.service: Main process exited, code=exited, status=1/FAILURE
Feb 28 04:49:26 instance-20220226-1243 systemd[1]: onedrive1.service: Failed with result 'exit-code'.
Feb 28 04:49:26 instance-20220226-1243 systemd[1]: Failed to start Onedrive 1 Mount Service.

Here's the .service file I'm configuring:

[Unit]
Description= Onedrive 1 Mount Service
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount crypt-onedrive1: /mnt/cloud/onedrive1 \
--config=/home/ubuntu/.config/rclone/rclone.conf \
-–user-agent=ubuntu \
–-allow-other \
-–timeout=1h \
-–poll-interval=15s \
-–dir-cache-time=1000h \
-–cache-dir=/mnt/cloud/cache/onedrive1 \
--vfs-write-wait duration=1s \
-–vfs-cache-mode=full \
-–vfs-cache-max-size=15G \
-–vfs-cache-max-age=12h
ExecStop=/bin/fusermount -uz /mnt/cloud/onedrive1
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

They have the backslash (\), but I can't make it show

Sorry as --cache-dir in your command has 3 dashes instead two and you don't need the word duration in the vfs-write-wait

/usr/bin/rclone mount crypt-onedrive1: /mnt/cloud/onedrive1 \
--config=/home/ubuntu/.config/rclone/rclone.conf \
--user-agent=ubuntu \
--allow-other \
--timeout=1h \
--poll-interval=15s \
--dir-cache-time=1000h \
--cache-dir=/mnt/cloud/cache/onedrive1 \
--vfs-write-wait=1s \
--vfs-cache-mode=full \
--vfs-cache-max-size=15G \
--vfs-cache-max-age=12h

and that runs for me on the command line, best to test there first and validate it's doing what you want and then try the service file.

felix@gemini:~$ /usr/bin/rclone mount crypt-onedrive1: /mnt/cloud/onedrive1 \
> --config=/home/ubuntu/.config/rclone/rclone.conf \
> --user-agent=ubuntu \
> --allow-other \
> --timeout=1h \
> --poll-interval=15s \
> --dir-cache-time=1000h \
> --cache-dir=/mnt/cloud/cache/onedrive1 \
> --vfs-write-wait=1s \
> --vfs-cache-mode=full \
> --vfs-cache-max-size=15G \
> --vfs-cache-max-age=12h
2022/02/28 00:06:07 NOTICE: Config file "/home/ubuntu/.config/rclone/rclone.conf" not found - using defaults
2022/02/28 00:06:07 Failed to create file system for "crypt-onedrive1:": didn't find section in config file

Thank you for your help! the creation of the mount service worked, my command was wrong. thank you!

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