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

11 lines
545 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
Environment=PGPASSFILE=/usr/local/lib/secrets/postgresql.pass
2022-07-18 17:06:12 +02:00
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 ! /usr/bin/psql --set=sslmode=verify-full -h %%pg_client_server_domainname -U %%pg_client_username %%pg_client_database -c "\dt"; do sleep 1; done; echo "POSTGRESQL READY"'