forked from stove/dataset
14 lines
756 B
Desktop File
14 lines
756 B
Desktop File
[Unit]
|
|
Description=Waiting for postgresql server
|
|
After=network-online.target
|
|
Before=risotto.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
%if %%pg_client_key_owner != 'root'
|
|
User=%%pg_client_key_owner
|
|
%end if
|
|
EnvironmentFile=/usr/local/lib/secrets/postgresql.pass2
|
|
ExecStart=/usr/bin/timeout 300 bash -c 'while ! 3<> /dev/tcp/%%pg_client_server_domainname/5432; do sleep 1; done; echo "POSTGRESQL STARTED"'
|
|
ExecStart=/usr/bin/timeout 90 bash -c 'while ! %slurp
|
|
/usr/bin/psql "sslmode=verify-full sslrootcert=%%tls_ca_directory/PostgreSQL.crt sslcert=%%tls_cert_directory/postgresql.crt sslkey=%%tls_key_directory/postgresql.key host=%%pg_client_server_domainname user=%%pg_client_username dbname=%%pg_client_database" -c "\dt"; do sleep 1; done; echo "POSTGRESQL READY"'
|