Rclone auto mount

Hi… Im having a problem with my auto mount.

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

[Service]
Type=notify
ExecStart=/usr/sbin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/plex
ExecStop=/bin/fusermount -uz /home/plex
Restart=on-abort

[Install]

WantedBy=default.target

The error message In systemctl status rclonemount.service

● rclonemount.service - RClone Service
Loaded: loaded (/etc/systemd/system/rclonemount.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2018-08-02 23:18:44 CEST; 2min 48s ago
Process: 31233 ExecStop=/bin/fusermount -uz /home/plex (code=exited, status=1/FAILURE)
Process: 31231 ExecStart=/usr/sbin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt:
Main PID: 31231 (code=exited, status=203/EXEC)

Aug 02 23:18:44 Krider82.dk systemd[1]: Starting RClone Service…
Aug 02 23:18:44 Krider82.dk systemd[1]: rclonemount.service: Main process exited, code=exited, status=203/EXEC
Aug 02 23:18:44 Krider82.dk fusermount[31233]: /bin/fusermount: failed to unmount /home/plex: Invalid argument
Aug 02 23:18:44 Krider82.dk systemd[1]: rclonemount.service: Control process exited, code=exited status=1
Aug 02 23:18:44 Krider82.dk systemd[1]: Failed to start RClone Service.
Aug 02 23:18:44 Krider82.dk systemd[1]: rclonemount.service: Unit entered failed state.
Aug 02 23:18:44 Krider82.dk systemd[1]: rclonemount.service: Failed with result ‘exit-code’.

I just a noob so I can’t se whats wrong…Sorry for my bad English…

What user are you trying to run it as?

If you run just the command line by itself does it work?

/usr/sbin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/plex

Yes I works by itself… how do I run it as a user…

The user you are trying to run it as is?

You can type ‘whoami’

and can you share the output of when you enter the full command in?

it says root. but when I log in by terminal I use another username

Can you share the output of when you run it as root?

I think Im losing it in translation. do you want med to log out and then log in as root??
if not can you dumb it down for me. Has only been using ssh and terminal for 10 days…

If you login to your machine as whatever user you want to use, enter the mount command to validate it works so specifically type in:

/usr/sbin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/plex

Copy and paste into here the entire output of that command like this:

felix@gemini:~$ /usr/sbin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/plex
-bash: /usr/sbin/rclone: No such file or directory

For me the command doesn’t work because rclone is normally installed into /usr/bin/rclone which is why I’d like to replicate the commands exactly and see the output.

found the I don’t have a s in sbin

updated my script and I try running the script again…

Krider82:/etc/systemd/system# sudo systemctl start rclonemount.service
Job for rclonemount.service failed because the control process exited with error code. See “systemctl status rclonemount.service” and “journalctl -xe” for details.
Krider82:/etc/systemd/system#

Instead of running the script, can you please type in the exact command you are running and include the output printed to the screen.

Krider82:/etc/systemd/system# rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/plex
just blank screen from that on.

and now the drive is accessible.

Is that same window can you please type:

felix@gemini:~$ which rclone
/usr/bin/rclone
felix@gemini:~$ rclone config file
Configuration file is stored at:
/home/felix/.rclone.conf

And share the full output?

Krider82:/etc/systemd/system# which rclone
rclone is /usr/bin/rclone
rclone is /usr/bin/rclone
Krider82:/etc/systemd/system# rclone config file
Configuration file is stored at:
/root/.config/rclone/rclone.conf

Here it is… I am really appreciating you helping me

Cool. So you are running as the user ‘root’.

Your systemd file should be almost identical to what you had, but make sure the sbin changes to bin so:

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

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/plex
ExecStop=/bin/fusermount -uz /home/plex
Restart=on-abort
User=
Group=

[Install]

WantedBy=default.target

Once you save the file, you need to basically load that into the system by doing:

systemctl daemon-reload

That won’t generate any output.

Next you can run:

systemctl start rclonemount

and check with

systemctl status rclonemount

You should only have 1 rclone process running so if it fails, it might be due to having multiple items going.

You can validate by:

ps -ef | grep rclone

and should see just 1 running. If there are more you can:

pkill rclone

and validate by the ps -ef command above to ensure nothing is running.

now it says
Krider82:/etc/systemd/system# ps -ef | grep rclone
root 25174 17838 0 01:53 pts/5 00:00:00 grep rclone
Krider82:/etc/systemd/system# systemctl start rclonemount
Job for rclonemount.service failed because the control process exited with error code. See “systemctl status rclonemount.service” and “journalctl -xe” for details.
Krider82:/etc/systemd/system#

Rclone is also uploading from my Mac… Is that why I failing.

Can you run either:

systemctl status rclonemount.service

or

journalctl -xe

and share the output?

its also running on my Mac… can that be why is failing…

but here is the answer back.
● rclonemount.service - RClone Service
Loaded: loaded (/etc/systemd/system/rclonemount.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-08-03 01:53:05 CEST; 2min 34s ago
Process: 25541 ExecStop=/bin/fusermount -uz /home/plex (code=exited, status=1/FAILURE)
Process: 25528 ExecStart=/usr/bin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/ple
Main PID: 25528 (code=exited, status=1/FAILURE)

Aug 03 01:53:05 Krider82.dk rclone[25528]: 2018/08/03 01:53:05 ERROR : Use --config flag to workaround.
Aug 03 01:53:05 Krider82.dk rclone[25528]: 2018/08/03 01:53:05 ERROR : Error was: user: Current not implemented on linux/amd64
Aug 03 01:53:05 Krider82.dk rclone[25528]: 2018/08/03 01:53:05 NOTICE: Config file “/.rclone.conf” not found - using defaults
Aug 03 01:53:05 Krider82.dk rclone[25528]: 2018/08/03 01:53:05 Failed to create file system for “Googlecrypt:”: didn’t find section in config file
Aug 03 01:53:05 Krider82.dk systemd[1]: rclonemount.service: Main process exited, code=exited, status=1/FAILURE
Aug 03 01:53:05 Krider82.dk fusermount[25541]: /bin/fusermount: failed to unmount /home/plex: Invalid argument
Aug 03 01:53:05 Krider82.dk systemd[1]: rclonemount.service: Control process exited, code=exited status=1
Aug 03 01:53:05 Krider82.dk systemd[1]: Failed to start RClone Service.
Aug 03 01:53:05 Krider82.dk systemd[1]: rclonemount.service: Unit entered failed state.
Aug 03 01:53:05 Krider82.dk systemd[1]: rclonemount.service: Failed with result ‘exit-code’.

You have a typo as the ‘x’ on the end of plex is missing.

my terminal window was not big enough.
here we go again.

● rclonemount.service - RClone Service
Loaded: loaded (/etc/systemd/system/rclonemount.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-08-03 02:01:35 CEST; 7s ago
Process: 2506 ExecStop=/bin/fusermount -uz /home/plex (code=exited, status=1/FAILURE)
Process: 2495 ExecStart=/usr/bin/rclone mount --allow-other --dir-cache-time 48h --vfs-read-chunk-size 16M --buffer-size 2G Googlecrypt: /home/plex (code=exited, status=1/FAILURE)
Main PID: 2495 (code=exited, status=1/FAILURE)

Aug 03 02:01:35 Krider82.dk rclone[2495]: 2018/08/03 02:01:35 ERROR : Use --config flag to workaround.
Aug 03 02:01:35 Krider82.dk rclone[2495]: 2018/08/03 02:01:35 ERROR : Error was: user: Current not implemented on linux/amd64
Aug 03 02:01:35 Krider82.dk rclone[2495]: 2018/08/03 02:01:35 NOTICE: Config file “/.rclone.conf” not found - using defaults
Aug 03 02:01:35 Krider82.dk rclone[2495]: 2018/08/03 02:01:35 Failed to create file system for “Googlecrypt:”: didn’t find section in config file
Aug 03 02:01:35 Krider82.dk systemd[1]: rclonemount.service: Main process exited, code=exited, status=1/FAILURE
Aug 03 02:01:35 Krider82.dk fusermount[2506]: /bin/fusermount: failed to unmount /home/plex: Invalid argument
Aug 03 02:01:35 Krider82.dk systemd[1]: rclonemount.service: Control process exited, code=exited status=1
Aug 03 02:01:35 Krider82.dk systemd[1]: Failed to start RClone Service.
Aug 03 02:01:35 Krider82.dk systemd[1]: rclonemount.service: Unit entered failed state.
Aug 03 02:01:35 Krider82.dk systemd[1]: rclonemount.service: Failed with result ‘exit-code’.

So don’t paste in any passwords or keys or anything, but this shows output?

rclone config file

and if you type

rclone config show

This produces output from the file?

You can also try to add this to your mount line:

–config /root/.config/rclone/rclone.conf