Open geepie opened 3 years ago
Hey @geepie, thanks for sharing!
We do have a systemd section on: https://postgrest.org/en/v7.0.0/admin.html#daemonizing.
Perhaps we can include your recommendations there.
(I'll transfer the issue to our docs repo).
@geepie Could you elaborate how postgrest.service
and postgrest@.service
work?
systemctl start postgrest@xxx AssertPathExists=/etc/postgrest/%i.conf
Does %i
gets replaced by xxx
?
Let's expand on this in the docs. It would be difficult to provide any scripts that apply across distros. @geepie, any additonal background that you can provide on your scripts?
Please find below the systemd scripts I use on Debian. PostgREST executable is in
/usr/bin/postgrest
Multiples configuration files are/etc/postgrest/xxx.conf
Note: must take care to use a different port in each config file.I test the following commands:
/etc/systemd/system/postgrest.service
/etc/systemd/system/postgrest@.service