Pam_unix session error when starting service

What is the problem you are having with rclone?

I am having issues getting systemd to mount my Google Drive to /mnt/gmedia-cloud.

What is your rclone version (output from rclone version)

rclone v1.62.2

Which OS you are using and how many bits (eg Windows 7, 64 bit)

ubuntu 20.04

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

Google Drive

Below are the steps i follow to create a plex server within AWS Light Sail:

sudo apt update; sudo apt upgrade -y; sudo apt autoremove -y

cd ~
git clone GitHub - MonsterMuffin/rclone-gmedia: Configuration files for

curl rclone.org/install.sh | sudo bash

rclone config

n

gdrive-media

18 - google drive

enter

enter

1

enter

n

n

Check if equal to - rclone authorize "drive" "google drive id"

Reacted - key

n

y

q

touch test
rclone copy test gdrive-media:

check file exists in google drive

sudo mkdir /mnt/gmedia-cloud
sudo mkdir /opt/rclone/logs -p
sudo mkdir /opt/rclone/cache/gmedia -p
sudo apt install fuse -y

cd ~/rclone-gmedia/services/
nano gmedia.service


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

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount
--config=/home/ubuntu/.config/rclone/rclone.conf
--log-level=INFO
--log-file=/opt/rclone/logs/rclone-mount.log
--user-agent=pengsoo=
--umask=002
--gid=1002
--uid=1000
--allow-other
--timeout=1h
--poll-interval=15s
--dir-cache-time=1000h
--cache-dir=/opt/rclone/cache/gmedia
--vfs-cache-mode=full
--vfs-cache-max-size=5
--vfs-cache-max-age=10h
gdrive-media: /mnt/gmedia-cloud
ExecStop=/bin/fusermount -uz /mnt/gmedia-cloud
Restart=on-abort
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target


cd ~/rclone-gmedia/services/
sudo cp gmedia.service /etc/systemd/system
sudo systemctl enable gmedia.service
sudo systemctl start gmedia.service

sudo systemctl status gmedia.service

cd

sudo apt install mergerfs

sudo mkdir /mnt/gmedia
sudo mkdir /mnt/gmedia-local

cd ~/rclone-gmedia/services/
sed -i 's,,/mnt/gmedia-local,g' *
sed -i 's,,/mnt/gmedia,g' *

cd ~/rclone-gmedia/services/
sudo cp gmedia-mergerfs.service /etc/systemd/system
sudo systemctl enable gmedia-mergerfs.service
sudo systemctl start gmedia-mergerfs.service

download plex and install plex media server
sudo systemctl start plexmediaserver

sudo systemctl enable plexmediaserver

sudo systemctl status plexmediaserver

When i get to the below steps

cd ~/rclone-gmedia/services/
sudo cp gmedia.service /etc/systemd/system
sudo systemctl enable gmedia.service
sudo systemctl start gmedia.service

I get the below error:

ubuntu@ip-172-26-13-246:~/rclone-gmedia/services$ journalctl -xe
-- The job identifier is 14462 and the job result is failed.
Apr 25 22:53:49 ip-172-26-13-246 sudo[42971]: ubuntu : TTY=pts/0 ; PWD=/home/ubuntu/rclone-gmedia/services ; USER=root ; COMMAND=/usr/bin/cp gmedia.service /etc/systemd/system
Apr 25 22:53:49 ip-172-26-13-246 sudo[42971]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
Apr 25 22:53:49 ip-172-26-13-246 sudo[42971]: pam_unix(sudo:session): session closed for user root
Apr 25 22:53:57 ip-172-26-13-246 systemd-networkd[21965]: eth0: DHCPv6 address 2406:da1c:54b:e300:520d:4fba:b813:51ed/128 timeout preferred 140 valid 450
Apr 25 22:55:07 ip-172-26-13-246 systemd-networkd[21965]: eth0: DHCPv6 address 2406:da1c:54b:e300:520d:4fba:b813:51ed/128 timeout preferred 140 valid 450
Apr 25 22:56:17 ip-172-26-13-246 systemd-networkd[21965]: eth0: DHCPv6 address 2406:da1c:54b:e300:520d:4fba:b813:51ed/128 timeout preferred 140 valid 450
Apr 25 22:57:27 ip-172-26-13-246 systemd-networkd[21965]: eth0: DHCPv6 address 2406:da1c:54b:e300:520d:4fba:b813:51ed/128 timeout preferred 140 valid 450
Apr 25 22:57:50 ip-172-26-13-246 sudo[42977]: ubuntu : TTY=pts/0 ; PWD=/home/ubuntu/rclone-gmedia/services ; USER=root ; COMMAND=/usr/bin/cp gmedia.service /etc/systemd/system
Apr 25 22:57:50 ip-172-26-13-246 sudo[42977]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
Apr 25 22:57:50 ip-172-26-13-246 sudo[42977]: pam_unix(sudo:session): session closed for user root
Apr 25 22:57:53 ip-172-26-13-246 sudo[42979]: ubuntu : TTY=pts/0 ; PWD=/home/ubuntu/rclone-gmedia/services ; USER=root ; COMMAND=/usr/bin/systemctl enable gmedia.service
Apr 25 22:57:53 ip-172-26-13-246 sudo[42979]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
Apr 25 22:57:53 ip-172-26-13-246 systemd[1]: Reloading.
Apr 25 22:57:54 ip-172-26-13-246 sudo[42979]: pam_unix(sudo:session): session closed for user root
Apr 25 22:57:56 ip-172-26-13-246 sudo[43009]: ubuntu : TTY=pts/0 ; PWD=/home/ubuntu/rclone-gmedia/services ; USER=root ; COMMAND=/usr/bin/systemctl start gmedia.service
Apr 25 22:57:56 ip-172-26-13-246 sudo[43009]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
Apr 25 22:57:56 ip-172-26-13-246 systemd[1]: Starting Gmedia RClone Mount Service...

Ive tried chown and chmod the below directorys:

sudo mkdir /mnt/gmedia-cloud
sudo mkdir /opt/rclone/logs -p
sudo mkdir /opt/rclone/cache/gmedia -p
sudo apt install fuse -y

this is the output from using "chown -R ubuntu /mnt/gmedia-cloud" and "chmod 755" to

ubuntu@ip-172-26-4-213:~/rclone-gmedia/services$ cd /mnt/gmedia-cloud
ubuntu@ip-172-26-4-213:/mnt/gmedia-cloud$ ls -la
total 8
drwxr-xr-x 2 ubuntu root 4096 Apr 25 23:22 .
drwxr-xr-x 3 root root 4096 Apr 25 23:22 ..

However, it doesnt seem to resolve the above error. I usually create the instance when we go camping or trips so we can watch it in the car on breaks, it worked the last time i created it which was in Feburary. So im not sure why the sudden change.

Any assitance would be helpful?

What does it say in the rclone log?

2023/04/26 23:04:05 Fatal error: failed to mount FUSE fs: fusermount: exec: "fusermount3": executable file not found in $PATH

https://forum.rclone.org/t/synoloy-nas-does-not-support-fuse3/36944/9

found another forum with the solution to install "fuse3" thanks for the help

Solution:
"sudo apt install fuse3"

1 Like

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