* Fixed problem when BASEDIR paths were given without a trailing '/'.
[linux_from_scratch.git] / bootscripts / blfs / init.d / postgresql
blobd0efebd9aecfde4416e8a3e783ae359f8b4fac8a
1 #!/bin/sh
2 # Begin $rc_base/init.d/postgresql
4 # Based on sysklogd script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
7 . /etc/sysconfig/rc
8 . $rc_functions
10 case "$1" in
11 start)
12 echo "Starting PostgreSQL daemon..."
13 su - postgres -c '/usr/bin/pg_ctl start -W -D /var/pgsql/data \
14 -l /var/pgsql/data/logfile -o "-i" '
15 evaluate_retval
18 stop)
19 echo "Stopping PostgreSQL daemon..."
20 /usr/bin/pg_ctl stop -m smart -D /var/pgsql/data
21 evaluate_retval
24 restart)
25 $0 stop
26 sleep 1
27 $0 start
30 status)
31 /usr/bin/pg_ctl status -D /var/pgsql/data
35 echo "Usage: $0 {start|stop|restart|status}"
36 exit 1
38 esac
40 # End $rc_base/init.d/postgresql