postgresql upgrade to 8.2.3, bringing in the server as well... this needs some data dir decisions to be made. to be discussed.
git-svn-id: svn://svn.openwrt.org/openwrt/packages@6915 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
5
libs/postgresql/files/postgresql.conf
Normal file
5
libs/postgresql/files/postgresql.conf
Normal file
@ -0,0 +1,5 @@
|
||||
config postgresql config
|
||||
option PGUSER postgres
|
||||
option PGDATA /var/postgresql/data
|
||||
option PGLOG /var/postgresql/data/postgresql.log
|
||||
option PG_CTL /usr/bin/pg_ctl
|
45
libs/postgresql/files/postgresql.init
Executable file
45
libs/postgresql/files/postgresql.init
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2006 OpenWrt.org
|
||||
|
||||
start() {
|
||||
config_load "postgresql"
|
||||
if [ ! -e /bin/su ]; then
|
||||
echo "The su command is requred to run postgres"
|
||||
exit 1
|
||||
fi
|
||||
config_get pgdata config PGDATA
|
||||
|
||||
if [ ! -d ${pgdata} ]; then
|
||||
echo "Create the data directory (${pgdata}) and try again"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f ${pgdata}/postmaster.pid ]; then
|
||||
rm ${pgdata}/postmaster.pid
|
||||
fi
|
||||
|
||||
config_get pguser config PGUSER
|
||||
config_get pglog config PGLOG
|
||||
config_get pgctl config PG_CTL
|
||||
config_get pgopts config PGOPTS
|
||||
|
||||
/bin/su - ${pguser} -c "${pgctl} start -D '${pgdata}' -s -l '${pglog}' -o '${pgopts}'"
|
||||
|
||||
while :
|
||||
do
|
||||
cnt=$((${cnt} + 1))
|
||||
if [ -f "${pgdata}/postmaster.pid" ]; then
|
||||
ret=0
|
||||
break
|
||||
fi
|
||||
|
||||
if [ ${cnt} -eq 30 ]; then
|
||||
echo "Postgres failed to start. See ${pglog} for details"
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
return ${ret}
|
||||
}
|
Reference in New Issue
Block a user