blob: 9ff8984caec06af65444e8ff2e1ed11683c434f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
export PATH=$HOME/.npm-global/bin:$PATH
export PATH=$HOME/local/bin:$PATH
export PATH=/lib/postgresql/15/bin/:$PATH
export DBDIR=$HOME/talerdb
export LOGDIR=$HOME/logs
export TMPDIR=$HOME/tmp
export SOCKDIR=$HOME/sockets
export PGHOST=$SOCKDIR
function db_start() {
mkdir -p $SOCKDIR
mkdir -p $LOGDIR
mkdir -p $TMPDIR
initdb --no-sync --auth=trust -D $DBDIR # > /logs/postgres-dbinit.log 2> /logs/postgres-dbinit.er
echo "Launching Postgres"
cat - > $DBDIR/postgresql.conf <<EOF
unix_socket_directories='$SOCKDIR'
fsync=off
max_wal_senders=0
synchronous_commit=off
wal_level=minimal
listen_addresses=''
EOF
cat $DBDIR/pg_hba.conf | grep -v host > $DBDIR/pg_hba.conf.new
mv $DBDIR/pg_hba.conf.new $DBDIR/pg_hba.conf
pg_ctl -D $DBDIR -l /dev/null start > $LOGDIR/postgres-start.log 2> $LOGDIR/postgres-start.err
echo " DONE"
}
db_destroy() {
pg_ctl -D $DBDIR -l /dev/null stop
rm -rf $DBDIR
}
|