mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-01 22:05:08 +00:00
af0564d809
thanks for complete diffs ;-) closed PR PR: 18699 Obtained from: Palle Girgensohn <girgen@partitur.se>
37 lines
1.1 KiB
Bash
37 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
# pgsql.sh - postgresql startup file for FreeBSD and possibly *BSD (untested)
|
|
|
|
# Changes:
|
|
# - renamed startup script to be in sync with INSTALL file
|
|
# - merged ldconfig start sequence from former postgrsql.sh script (andreas)
|
|
# - modified the postmaster startup sequence as suggested in the
|
|
# INSTALL file which was given as example for FreeBSD 2.2 (andreas)
|
|
# - removed the commandline option
|
|
# -D!!PREFIX!!/pgsql/data \
|
|
# because the postmaster process, which starts up under the
|
|
# environment of the pgsql user, sets this with the PGDATA
|
|
# environment variable in !!PREFIX!!/pgsql/.profile
|
|
# - added (ugly) support for shutting down (girgen)
|
|
# - moved 2>&1 to end of line, so it'll actually work [if -S is removed] (girgen)
|
|
|
|
case $1 in
|
|
start)
|
|
[ -d !!PREFIX!!/pgsql/lib ] && /sbin/ldconfig -m !!PREFIX!!/pgsql/lib
|
|
[ -x !!PREFIX!!/pgsql/bin/postmaster ] && {
|
|
su -l pgsql -c 'exec !!PREFIX!!/pgsql/bin/postmaster -i -S -o -F \
|
|
> !!PREFIX!!/pgsql/errlog 2>&1'
|
|
echo -n ' pgsql'
|
|
}
|
|
;;
|
|
stop)
|
|
/usr/bin/killall postgres
|
|
;;
|
|
*)
|
|
echo "usage: `basename $0` {start|stop}" >&2
|
|
exit 64
|
|
;;
|
|
esac
|