Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 23 lines (18 sloc) 595 Bytes
#!/bin/sh
# PostgreSQL Cluster
# see 'man pg_ctlcluster' and 'man pg_ctl' for details
#
# (cloux@rote.ch)
exec 2>&1
DAEMON="$(command -v pg_ctlcluster)"
[ -x "$DAEMON" ] || exit 0
PGBINROOT="/usr/lib/postgresql/"
[ -r ./conf ] && . ./conf
[ -d "$PGBINROOT" ] || exit 1
OPTIONS=
VERSION=
NAME=
[ -z "$VERSION" ] && VERSION=$(ls -1v $PGBINROOT | tail -n 1)
[ -z "$NAME" ] && NAME=$(ls -1tr /etc/postgresql/$VERSION | tail -n 1)
install -d -m 2775 -o postgres -g postgres -d /run/postgresql
exec chpst -u postgres $DAEMON --foreground --skip-systemctl-redirect $VERSION $NAME start -- $OPTIONS