Rclone auto mount systemctl plex cant plex files

What is the problem you are having with rclone?

I've deployed rclone to ubuntu 22.04 via swizzin, but can't seem to get it to work via systemctl so that it is mounted in case of server restart.
If i run the command rclone mount gdrive: /mnt/unionfs --allow-other --allow-non-empty --log-level DEBUG --vfs-cache-mode full directly then plex can read and play files fine.
But when starting rclone via systemctl then plex can see the drive and browse the files but can play any files...

Run the command 'rclone version' and share the full output of the command.

rclone v1.62.2
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.0-67-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none

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

Google Drive

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

Works: rclone mount gdrive: /mnt/unionfs --allow-other --allow-non-empty --log-level DEBUG --vfs-cache-mode full

Not working: systemctl start rclone

The rclone config contents with secrets removed.

# /etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone)
AssertPathIsDirectory=/mnt/unionfs
After=plexdrive.service

[Service]
Type=simple
Environment=RCLONE_CONFIG=/home/aha/.config/rclone/rclone.conf
ExecStart=/usr/bin/rclone mount gdrive: /mnt/unionfs \
        --allow-other \
        --allow-non-empty \
        --vfs-cache-mode full \
        --vfs-cache-max-size 256G \
        --vfs-cache-max-age 72h \
        --buffer-size 16M \
        --log-level DEBUG \
        --log-file /mnt/unionfs/rclone_debug.log \
        --cache-dir /mnt/unionfs/tmp/rclone \
        --cache-tmp-upload-path /mnt/unionfs/tmp/rclone \
        --vfs-read-chunk-size 128M \
        --vfs-read-chunk-size-limit off
ExecStop=/bin/fusermount -uz /mnt/unionfs
Restart=on-failure
RestartSec=30
StartLimitInterval=60s
StartLimitBurst=3
User=aha
Group=plex

[Install]
WantedBy=default.target

A log from the command with the -vv flag

hello and welcome to the forum,

have you seen
Rclone auto mount systemctl plex cant plex files - #2 by asdffdsa

if you are not 1000% of --allow-non-empty, then remove it.

rclone mount gdrive: /mnt/unionfs --allow-other --allow-non-empty --log-level DEBUG --vfs-cache-mode
if that simple command works, then, for testing, use that with systemd.
note: that is not a valid command as --vfs-cache-mode is missing a value off|minimal|writes|full

--cache-tmp-upload-path is not for rclone mount, so remove that.

post the full output

and can you post the full systemd service file, enclosing with three backticks so it is formated like so

[Unit]
Description=RClone Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
Environment=RCLONE_CONFIG=/opt/rclone/rclone.conf
KillMode=none
RestartSec=5
ExecStart=/usr/bin/rclone mount gcrypt: /GD \
--allow-other \
--dir-cache-time 5000h \

Okay so its working now. :smiley:

I did the following:
Removed --allow-non-empty
Removed --cache-tmp-upload-path
Changed the log file and cache location

# /etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone)
AssertPathIsDirectory=/mnt/unionfs
After=plexdrive.service

[Service]
Type=simple
Environment=RCLONE_CONFIG=/home/aha/.config/rclone/rclone.conf
ExecStart=/usr/bin/rclone mount gdrive: /mnt/unionfs \
        --allow-other \
        --vfs-cache-mode full \
        --vfs-cache-max-size 256G \
        --vfs-cache-max-age 72h \
        --buffer-size 16M \
        --log-level DEBUG \

        --log-file /home/aha/rclone/rclone_debug.log \ 
        --cache-dir /home/aha/rclone/tmp/rclone \

        --vfs-read-chunk-size 128M \
        --vfs-read-chunk-size-limit off
ExecStop=/bin/fusermount -uz /mnt/unionfs
Restart=on-failure
RestartSec=30
StartLimitInterval=60s
StartLimitBurst=3
User=aha
Group=plex

[Install]
WantedBy=default.target

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