Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
556 B

#!/bin/sh
PGUSER=postgres
PGDATA=/var/lib/pgsql
PGCTL=/usr/bin/pg_ctl
PGLOG=$PGDATA/serverlog
case "$1" in
start)
su - $PGUSER -c "$PGCTL start -D $PGDATA -l $PGLOG"
;;
stop)
su - $PGUSER -c "$PGCTL stop -D $PGDATA -m smart"
;;
restart)
su - $PGUSER -c "$PGCTL restart -D $PGDATA -l $PGLOG -m smart"
;;
reload)
su - $PGUSER -c "$PGCTL reload -D $PGDATA"
;;
status)
su - $PGUSER -c "$PGCTL status -D $PGDATA"
;;
*)
echo "Usage: `basename $0` {start|stop|restart|reload|status}" 1>&2
exit 1
;;
esac