dataset/seed/postgresql-client/templates/postgresqlclient.service

15 lines
953 B
SYSTEMD
Raw Normal View History

2022-03-08 19:42:28 +01:00
[Unit]
Description=Waiting for postgresql server
2022-08-18 16:38:37 +02:00
After=network-online.target
Before=risotto.target
2022-03-08 19:42:28 +01:00
[Service]
Type=oneshot
2023-06-23 08:12:05 +02:00
{% if general.postgresql.pg_client_key_owner != 'root' %}
User={{ general.postgresql.pg_client_key_owner }}
{% endif %}
2023-02-14 14:24:16 +01:00
EnvironmentFile=/usr/local/lib/secrets/postgresql.pass2
2023-06-23 08:12:05 +02:00
ExecStart=/usr/bin/timeout 300 bash -c 'while ! 3<> /dev/tcp/{{ general.postgresql.pg_client_server_domainname }}/5432; do sleep 1; done; echo "POSTGRESQL STARTED"'
ExecStart=/usr/bin/timeout 90 bash -c 'while ! {% if True -%}{% endif -%}
/usr/bin/psql "sslmode=verify-full sslrootcert={{ general.tls_ca_directory }}/PostgreSQL.crt sslcert={{ general.tls_cert_directory }}/postgresql.crt sslkey={{ general.tls_key_directory }}/postgresql.key host={{ general.postgresql.pg_client_server_domainname }} user={{ general.postgresql.pg_client_username }} dbname={{ general.postgresql.pg_client_database }}" -c "\dt"; do sleep 1; done; echo "POSTGRESQL READY"'