File: install

package info (click to toggle)
bucardo 5.6.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 2,176 kB
  • sloc: perl: 20,690; sh: 92; makefile: 10
file content (22 lines) | stat: -rwxr-xr-x 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

set -eux

service postgresql stop

# create /var/run/bucardo if missing
if [ ! -d /var/run/bucardo ]; then
  mkdir /var/run/bucardo
  chown bucardo:bucardo /var/run/bucardo
fi

# start a temporary PG server
PGVERSION=$(/usr/share/postgresql-common/supported-versions | tail -n1)
trap "su bucardo -c 'cd /var/lib/bucardo && bucardo stop' || :; pg_dropcluster $PGVERSION regress --stop" EXIT
pg_createcluster $PGVERSION regress -p 5432 --start -- --auth trust

# start bucardo
su postgres -c 'psql -f bucardo.schema'
su bucardo -c 'cd /var/lib/bucardo && bucardo start'
sleep 1
ps auxf | grep '[B]ucardo Master Control Program'