# Help with systemd setup (permission issues?)

**URL:** <https://forum.rclone.org/t/help-with-systemd-setup-permission-issues/40997>\
**Category:** Help and Support\
**Created:** [August 16, 2023, 5:00am UTC](https://forum.rclone.org/t/help-with-systemd-setup-permission-issues/40997 "2023-08-16T05:00:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![monQuee](https://forum.rclone.org/user_avatar/forum.rclone.org/monquee/32/16009_2.png) [@monQuee](https://forum.rclone.org/u/monQuee)\
**Post date:** [August 16, 2023, 5:00am UTC](https://forum.rclone.org/t/help-with-systemd-setup-permission-issues/40997/1 "2023-08-16T05:00:09Z")

</div>

#### What is the problem you are having with rclone?

I am trying to setup systemd to run `rclone mount` after booting, but it is not working properly. The issues/symptoms are:

- After reboot, right clicking on my mount (=`/home/monQuee/rclone-GDrive`) tells me that it is a _binary_ instead of a directory. Checking permissions, I get _permissions could not be determined_. I cannot access the folder.
- Accessing the file through `sudo nautilus` produces the expected behavior: I can access the folder, and the expected files are there. Right clicking reveals that permissions are set for root.
- Similar issues with the log file and config file: they are displayed as binaries, with permissions only for root.

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

```auto
rclone v1.63.1
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 6.2.0-26-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.6
- go/linking: static
- go/tags: none

```

Are you on the latest version of rclone? You can validate by checking the version listed here: [Rclone downloads](https://rclone.org/downloads/)  
--\> Yes, as of Aug2023.

#### Which cloud storage system are you using?

Google Drive

#### The command you were trying to run.

My `/etc/systemd/system/rclone-GDrive.service` file is as follows:

```auto
[Unit]
Description=rclone-GDrive
AssertPathIsDirectory=/home/monQuee/rclone-GDrive
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone \
        --config=/home/monQuee/.config/rclone/rclone.conf \
        --vfs-cache-mode full \
	--vfs-cache-max-size 250G \
	--log-file=/home/monQuee/rclone-log \
	--log-level DEBUG mount GDrive: /home/monQuee/rclone-GDrive
ExecStop=/bin/fusermount -u /home/monQuee/rclone-GDrive
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

```

#### The rclone config contents with secrets removed.

```auto
[GDrive-test]
type = drive
client_id = XXXX
client_secret = XXXX
scope = drive
root_folder_id = XXXX
token = {"access_token":"XXXX","token_type":"Bearer","refresh_token":"XXXX","expiry":"XXXX"}
team_drive = 

```

(all XXXX are redacted)

#### A log from the command with the `-vv` flag

This log was obtained after rebooting, and then running `systemctl stop rclone-GDrive`.

```auto
2023/08/15 22:22:13 DEBUG : rclone: Version "v1.63.1" starting with parameters ["/usr/bin/rclone" "--config=/home/monQuee/.config/rclone/rclone.conf" "--vfs-cache-mode" "full" "--vfs-cache-max-size" "250G" "--log-file=/home/monQuee/rclone-log" "--log-level" "DEBUG" "mount" "GDrive:" "/home/monQuee/rclone-GDrive"]
2023/08/15 22:22:13 DEBUG : Creating backend with remote "GDrive:"
2023/08/15 22:22:13 DEBUG : Using config file from "/home/monQuee/.config/rclone/rclone.conf"
2023/08/15 22:22:14 DEBUG : Google drive root '': 'root_folder_id = 0ADTqzZHzAjaRUk9PVA' - save this in the config to speed up startup
2023/08/15 22:22:14 DEBUG : vfs cache: root is "/tmp/rclone"
2023/08/15 22:22:14 DEBUG : vfs cache: data root is "/tmp/rclone/vfs/GDrive"
2023/08/15 22:22:14 DEBUG : vfs cache: metadata root is "/tmp/rclone/vfsMeta/GDrive"
2023/08/15 22:22:14 DEBUG : Creating backend with remote "/tmp/rclone/vfs/GDrive/"
2023/08/15 22:22:14 DEBUG : fs cache: renaming cache item "/tmp/rclone/vfs/GDrive/" to be canonical "/tmp/rclone/vfs/GDrive"
2023/08/15 22:22:14 DEBUG : Creating backend with remote "/tmp/rclone/vfsMeta/GDrive/"

```

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [August 16, 2023, 5:42am UTC](https://forum.rclone.org/t/help-with-systemd-setup-permission-issues/40997/2 "2023-08-16T05:42:27Z")

</div>

add `--allow-other` flag to your mount command.

You run systemd as root so all permissions are set for it and only root can access this mount.

It is not really rclone issue but how linux works. You can also specify on behalf of which user run systemd service. All depends on your specific setup and requirements.

---

<div class="post-metadata">

**Author:** ![monQuee](https://forum.rclone.org/user_avatar/forum.rclone.org/monquee/32/16009_2.png) [@monQuee](https://forum.rclone.org/u/monQuee)\
**Post date:** [August 16, 2023, 6:20pm UTC](https://forum.rclone.org/t/help-with-systemd-setup-permission-issues/40997/3 "2023-08-16T18:20:09Z")

</div>

Awesome; thanks a lot. In case it helps someone else, let me mention that I was running into trouble using the syntax

```auto
--allow-other mount GDrive:...

```

and instead had to use

```auto
--allow-other=true mount GDrive:...

```

I think that, with the former, rclone thought that I was trying to assign the value `mount` to the variable `allow-other`, and then run the command `GDrive`, which does not exist.

---

<div class="post-metadata">

**Author:** ![monQuee](https://forum.rclone.org/user_avatar/forum.rclone.org/monquee/32/16009_2.png) [@monQuee](https://forum.rclone.org/u/monQuee)\
**Post date:** [August 17, 2023, 8:06pm UTC](https://forum.rclone.org/t/help-with-systemd-setup-permission-issues/40997/4 "2023-08-17T20:06:27Z")

</div>

This did end up giving me new headaches after a while. I have now settled for running mount through systemd as user. My `rclone-GDrive.system` file now looks like:

```auto
[Unit]
Description=rclone-GDrive
AssertPathIsDirectory=/home/monQuee/rclone-GDrive
Wants=network-online.target
After=network-online.target

[Service]
User=monQuee
Group=monQuee
Type=notify
ExecStart=/usr/bin/rclone \
        --config=/home/monQuee/.config/rclone/rclone.conf \
        --vfs-cache-mode full \
        --vfs-cache-max-size 250G mount GDrive: /home/monQuee/rclone-GDrive
ExecStop=/bin/fusermount -u /home/monQuee/rclone-GDrive
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [August 20, 2023, 8:06pm UTC](https://forum.rclone.org/t/help-with-systemd-setup-permission-issues/40997/5 "2023-08-20T20:06:39Z")

</div>

Closed on August 20, 2023, 8:06pm UTC

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