diff --git a/docs/integrations/systemd.rst b/docs/integrations/systemd.rst index 55b7d6cf7..d0aba9288 100644 --- a/docs/integrations/systemd.rst +++ b/docs/integrations/systemd.rst @@ -12,6 +12,12 @@ First, create postgrest configuration in ``/etc/postgrest/config`` db-anon-role = "" jwt-secret = "" +Create a dedicated ``postgrest`` user with: + +.. code-block:: ini + + sudo useradd -M -U -d /nonexistent -s /usr/sbin/nologin postgrest + Then create the systemd service file in ``/etc/systemd/system/postgrest.service`` .. code-block:: ini @@ -21,6 +27,8 @@ Then create the systemd service file in ``/etc/systemd/system/postgrest.service` After=postgresql.service [Service] + User=postgrest + Group=postgrest ExecStart=/bin/postgrest /etc/postgrest/config ExecReload=/bin/kill -SIGUSR1 $MAINPID