Rclone Mount Problem

My config:

[Unit]
Description=Rclone Serive
After=syslog.target local-fs.target network.target
[Service]
Environment=RCLONEHOME=/home/plexuser/.config/rclone
Environment=MOUNTTO=/media/Plex
Environment=LOGS=/home/plexuser/logs
Environment=UPLOADS=/home/plexuser/uploads
Type=notify
User=root
ExecStart=/usr/bin/rclone mount \
  --log-file ${LOGS}/rclone.log \
  --log-level DEBUG \
  --umask 002 \
  --allow-non-empty \
  --allow-other \
  --fuse-flag sync_read \
  --tpslimit 8 \
  --fast-list \
  --tpslimit-burst 8 \
  --dir-cache-time=72h \
  --drive-chunk-size 32M \
  --buffer-size=1G \
  --vfs-read-chunk-size=128M \
  --vfs-read-chunk-size-limit=2G \
  --vfs-cache-max-age=5m \
  --vfs-cache-mode=writes \
  --config ${RCLONEHOME}/rclone.conf \
  tdrive: ${MOUNTTO}
ExecStop=/bin/fusermount -u -z ${MOUNTTO}
ExecStop=/bin/rmdir ${MOUNTTO}
Restart=on-failure
[Install]
WantedBy=multi-user.target

sudo systemctl status rclone

rclone.service - Rclone Serive
   Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2018-11-19 02:43:05 CET; 4min 31s ago
  Process: 4298 ExecStart=/usr/bin/rclone mount --log-file ${LOGS}/rclone.log --log-level DEBUG --umask 002 --allow-non-empty --allow-other --fuse-flag sync_read --tpslimit 8 --fast-list --tpslimit-burst 8 --dir-cache-time=72h --drive-chunk-size 32M --buffer-size=1G --vf
 Main PID: 4298 (code=exited, status=1/FAILURE)

Nov 19 02:43:05 systemd[1]: rclone.service: Service hold-off time over, scheduling restart.
Nov 19 02:43:05 systemd[1]: rclone.service: Scheduled restart job, restart counter is at 5.
Nov 19 02:43:05 systemd[1]: Stopped Rclone Serive.
Nov 19 02:43:05 systemd[1]: rclone.service: Start request repeated too quickly.
Nov 19 02:43:05 systemd[1]: rclone.service: Failed with result 'exit-code'.
Nov 19 02:43:05 systemd[1]: Failed to start Rclone Serive.

Help me please.

What does the log file say?

2018/11/19 11:25:55 DEBUG : Google drive root '': Mounting on "/media/Plex"
2018/11/19 11:25:55 Fatal error: failed to mount FUSE fs: mountpoint does not exist: /media/Plex

run mkdir media/Plex to create the mountpoint - that should fix it.

1 Like
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Main process exited, code=killed, status=9/KILL
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Failed with result 'signal'.
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Service hold-off time over, scheduling restart.
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Scheduled restart job, restart counter is at 1.
Nov 24 18:20:02 xxx systemd[1]: Stopped Rclone Serive.
Nov 24 18:20:02 xxx systemd[1]: Starting Rclone Serive...
Nov 24 18:20:02 xxx mkdir[14034]: /bin/mkdir: cannot create directory ‘/media/Plex’: File exists
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Control process exited, code=exited status=1
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Failed with result 'exit-code'.
Nov 24 18:20:02 xxx systemd[1]: Failed to start Rclone Serive.
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Service hold-off time over, scheduling restart.
Nov 24 18:20:02 xxx systemd[1]: rclone.service: Scheduled restart job, restart counter is at 2.
Nov 24 18:20:02 xxx systemd[1]: Stopped Rclone Serive.

After that, it only works again if I reboot the machine.

What is the updated service file?

Sorry, I don’t know what is this.

The file you posted in the first post.

[Unit]
Description=Rclone Serive
After=syslog.target local-fs.target network.target
[Service]
Environment=RCLONEHOME=/home/plexuser/.config/rclone
Environment=MOUNTTO=/media/Plex
Environment=LOGS=/home/plexuser/logs
Environment=UPLOADS=/home/plexuser/uploads
Type=notify
User=root
ExecStartPre=/bin/mkdir -p ${MOUNTTO}
ExecStart=/usr/bin/rclone mount \
  --log-file ${LOGS}/rclone.log \
  --log-level DEBUG \
  --umask 002 \
  --allow-non-empty \
  --allow-other \
  --fuse-flag sync_read \
  --transfers 2 \
  --tpslimit 8 \
  --fast-list \
  --tpslimit-burst 8 \
  --dir-cache-time=72h \
  --drive-chunk-size 32M \
  --buffer-size=1G \
  --vfs-read-chunk-size=128M \
  --vfs-read-chunk-size-limit=2G \
  --vfs-cache-max-age=5m \
  --vfs-cache-mode=writes \
  --config ${RCLONEHOME}/rclone.conf \
  tdrive: ${MOUNTTO}
ExecStop=/bin/fusermount -u -z ${MOUNTTO}
ExecStop=/bin/rmdir ${MOUNTTO}
Restart=on-failure
[Install]
WantedBy=multi-user.target

This is very weird. mkdir -p shouldn’t throw an error if the directory already exists.

Which OS is this?

What is the output of ls -la /media/?

Ubuntu 18.04

plexuser@xxx:~$ ls -la /media/
total 8
drwxr-xr-x  3 root root 4096 Nov 22 03:16 .
drwxr-xr-x 22 root root 4096 Nov 14 15:19 ..
drwxrwxr-x  1 root root    0 Nov 24 21:16 Plex

I don’t see a -p in his mkdir which would throw the error.

There is a -p argument for mkdir in the ExecStartPre section.

Did you reload the file once the change was made?

The error means the -p wasn’t present when it ran.

Nov 24 18:20:02 xxx mkdir[14034]: /bin/mkdir: cannot create directory ‘/media/Plex’: File exists

I executed the command sudo systemctl daemon-reload

What’s the output if you run:

mkdir -p /media/Plex

plexuser@xxx:~$ mkdir -p /media/Plex
plexuser@xxx:~$

So if you reload and rerun the command, what’s the error now if it’s not mounted already?

plexuser@xxx:~$ sudo mkdir -p /media/Plex
plexuser@xxx:~$ sudo systemctl daemon-reload
plexuser@xxx:~$ sudo systemctl start rclone
plexuser@xxx:~$ sudo journalctl -u rclone.service
...
Nov 25 13:56:25 systemd[1]: Stopping Rclone Serive...
Nov 25 13:56:25 systemd[1]: Stopped Rclone Serive.
Nov 25 13:57:24 systemd[1]: Starting Rclone Serive...
Nov 25 13:57:25 systemd[1]: Started Rclone Serive.

So it’s working now?