Setting Syncthing to autostart

Hi,
I’m following this guide to set up SyncThing. I’m stuck at adding it to systemd, specifically with this line: podman generate systemd -f -n syncthing-toolbox I get bash: podman command not found.
Do I have to install podman? I think I already have it?

EDIT:
Somehow it was a temporary problem?? I just tested:

❯ podman ps -a
CONTAINER ID  IMAGE                                         COMMAND               CREATED       STATUS         PORTS       NAMES
f8dc4727d8e6  quay.io/fedora/fedora:40                      --verbose --name ...  22 hours ago  Up 38 seconds              SuperGoed
9243a6664fb5  registry.fedoraproject.org/fedora-toolbox:40  toolbox --log-lev...  8 hours ago   Up 3 hours                 syncthing-toolbox

So podman was recognised. I tried again:

❯ podman generate systemd -f -n syncthing-toolbox

DEPRECATED command:
It is recommended to use Quadlets for running containers and pods under systemd.

Please refer to podman-systemd.unit(5) for details.
/var/home/jonathan/container-syncthing-toolbox.service

I solved this by making a syncthing.desktop file with content

[Desktop Entry]
Name=SyncThing
Comment=Continuous file synchronization program
Exec=toolbox run --container syncthing-toolbox syncthing
Type=Application

and putting that in /.config/autostart.

Odd that podman wasn’t detected. Possibly a bad PATH read, not enough info to really tell.

As for the other “error”, basically what was happening is the old podman generate systemd used to create a raw systemd-unit file that could be used. This command has been depreciated preferring the use of something called Quadlet files. These Quadlet files are basically configuration files that are used by systemd generator to create the systemd-unit files at boot making things a bit more flexible and less complicated to create. If you wanted to go this route you’d create a Quadlet file and place it in /etc/containers/systemd/users/, run systemctl daemon-reload, then enable to service with systemctl --user commands.

If you are interested in learning how to create Quadlet files, podman-systemd.unit(5) has all the information you’d need. However, I’d recommend reading some blog posts to see some real world working examples while referencing the man page to see what each setting actually does.

Thank you @lethedata ,
Is my solution not as good as using Quadlets?
I will look into Quadlets sooner or later :slight_smile:

I wouldn’t say one solution is better than the other in this case. If it works it works you know? It’s up to you on how you want to do it. Like I use a flatpak to run syncthing at the moment because it was available and worked. I was just sharing some information on what was going on and why it wasn’t working for ya

1 Like