Tag Archives: fedora

Install postgresql 9.2

Download version for your platform:
[spoiler title="Platforms packages"]
Fedora 17 — x86_64
http://yum.pgrpms.org/9.2/fedora/fedora-17-x86_64/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 16 — i686
http://yum.pgrpms.org/9.2/fedora/fedora-16-i386/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 16 — x86_64
http://yum.pgrpms.org/9.2/fedora/fedora-16-x86_64/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 15 — i686
http://yum.pgrpms.org/9.2/fedora/fedora-15-i386/pgdg-fedora92-9.2-5.noarch.rpm
Fedora 15 — x86_64
http://yum.pgrpms.org/9.2/fedora/fedora-15-x86_64/pgdg-fedora92-9.2-5.noarch.rpm
Red Hat Enterprise Linux 6 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-redhat92-9.2-7.noarch.rpm
Red Hat Enterprise Linux 6 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm
Scientific Linux 6 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-sl92-9.2-8.noarch.rpm
Scientific Linux 6 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-sl92-9.2-8.noarch.rpm
CentOS 6 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
CentOS 6 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
Red Hat Enterprise Linux 5 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-5-i386/pgdg-redhat92-9.2-7.noarch.rpm
Red Hat Enterprise Linux 5 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-5-x86_64/pgdg-redhat92-9.2-7.noarch.rpm
Scientific Linux 5 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-5-i386/pgdg-sl92-9.2-8.noarch.rpm
Scientific Linux 5 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-5-x86_64/pgdg-sl92-9.2-8.noarch.rpm
CentOS 5 — i386
http://yum.pgrpms.org/9.2/redhat/rhel-5-i386/pgdg-centos92-9.2-6.noarch.rpm
CentOS 5 — x86_64
http://yum.pgrpms.org/9.2/redhat/rhel-5-x86_64/pgdg-centos92-9.2-6.noarch.rpm
[/spoiler]

yum install pgdg-<platform>92-<full version>.noarch.rpm
add "exclude=postgresql* " (without quotes) to /etc/yum.repos.d/-Base.repo in the end of sections [base] and [updates].

yum install postgresql92 postgresql92-server postgresql92-contrib
#initialize db
service postgresql-9.2 initdb
service postgresql-9.2 start
chkconfig postgresql-9.2 on

Replication:
how to make replication you can learn from official wiki:
https://wiki.postgresql.org/wiki/Streaming_Replication

Fedora: runscript (example: openvpn client)

/etc/init.d/opevpn-home-client

#!/bin/bash
#
# Run-level Startup script for the OpenVPN client
#
# chkconfig: 345 91 19
# description: Startup/Shutdown OpenVPN client 
OVPN_HOME="/home/alter/ovpn/"
case "$1" in
    start)
        echo -n "Starting OpenVPN home client: "
        cd $OVPN_HOME && /usr/sbin/openvpn ovpn.conf
        echo "OK"
        ;;
    stop)
        echo -n "Shutdown OpenVPN home client: "
        killall openvpn
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart"
        exit 1
esac
exit 0
chmod +x /etc/init.d/opevpn-home-client
chkconfig --add openvpn-home-client