From: Karl O. Pinc Date: Tue, 3 Sep 2024 16:36:39 +0000 (-0500) Subject: Improved systemd example service file X-Git-Url: https://papio.biology.duke.edu/gitweb/?a=commitdiff_plain;h=ca96cf644ebb5897433fa34a48a5702543533229;p=pgwui_server Improved systemd example service file --- diff --git a/examples/etc/systemd/system/pgwui_server.service b/examples/etc/systemd/system/pgwui_server.service index e4b05d2..8a25f10 100644 --- a/examples/etc/systemd/system/pgwui_server.service +++ b/examples/etc/systemd/system/pgwui_server.service @@ -17,13 +17,23 @@ # environment in which PGWUI_Server is installed. [Unit] -Description=PGWUI_Server web server +Description=PGWUI_Server web server, a PostgreSQL Web User Interface [Service] Type=simple +PIDFile = /run/pgwui_server/pgwui_server.pid User=www-data -ExecStart=/usr/local/lib/pgwui/venv/bin/python -W 'ignore:The psycopg2 wheel package will be renamed from release 2.8::psycopg2' /usr/local/lib/pgwui/venv/bin/pserve /etc/pgwui.ini +Group = www-data +WorkingDirectory = /var/www +ExecStartPre = +/bin/mkdir /run/pgwui_server +ExecStartPre = +/bin/chown -R www-data:www-data /run/pgwui_server +ExecStart=/usr/local/lib/pgwui/venv/bin/pserve /etc/pgwui.ini +ExecReload = /bin/kill -s HUP $MAINPID +ExecStop = /bin/kill -s TERM $MAINPID +ExecStopPost = +/bin/rm -rf /run/pgwui_server +PrivateTmp = true [Install] +WantedBy = multi-user.target WantedBy=nginx.service