Can't Get my Dropbox service mount to work

What is the problem you are having with rclone?

Hello. I cant seem to get my my dropbox mount service to work on boot

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

Here is the rclone output information:
rclone v1.61.1

  • 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.19.4
  • go/linking: static
  • go/tags: none

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

I am using drop box advanced business plan

I have been trying to get my service working so dropbox connects on startup. when I followed a template I found online it always gives back this error "Job for opencrypt.service failed because the control process exited with error code."

Below is my code could someone please tell me if they see something wrong. Thank you.

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

[Service]
Type=notify
Environment=RCLONE_CONFIG=/opt/rclone/rclone.conf
RestartSec=5

for execstart the folder (opencrypt) I want to mount to is located in the home section so i thought I would need to use home and then the user as the path. Is this incorrect?

ExecStart=/usr/bin/rclone mount crypt: /home/tex/opencrypt \

This is for allowing users other than the user running rclone access to the mount

--allow-other \

Dropbox is a polling remote so this value can be set very high and any changes are detected via polling.

--dir-cache-time 9999h \

This is setting the file permission on the mount to user and group have the same access and other can read

--umask 002 \

The local disk used for caching

--cache-dir=/cache/opencrypt \

This is used for caching files to local disk for streaming

--vfs-cache-mode full \

This limits the cache size to the value below

--vfs-cache-max-size 160G \

Speed up the reading: Use fast (less accurate) fingerprints for change detection

--vfs-fast-fingerprint \

Set chunk size

--vfs-read-chunk-size 32M \

This limits the age in the cache if the size is reached and it removes the oldest files first

--vfs-cache-max-age 1h \

Disable HTTP2

--disable-http2
--transfers 2
ExecStop=/bin/fusermount -uz /home/titan/opencrypt
Restart=on-failure
User=tex
Group=tex

[Install]
WantedBy=multi-user.target

You'd want to post the actual error in the rclone log.

For the service file, you'd want to include with three backtics before and at the end

Like three of these -> `

example

to show the exact file you are using.

Thank you for your reply. I think I've done what was requested below:

Here is the file itself:

Description=RClone Service Dropbox instantup
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
Environment=RCLONE_CONFIG=/opt/rclone/rclone.conf
RestartSec=5
ExecStart=/usr/bin/rclone mount crypt: /home/titan/opencrypt \
	--allow-other \
	--dir-cache-time 9999h \
	--umask 002 \
	--cache-dir=/cache/opencrypt \
	--vfs-cache-mode full \
	--vfs-cache-max-size 160G \
	--vfs-fast-fingerprint \
	--vfs-read-chunk-size 32M \
	--vfs-cache-max-age 1h \
	--disable-http2 \
	--transfers 2
ExecStop=/bin/fusermount -uz /home/titan/opencrypt
Restart=on-failure
User=titan
Group=titan

[Install]
WantedBy=multi-user.target ```

the exact error is "Job for fullcache.service failed because the control process exited with error code. See "systemctl status fullcache.service". 

the error output is below

● fullcache.service - RClone Service Dropbox instantup
Loaded: loaded (/etc/systemd/system/fullcache.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2023-03-26 00:43:17 UTC; 1s ago
Process: 34273 ExecStart=/usr/bin/rclone mount crypt: /home/titan/instantup --allow-other --dir-cache-time 9999h --umask 002 --cache-dir=/cache/opencrypt --vfs-cache-mode full --vfs-cache-max-size 160G --vfs-fast-fingerprint --vfs-read-chunk-size 32M --vfs-cache-max-age 1h --disable-http2 --transfers 2 (code=exited, status=1/FAILURE)
Main PID: 34273 (code=exited, status=1/FAILURE)
CPU: 34ms
~


Is there anything else I can provide?

I'd imagine it's because you are running as root and perhaps you configured as a normal user.

You'd want to addd --log-file /some/log/rclone.log -vv so you get a rclone log to look at.

Thank you again for the reply.

Below is the service code again. I ran it as the user account instead of root and still received the same error.

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

[Service]
Type=notify
Environment=RCLONE_CONFIG=/opt/rclone/rclone.conf
RestartSec=5
ExecStart=/usr/bin/rclone mount crypt: /home/titan/instantup \
	--allow-other \
	--dir-cache-time 9999h \
	--umask 002 \
	--cache-dir=/cache/instantup \
	--vfs-cache-mode full \
	--vfs-cache-max-size 160G \
	--vfs-fast-fingerprint \
	--vfs-read-chunk-size 32M \
	--vfs-cache-max-age 1h \
	--log-file /home/titan/logs/rclone.log \
	--disable-http2 \
	--transfers 2
ExecStop=/bin/fusermount -uz /home/titan/instantup
Restart=on-failure
User=titan
Group=titan

[Install]
WantedBy=multi-user.target

Here is the error information. I also do not see a log created in the folder that I pointed it to from the code


● fullcache.service - RClone Service Dropbox instantup
     Loaded: loaded (/etc/systemd/system/fullcache.service; enabled; vendor preset: enabled)
     Active: activating (start) since Sun 2023-03-26 02:19:39 UTC; 3ms ago
   Main PID: 48658 ((rclone))
      Tasks: 1 (limit: 19011)
     Memory: 384.0K
        CPU: 1ms
     CGroup: /system.slice/fullcache.service
             └─48658 /usr/bin/rclone mount crypt: /home/titan/instantup --allow-other --dir-cache-time 9999h --umask 002 --cache-dir=/cache/instantup --vfs-cache-mode full --vfs-cache-max-size 160G --vfs-fast-fingerprint --vfs-read-chunk-size 32M --vfs-cache-max-age 1h --log-file /home/titan/logs/rclone.log --disable-http2 --transfers 2

Mar 26 02:19:39 server rclone[48658]: 2023/03/26 02:19:39 Failed to open log file: open /home/titan/logs/rclone.log: permission denied
~
~
~



You want to create the logs directory as the log file is what we want to look at.

I'm sorry since this is a simple question. How do I make the logs directly? I thought by having them sent to a folder they would be created in a text file. When you say directly do you mean there is a way to have to log read out within the terminal window?

Looks like you specific a path that does not exist.

ls -al /home/titan/logs
mkdir /home/titan/logs

The permission was incorrect for the folder so now I can see logs. This is what the log contained

2023/03/26 19:39:28 Failed to read line: EOF
2023/03/26 19:39:33 Failed to read line: EOF
2023/03/26 19:39:38 Failed to read line: EOF
2023/03/26 19:39:44 Failed to read line: EOF
2023/03/26 19:39:49 Failed to read line: EOF
2023/03/26 19:39:54 Failed to read line: EOF
2023/03/26 19:39:59 Failed to read line: EOF
2023/03/26 19:40:05 Failed to read line: EOF
2023/03/26 19:40:10 Failed to read line: EOF
2023/03/26 19:40:15 Failed to read line: EOF
2023/03/26 19:40:20 Failed to read line: EOF
2023/03/26 19:40:26 Failed to read line: EOF
2023/03/26 19:40:31 Failed to read line: EOF
2023/03/26 19:40:36 Failed to read line: EOF
2023/03/26 19:40:41 Failed to read line: EOF
2023/03/26 19:40:47 Failed to read line: EOF
2023/03/26 19:40:52 Failed to read line: EOF
2023/03/26 19:40:57 Failed to read line: EOF
2023/03/26 19:41:02 Failed to read line: EOF
2023/03/26 19:41:08 Failed to read line: EOF
2023/03/26 19:41:13 Failed to read line: EOF
2023/03/26 19:41:18 Failed to read line: EOF
2023/03/26 19:41:23 Failed to read line: EOF
2023/03/26 19:41:29 Failed to read line: EOF
2023/03/26 19:41:34 Failed to read line: EOF
2023/03/26 19:41:39 Failed to read line: EOF
2023/03/26 19:41:44 Failed to read line: EOF
2023/03/26 19:41:50 Failed to read line: EOF
2023/03/26 19:41:55 Failed to read line: EOF
2023/03/26 19:42:00 Failed to read line: EOF
2023/03/26 19:42:05 Failed to read line: EOF
2023/03/26 19:42:10 Failed to read line: EOF
2023/03/26 19:42:16 Failed to read line: EOF

That's definitely not a rclone log unfortunately.

I think this is rclone continually being restarted. That log is in rclone and what it means is that rclone tried to read a password from standard input but couldn't then exited.

So I'd guess you have an encrypted config file.

You'll need to decrypt it or provide rclone the password. You can do this in the env var RCLONE_CONFIG_PASS (there are other ways if you check the docs).

Sir thank you. You are correct my rclone config is encrypted since it will be storing things on a cloud service and I wanted an extra layer of protection. I did not realize that the service script wouldn't be able to read the file. You said I could pass the password in env var. I am very new to linux and when I am in the computer section of linux I do not see env. I do see etc, var and other folders. What path is the location? If I'm missing it my apologies for the stupid question. I know you could probably put it into the service file itself but im unsure if thats much safer than just having it unencrypted

You've set one environment var here. You can set another with the password, eg

[Service]
Type=notify
Environment=RCLONE_CONFIG=/opt/rclone/rclone.conf
Environment=RCLONE_CONFIG_PASS=MyPassword
RestartSec=5

As for whether this is safer than having it unencrypted? Probably I'd say. The password is separate from the encrypted file.

Its quite dificult to make it perfectly safe - you'd have to run an agent to store the password for you. People have done this with gpg agent and ssh agent but that is much more complicated and well outside beginner territory!

Understood so you the current option is to place it into the actual service file. Thank you for the clarification. I was able to get my script work after adding the RCLONE_CONFIG_Pass field to the script. I appreciate your support in resolving my issue.

1 Like

Thank you for attempting to help solve my issue. I appreciate your time and efforts.

1 Like

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