source: npl/commonservers/postgresql/start @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 393 bytes
Line 
1#!/bin/bash
2
3TRY=10
4svc -u /service/postgresql
5while !  psql -U postgresql -c '\q' template1 &> /dev/null; do
6    echo "Waiting for postgresql to start.. ($TRY)"
7    sleep 5
8    (( TRY-- ))
9    if [ $TRY -eq 0 ]; then
10                syn3-state postgresql CAUTION "Startup error"
11                svc -d /service/postgresql
12                exit 1
13    fi
14done
15syn3-state postgresql OK "Started"
Note: See TracBrowser for help on using the repository browser.