Freezer on 4K movies and 4K TV episodes

I'm not sure how that's relevant as if you want to solve your issue, share some details and I'm happy to help.

i have a synbox, tho have not tried systemd yet.

Sorry about yesterday. But I caught a nasty cold yesterday. Because of a chemo my immune system is no longer what it used to be, it gets me then twice as hard. Today it is better, but still not optimal.

I appreciate your efforts. One can really see that you have a clue. And the forum here is really good - I've never been able to play a 4K movie without a freezer.

Didn't you connect your box with rclone then?

I got it to work with your configuration, finally.

Mounted it to a new directory.

root@Synology:~# cat /etc/systemd/system/rclone.service
[Unit]
Description=Rclone Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
KillMode=none
RestartSec=5
ExecStart=/usr/bin/rclone mount embycrypt: /volume1/media/emby \
--config "/root/.config/rclone/rclone.conf" \
--allow-other \
--rc --rc-addr=192.168.178.73:5572 \
--cache-dir=/root/.cache/rclone \
--vfs-cache-mode writes \
--vfs-cache-max-size 250G \
--log-level DEBUG \
--log-file /tmp/embycrypt.log \
--drive-pacer-min-sleep 10ms \
--drive-pacer-burst 200
ExecStop=/bin/fusermount -uz /volume1/media/emby

[Install]
WantedBy=multi-user.target

There was a mistake here, I think it should read...

--config "/root/.config/rclone/rclone.conf" \

So with""

 systemctl status rclone.service -l
● rclone.service - Rclone Service
   Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-12-01 12:17:58 CET; 6s ago
  Process: 6362 ExecStop=/bin/fusermount -uz /volume1/media/emby (code=exited, status=0/SUCCESS)
 Main PID: 6385 (rclone)
   Status: "[12:17] vfs cache: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)"
   Memory: 29.6M
   CGroup: /system.slice/rclone.service
           └─6385 /usr/bin/rclone mount embycrypt: /volume1/media/emby --config /root/.config/rclone/rclone.conf --allow-other --rc --rc-addr=192.168.178.73:5572 --cache-dir=/root/.cache/rclone --vfs-cache-mode writes --vfs-cache-max-size 250G --log-level DEBUG --log-file /tmp/embycrypt.log --drive-pacer-min-sleep 10ms --drive-pacer-burst 200

Dec 01 12:17:57 Synology systemd[1]: Starting Rclone Service...
Dec 01 12:17:57 Synology rclone[6385]: 2022/12/01 12:17:57 DEBUG : Home directory lookup failed and cannot be used as configuration location: exec: "getent": executable file not found in $PATH
Dec 01 12:17:57 Synology rclone[6385]: 2022/12/01 12:17:57 DEBUG : Failed to find user cache dir, using temporary directory: neither $XDG_CACHE_HOME nor $HOME are defined
Dec 01 12:17:58 Synology systemd[1]: Started Rclone Service.

With the penultimate error message I can somehow do nothing

Dec 01 12:17:57 Synology rclone[6385]: 2022/12/01 12:17:57 DEBUG : Home directory lookup failed and cannot be used as configuration location: exec: "getent": executable file not found in $PATH

And here it doesn't seem to find the cache folder - have already tried different folders, but always comes back with the same message - does rclone itself then create a cache folder somewhere alternatively?

Dec 01 12:17:57 Synology rclone[6385]: 2022/12/01 12:17:57 DEBUG : Failed to find user cache dir, using temporary directory: neither $XDG_CACHE_HOME nor $HOME are defined

No, please use exactly what I posted as you don't need that.

If that is what you want to use.

Make sure it exists.

ls -al /root/.cache

Share the output.

I removed the "" again.

root@Synology:~# cat /etc/systemd/system/rclone.service
[Unit]
Description=Rclone Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
KillMode=none
RestartSec=5
ExecStart=/usr/bin/rclone mount embycrypt: /volume1/media/emby \
--config /root/.config/rclone/rclone.conf \
--allow-other \
--rc --rc-addr=192.168.178.73:5572 \
--cache-dir=/volume1/cache/rclone \
--vfs-cache-mode full \
--vfs-cache-max-size 250G \
--vfs-cache-max-age 5000h \
--vfs-cache-poll-interval 5m \
--log-level DEBUG \
--log-file /volume1/cache/log/embycrypt.log \
--drive-pacer-min-sleep 10ms \
--drive-pacer-burst 200
ExecStop=/bin/fusermount -uz /volume1/media/emby

[Install]
WantedBy=multi-user.target

Apparently I should remove the folder where this is mounted first, and create it again when I change it.

No, actually I do not want that - but strangely enough he has created me there the cache without further. But is not good if it is stored on the root system.

And strangely enough, rclone seems to have created the cache there after all, when I changed it again.

now I still have this one error message at
systemctl status rclone.service -l

# systemctl status rclone.service -l
● rclone.service - Rclone Service
   Loaded: loaded (/etc/systemd/system/rclone.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2022-12-01 14:21:36 CET; 23s ago
===============================================================================
  Process: 9272 ExecStop=/bin/fusermount -uz /volume1/media/emby (code=exited, status=1/FAILURE)
===============================================================================

 Main PID: 18468 (rclone)
   Status: "[14:21] vfs cache: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)"
   Memory: 30.6M
   CGroup: /system.slice/rclone.service
           └─18468 /usr/bin/rclone mount embycrypt: /volume1/media/emby --config /root/.config/rclone/rclone.conf --allow-other --rc --rc-addr=192.168.178.73:5572 --cache-dir=/volume1/cache/rclone --vfs-cache-mode full --vfs-cache-max-size 250G --vfs-cache-max-age 5000h --vfs-cache-poll-interval 5m --log-level DEBUG --log-file /volume1/cache/log/embycrypt.log --drive-pacer-min-sleep 10ms --drive-pacer-burst 200

Dec 01 14:21:35 Synology systemd[1]: Starting Rclone Service...
Dec 01 14:21:35 Synology rclone[18468]: 2022/12/01 14:21:35 DEBUG : Home directory lookup failed and cannot be used as configuration location: exec: "getent": executable file not found in $PATH
Dec 01 14:21:35 Synology rclone[18468]: 2022/12/01 14:21:35 DEBUG : Failed to find user cache dir, using temporary directory: neither $XDG_CACHE_HOME nor $HOME are defined
Dec 01 14:21:36 Synology systemd[1]: Started Rclone Service.

I have added another \ here

ExecStop=/bin/fusermount -uz /volume1/media/emby \

and now get this apparently correct output

Process: 21911 ExecStop=/bin/fusermount -uz /volume1/media/emby (code=exited, status=0/SUCCESS)

Why did you do that? :frowning:

You only need \ for items that go over a single line as you keep breaking the service file.

I really can't follow what your file looks like because you keep changing pieces and not following a flow here. I really can't help if you don't work with me.

But without this \ I get this error message

  Process: 9272 ExecStop=/bin/fusermount -uz /volume1/media/emby (code=exited, status=1/FAILURE)

I always post the latest rclone.service in my replies.

Gotcha. Good luck then as I'm not sure what you are doing at this point.

The language barrier makes it just not easy for me. I can follow just so with a translation program - do me just also quite difficult.

But anyway thanks for the patience and the help so far :+1:

Share your latest service file.
Explain what the current problem is.

root@Synology:~# cat /etc/systemd/system/rclone.service
[Unit]
Description=Rclone Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
KillMode=none
RestartSec=5
ExecStart=/usr/bin/rclone mount embycrypt: /volume1/media/emby \
--config /root/.config/rclone/rclone.conf \
--allow-other \
--rc --rc-addr=192.168.178.73:5572 \
--cache-dir=/volume1/cache/rclone \
--vfs-cache-mode full \
--vfs-cache-max-size 250G \
--vfs-cache-max-age 5000h \
--vfs-cache-poll-interval 5m \
--log-level DEBUG \
--log-file /volume1/cache/log/embycrypt.log \
--drive-pacer-min-sleep 10ms \
--drive-pacer-burst 200
ExecStop=/bin/fusermount -uz /volume1/media/emby \

[Install]
WantedBy=multi-user.target

Right now it seems to be running - can't tell if it's running correctly until later, when Emby has re-read my libraries for me.

That \ makes it take the next line which happens to be blank. You really do not want that \ at the end of that line.

The confusion you have is that if you try to unmount a mount that is in use, it will fail.

You have to stop all IO to the mount before you can unmount it as it's like any other mount. You can't unmount a file system in use.

-uz is a lazy unmount, which means it will return before it actually unmounts.

You can see something like this:

image

and once I leave that mount point.

You can see the process actually exits:

image

What most people do is using systemd, they tie dependencies to things. I have two mounts and I use this in my service files.

After=rclone-movies.service rclone-tv.service
Requires=rclone-movies.service rclone-tv.service

as an example.

I have now again extra a umount executed and held exactly to your specifications, so even without this \ at that point. Now there is also no error message here.

So the config now looks like this

 cat /etc/systemd/system/rclone.service
[Unit]
Description=Rclone Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
KillMode=none
RestartSec=5
ExecStart=/usr/bin/rclone mount embycrypt: /volume1/media/emby \
--config /root/.config/rclone/rclone.conf \
--allow-other \
--rc --rc-addr=192.168.178.73:5572 \
--cache-dir=/volume1/cache/rclone \
--vfs-cache-mode full \
--vfs-cache-max-size 250G \
--vfs-cache-max-age 5000h \
--vfs-cache-poll-interval 5m \
--log-level DEBUG \
--log-file /volume1/cache/log/embycrypt.log \
--drive-pacer-min-sleep 10ms \
--drive-pacer-burst 200
ExecStop=/bin/fusermount -uz /volume1/media/emby

[Install]
WantedBy=multi-user.target

Interesting - and where exactly is this used? Also in the rclone.service?

No, in the other services that depends on rclone.

So in my case, rclone depends / waits on the network to be ready.

My top part of my rclone mounts.

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

My docker service has overrides, which make it depend on rclone mounts.

felix@gemini:/etc/systemd/system/docker.service.d$ cat override.conf
[Unit]
After=rclone-movies.service rclone-tv.service
Requires=rclone-movies.service rclone-tv.service

As I don't want to modify the stock service file so systemd provides ways to add additional config without modifying something that will get overwritten with an upgrade.

That means if my rclone mounts stop, my dockers automatically stop as well as I never want to run my Plex/Sonarr/Radarr without my rclone mounts.

That's my use case for how my things are setup.

The morale of the story is that you can't unmount a disk with processes on it regardless if it's a network mount like rclone or a local disk. You have to stop all processes/IO on a mount point before you unmount it.

I also tried with Docker - but failed miserably when starting the image/container.

I don't use rclone in a docker only other apps that rely on rclone.

Rclone is a single binary with a single config file so no reason for docker in my setup.

And such applications would be Emby or Plex, for example?