And it will autostart on startup. You might want to remove what insync puts in /etc/xdg/autostart or whatever it uses to autostart. I wish Insync adapted it itself, systemd is meant for this.
Yes, that is indeed better. I previously had oneshot where RemainAfterExit might have made sense, but I changed it to forking because it would not restart on failure, I just forgot to remove that line. I am changing it in the original post for people who do not read the comments, thanks for the suggestion!
Actually, now that I tried it, systemctl restart and systemctl start does not work without RemainAfterExit=yes. From what I can find, Insync is not forking itself properly, so systemd files to track it well. Systemd would like a PID file, but that is also not provided, as far as I can tell. But it seemed to me the restarting after a crash worked, I will keep an eye on it.
After I posted this I did start having one or two issues with this so ended up changing it as below. This has ran for 2+ weeks without any problems now.
I’m late to this thread, but wanted to thank you both for posting this. The default autostart service crashes on startup and after hibernation for me on openSUSE Slowroll, but it runs perfectly otherwise. I replaced autostart with this systemd unit and it’s working nicely to keep it running.
Specifically using the systemd unit @Klz posted here.