forked from ports/contrib
postgresql: do not require a working login shell anymore
This commit is contained in:
parent
81e9c6cb6f
commit
bdf0d5af00
@ -17,9 +17,7 @@ Example: (for your convenience, there could be better ways to
|
||||
# mkdir /var/pgsql/data
|
||||
# chown postgres /var/pgsql/data
|
||||
|
||||
# su - postgres
|
||||
# initdb -D /var/pgsql/data
|
||||
# exit
|
||||
# sudo -u postgres initdb -D /var/pgsql/data
|
||||
|
||||
# /etc/rc.d/postgresql start
|
||||
# psql -U postgres -f pg.dump postgres
|
||||
@ -33,21 +31,18 @@ NEW INSTALL
|
||||
To complete the installation and create a test database you need to do
|
||||
some additional steps:
|
||||
|
||||
# useradd -m -d /home/postgres postgres
|
||||
# useradd -m -d /home/postgres -s /bin/false postgres
|
||||
# passwd -l postgres
|
||||
|
||||
# mkdir -p /var/pgsql/data
|
||||
# touch /var/log/postgresql
|
||||
# chown postgres /var/pgsql/data /var/log/postgresql
|
||||
|
||||
# su - postgres
|
||||
# initdb -D /var/pgsql/data
|
||||
# exit
|
||||
# sudo -u postgres initdb -D /var/pgsql/data
|
||||
|
||||
# /etc/rc.d/postgresql start
|
||||
# su - postgres
|
||||
# createdb test
|
||||
# psql test
|
||||
# sudo -u postgres createdb test
|
||||
# psql -U postgres test
|
||||
|
||||
Edit /etc/cron/weekly/syslog as root and add
|
||||
a line "/usr/sbin/rotatelog postgresql"
|
||||
|
@ -6,7 +6,7 @@ PG_DATA=/var/pgsql/data
|
||||
|
||||
case "$1" in
|
||||
start|stop|status|restart|reload)
|
||||
su - postgres -c "pg_ctl -D $PG_DATA -l /var/log/postgresql $1"
|
||||
sudo -u postgres pg_ctl -D "$PG_DATA" -l /var/log/postgresql "$1"
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 start|stop|restart|reload|status"
|
||||
|
Loading…
x
Reference in New Issue
Block a user