Rclone Mount Service not working?


#1

Here is the start up script that I have enabled… I’m wondering why it isn’t working…

# Rclone mount on boot ( service file template - add aditional rclone parameter$
# Copy file to: /etc/systemd/system
# Set remote name (current acdcrypt), path to mount and User,Group (current ple$
# Register new service by typing:
# sudo systemctl daemon-reload
# sudo systemctl enable rclone-mount.service
# systemctl start rclone-mount.service
# systemctl enable NetworkManager-wait-online.service
# Usage:
# To unmount drive use
# systemctl stop rclone-mount.service
# To mount use:
# systemctl start rclone-mount.service

[Unit]
Description=rclone FTP FUSE mount
Documentation=http://rclone.org/docs/
After=systemd-networkd-wait-online.service
Requires=systemd-networkd-wait-online.service

[Service]
Type=simple
User=zcleaver
Group=zcleaver
ExecStart=/usr/bin/rclone mount oldseed:files/sync /opt/drive1/sync
ExecStop=/usr/bin/fusermount -uz /path/

[Install]
Wants=network-online.target

my manual command works-
rclone mount oldseed:files/sync /opt/drive1/sync

as well as starting the service once i’m SSH’d in.


#3

What’s the error message you get when you run the service?

systemctl status rclone-mount.service


#4

No error at all, but i currently have it running because I started it when it didn’t work on boot.


#5

Did you enable it at boot?

systemctl enable rclone-mount.service


#6

Yes - I have it enabled at boot via the
systemctl enable rclone-mount.service
command.

I will reboot and report error if there is one given! :slight_smile:


#7
● rclone-mount.service - rclone FTP FUSE mount
   Loaded: loaded (/etc/systemd/system/rclone-mount.service; static; vendor pres
   Active: inactive (dead)
     Docs: http://rclone.org/docs/

On reboot after calling the status-

What’s this mean?


#8

I’d think it’s because your conditions are wrong:

After=systemd-networkd-wait-online.service
Requires=systemd-networkd-wait-online.service

Should probably be:

After=networkd-wait-online.service
Requires=networkd-wait-online.service

Assuming you have already enabled that as well.

systemctl enable networkd-wait-online.service

#9

I get this error on trying to enable that service…
Failed to enable unit: Unit file networkd-wait-online.service does not exist.


#10

So you’d have to remove those lines from your systemd file.


#11

What do you mean?

I need it to wait until the network is online before it tries to connect.


#12

I mean delete these two lines from your file:

After=systemd-networkd-wait-online.service
Requires=systemd-networkd-wait-online.service

if you don’t have the service installed.


#13

How do I enable the service? I need it to be online to run my rclone mount.


#14

What operating system are you using?


#15

Ubuntu server 18 :slight_smile: <3


#16

And what is the exact output when you type as root:

systemctl enable systemd-networkd-wait-online.service

#17

no output… seems to work…?


#18

I don’t know as you aren’t sharing the full command/output.

root@gemini:~ systemctl enable systemd-networkd-wait-online.service
Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /lib/systemd/system/systemd-networkd-wait-online.service.
root@gemini:~

#19

Here is the output, unless im reading this wrong?
root@ubuntu:~# systemctl enable systemd-networkd-wait-online.service
root@ubuntu:~#


#20

Thanks, to validate as I’m sure it’s enabled, but you can test real quick with disabling and re-enabling it:

 systemctl disable systemd-networkd-wait-online.service
 systemctl enable systemd-networkd-wait-online.service

#21
root@ubuntu:~# systemctl enable systemd-networkd-wait-online.service
Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service → /lib/systemd/system/systemd-networkd-wait-online.service.
root@ubuntu:~# 

running a reboot right now.