in ubuntu 18.04 i’m tryng to setup a systemd job for duplicacy. If I start duplicacy web edition via command line it starts and accept connections on 0.0.0.0:8080, if I make it starting from systemctl start duplicacy.service, pointing on same executable it starts but on 127.0.0.1:3875.
Is $HOME set correctly (and readable)? Services don’t have home so it has no idea where to look for config folder.
Yes, it was a $HOME mistake, ( $HOME referred to execution of program )
I didn’t remember where i found instructions first time but,
to set it up as a service in ubuntu you have to :
chmod +x duplicacy_web_linux_etc
start it first time so it creates .duplicacy_web folder
move .duplicacy_web folder in /
add settings.json in .duplicacy_web folder with following content
create a systemd service configuration file :
nano /etc/systemd/system/duplicacy.service with following content
Description=Duplicacy backup software`
close and save file
sudo systemctl enable duplicacy.service
sudo systemctl start duplicacy.service
I would not put it to /. Often root is a small mounted partition, often even readonly, and duplicacy keeps logs and intermediate cache there that can get huge; it may not end well. Instead, put .duplciacy_web to a volume you know will have a lot of space, e.g. into user ‘root’ home (/homes/root, or wherever it is there) and define environment variable HOME in your service definition file pointing there. Better yet, since you don’t want to run duplicacy as root, create separate backup user and have it run as that user.
I did very similar thing on Synology DiskStation, which does not run ubuntu, but it does use upstart to manage services. You can use it as an example: Duplicacy Web on Synology Diskstation without Docker | Trinkets, Odds, and Ends
your configuration is much better than mine, thank you for pointing me to that direction, I will follow your suggestions