Auto serve ftp on reboot in rclone

I have established a serve FTP connection with Google Drive with the following command in rclone:

rclone serve ftp hello-drive:/ --user new --pass new

but after the system reboots, I have to run that command again. That's why I wrote this file to re-run serve FTP in this directory /etc/systemd/system/gdrive.service:

Description=rclone for hello-drive

ExecStart=rclone serve ftp --config=/home/root/.config/rclone/rclone.conf hello-drive:/ --user new --pass new

ExecStop=/bin/fusermount -u /


I can enable it, but when I try to start it with this command

systemctl start gdrive.service

I got this error:

Failed to start gdrive.service: Unit gdrive.service is not loaded properly: Exec format error.

hello and welcome to the forum,

ExecStop=/bin/fusermount -u /
perhaps the issue is the trailing slash, perhaps remove that.

if not, we have systemd experts and one should stop by soon.

here in the forum, this is a goto example for a systemd service.

You don't want this for rclone serve ftp - just remove the line.

This usually means that the thing you are trying to run (rclone) is not executable, or maybe not found - try putting in a full path in, or you downloaded the wrong type of binary (amd64 for an arm64 machine).

Thanks sir
I was cleaned that line, but issue not resolved. Can you look at gdrive.service file again. I think the gdrive.service file is wrong. Or do you have any ideas about this issue?

Thanks my friend
That systemd service is written about mounting on rclone, can you write it for serve ftp?

well, not an expert at linux and systemd; i do not know why your service file is not working.
we do have experts and hopefully one will stop by soon.

in the mean time, in the past, i have taken that service file i shared and got it working for my use-case.

so i would try a very simple service file, get that working and then tweak from there.

  1. remove ExecStop
  2. remove ExecStartPost
  3. change ExecStart to /usr/bin/rclone version
  4. change this as needed

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