RClone is a software that allows us to access the content of GDrive as if it were a local directory. It works very well and is very useful to have, but in the latest version of FreeBSD-RELEASE Production, version 13.1, some changes have been made to the FUSE file system, causing RClone to break.
NOTE: In version 1.58.1_3, it is no longer necessary to compile RClone or use the cmount option. Simply installing the binary package works correctly.
But by following these steps, we can get it working again until an official version with the fix is released or the problem with FUSE is resolved.
Now we run RClone from the new path:
/root/go/bin/rclone cmount gdrive: /mnt/gdrive –allow-other –config /root/.config/rclone/rclone.conf
My RC script would look like this:
vi /usr/local/etc/rc.d/rclone
#! /bin/sh
#
# $FreeBSD$
#
# PROVIDE: rclone
# REQUIRE: DAEMON
# KEYWORD: shutdown
. /etc/rc.subr
name="rclone"
rcvar="${name}_enable"
extra_commands="status"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
status_cmd="${name}_status"
rclone_start(){
echo "Starting service: ${name}"
#/usr/sbin/daemon -S -p /var/run/${name}.pid -T rclone -u root /usr/local/bin/rclone mount gdrive: /mnt/gdrive --allow-other --config /root/.config/rclone/rclone.conf
/usr/sbin/daemon -S -p /var/run/${name}.pid -T rclone -u root /root/go/bin/rclone cmount gdrive: /mnt/gdrive --allow-other --config /root/.config/rclone/rclone.conf
}
rclone_stop(){
if [ -f /var/run/${name}.pid ]; then
echo "Stopping service: ${name}"
kill -s INT $(cat /var/run/${name}.pid)
sleep 3
else
echo "It appears ${name} is not running."
fi
}
rclone_status(){
if [ -f /var/run/${name}.pid ]; then
echo "${name} running with PID: $(cat /var/run/${name}.pid)"
else
echo "It appears ${name} is not running."
fi
}
load_rc_config ${name}
run_rc_command "$1"