Score:0

root doesn't see a FUSE mounted directory

cn flag

I have a service on my debian machine that mounts google drive to directory /home/myuser/gdrive:

[Unit]
Description=FUSE filesystem over Google Drive
After=network.target

[Service]
User=myuser
Group=myuser
ExecStart=google-drive-ocamlfuse /home/myuser/gdrive
ExecStop=fusermount -u /home/myuser/gdrive
Restart=always
Type=forking

[Install]
WantedBy=multi-user.target

I also have a cron job that copies a directory from one folder to gdrive. The problem is that root user for some reason doesn't see gdrive directory.

sudo ls -la /home/myuser/
ls: cannot access '/home/myuser/gdrive': Permission denied
total 1700
...
d?????????  ? ?    ?          ?            ? gdrive
...
ls -la ~/
total 1704
...
drwxr-xr-x  2 myuser  myuser     4096 Aug  2 09:24 gdrive
Score:1
vn flag

I believe that network mounts are usually per-user, as each user may have access to different shares. Since you've set the mount process to run as myuser, that mount is probably only available to myuser. Have you considered running your cron job in the myuser context?

vidarlo avatar
ar flag
Not network file systems - it's [fuse specific](https://en.wikipedia.org/wiki/Filesystem_in_Userspace)
tsc_chazz avatar
vn flag
Noted. Thanks for the clarification.
Score:1
ar flag

Fuse mounts are per user.

Fuse has a mount flag, allow_other that allows other users access to a fuse mounted filesystem.

Simply add -o allow_other to the mount command, so that it becomes

google-drive-ocamlfuse -o allow_other /home/myuser/gdrive

It's also possible to set it in /etc/fuse.conf.

Viktor avatar
cn flag
It worked, thanks. I had to set ```user_allow_other``` in ```/etc/fuse.conf``` and then ```-o allow_other``` worked.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.