1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
echo PGLIB=/usr/share/pgsql >> ~postgres/.bash_profile echo PGDATA=/var/lib/pgsql/data >> ~postgres/.bash_profile echo export PGLIB PGDATA >> ~postgres/.bash_profile chown postgres:postgres ~postgres/.bash_profile SYSLOGD_SCRIPT=/etc/init.d/syslogd SYSLOGD_CONFIG=/etc/sysconfig/syslogd #if grep -qs '^SYSLOGD_OPTIONS=.*-a /var/lib/pgsql-root/dev/log' "$SYSLOGD_CONFIG"; then # subst 's|^\(SYSLOGD_OPTIONS=.*\) \?-a /var/lib/pgsql-root/dev/log|\1|' "$SYSLOGD_CONFIG" # if [ -x "$SYSLOGD_SCRIPT" ]; then # "$SYSLOGD_SCRIPT" condreload ||: # fi #fi #if [ $1 -eq 2 ]; then # /etc/chroot.d/postgresql.all force #fi /usr/sbin/post_service postgresql
1 2 3 4 5 6 7 8 9 10
exec &>/dev/null if [ $1 -gt 1 ] then if [ ! -d /usr/lib/pgsql/backup ]; then mkdir -p /usr/lib/pgsql/backup fi cd /usr/bin cp -fp postmaster postgres /usr/lib/pgsql/backup fi
1
/usr/sbin/preun_service postgresql