|
|
|
|
@ -17,32 +17,12 @@
|
|
|
|
|
postgresql_log_numfiles="10" |
|
|
|
|
postgresql_log_minsize="1M" |
|
|
|
|
postgresql_log_complevel="9" |
|
|
|
|
postgresql_slony1="no" |
|
|
|
|
|
|
|
|
|
%common |
|
|
|
|
postgresql_opts="-h $postgresql_socket_inet_host -p $postgresql_socket_inet_port -k $postgresql_socket_unix_path" |
|
|
|
|
postgresql_opts="$postgresql_opts $postgresql_flags" |
|
|
|
|
postgresql_logfile="$postgresql_rundir/postgresql.log" |
|
|
|
|
postgresql_pidfile="$postgresql_datadir/postgresql.pid" |
|
|
|
|
postgresql_slony1_pidfile="$postgresql_rundir/slon.pid" |
|
|
|
|
postgresql_slony1_start () { |
|
|
|
|
( . @l_prefix@/etc/postgresql/slony1.conf |
|
|
|
|
nohup @l_prefix@/bin/slon \ |
|
|
|
|
-d "$SLON_SYNC_LOGLEVEL" -g "$SLON_SYNC_GROUPSIZE" \ |
|
|
|
|
-s "$SLON_SYNC_INTERVAL" -t "$SLON_SYNC_TIMEOUT" \ |
|
|
|
|
"$SLON_CLUSTER_NAME" \ |
|
|
|
|
user="$SLON_CONNECT_USER" password="$SLON_CONNECT_PASS" \ |
|
|
|
|
dbname="$SLON_CONNECT_DBNAME" host="$SLON_CONNECT_HOST" |
|
|
|
|
</dev/null >/dev/null 2>&1 & |
|
|
|
|
echo $! >$postgresql_slony1_pidfile |
|
|
|
|
) >/dev/null 2>&1 |
|
|
|
|
} |
|
|
|
|
postgresql_slony1_stop () { |
|
|
|
|
if [ -f $postgresql_slony1_pidfile ]; then |
|
|
|
|
kill -TERM `cat $postgresql_slony1_pidfile` |
|
|
|
|
rm -f $postgresql_slony1_pidfile |
|
|
|
|
fi |
|
|
|
|
} |
|
|
|
|
postgresql_ctl () { |
|
|
|
|
if [ -s $postgresql_pidfile ]; then |
|
|
|
|
kill -0 `head -1 $postgresql_pidfile` >/dev/null 2>&1 |
|
|
|
|
@ -72,26 +52,16 @@
|
|
|
|
|
rcService postgresql enable yes || exit 0 |
|
|
|
|
rcService postgresql active yes && exit 0 |
|
|
|
|
postgresql_ctl start -o "$postgresql_opts" |
|
|
|
|
if rcVarIsYes postgresql_slony1; then |
|
|
|
|
postgresql_slony1_start |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
%stop -p 600 -u @l_rusr@ |
|
|
|
|
rcService postgresql enable yes || exit 0 |
|
|
|
|
rcService postgresql active no && exit 0 |
|
|
|
|
postgresql_ctl stop -m "$postgresql_shut_mode" |
|
|
|
|
if rcVarIsYes postgresql_slony1; then |
|
|
|
|
postgresql_slony1_stop |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
%restart -p 400 -u @l_rusr@ |
|
|
|
|
rcService postgresql enable yes || exit 0 |
|
|
|
|
rcService postgresql active no && exit 0 |
|
|
|
|
postgresql_ctl restart -o "$postgresql_opts" -m "$postgresql_shut_mode" |
|
|
|
|
if rcVarIsYes postgresql_slony1; then |
|
|
|
|
postgresql_slony1_stop |
|
|
|
|
postgresql_slony1_start |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
%reload -p 400 -u @l_rusr@ |
|
|
|
|
rcService postgresql enable yes || exit 0 |
|
|
|
|
|