Rclone mount on startup with systemd

ok, I got it working

I was able to start it manually so my suspicion was that is was a timing issue. In your config there is a parameter TimeoutStartSec=10, but that isn’t doing what you expect it would do.
Configures the time to wait for start-up. If a daemon service does not signal start-up completion within the configured time, the service will be considered failed and will be shut down again

So it is not waiting 10 seconds, but it is considered failed when not started within 10 seconds

With systemd-analyze plot > plot.svg (image file can be opened in browser) I analyzed the systemd startup order and noticed that my rclonemount.service was very short after the network. so I pushed it back by making it depended of multi-user.target.
That seemed to do the trick

Still a bit dirty though I think, maybe the rclone mount command could get a wait command-line parameter before the actual mount is created

My systemd file rclonemount.service

[Unit]
Description=rclonemount
After=multi-user.target

[Service]
Type=simple
User=misteriks
ExecStart=/home/misteriks/Projects/Proj1/bin/rclone mount eacd: /home/misteriks/acd --config /home/misteriks/.rclone.conf --allow-other --max-read-ahead 200M --dir-cache-time 5m --acd-templink-threshold 0 --bwlimit 0 --checkers 32 --low-level-retries 1 --quiet --stats 0 --timeout 30s
ExecStop=fusermount -u /home/misteriks/acd
Restart=on-abort

[Install]

1 Like