]> git.pld-linux.org Git - packages/postgresql.git/commitdiff
- added support for ssl
authorSebastian Zagrodzki <sebek@zagrodzki.net>
Thu, 25 Oct 2001 21:11:46 +0000 (21:11 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    postgresql.init -> 1.27
    postgresql.sysconfig -> 1.10

postgresql.init
postgresql.sysconfig

index 75f7b6f233faa94e2a41ced26aed2521586f9fa1..6ebbe2f9959eff085649821889d4028fdf92d5ac 100644 (file)
@@ -22,7 +22,8 @@ if [ -f /etc/sysconfig/postgresql ] ; then
         . /etc/sysconfig/postgresql
 else
         ALLOW_TCP_CONNECTIONS=no
-       POSTGRES_DATA_DIR=/var/lib/psql
+       ALLOW_USE_SSL=no
+       POSTGRES_DATA_DIR=/var/lib/pgsql
        POSTGRES_LOG=/var/log/pgsql
 fi
 
@@ -54,6 +55,19 @@ case "$1" in
        if [ -f /var/lock/subsys/postgresql ]; then
                msg_Already_Running PostgreSQL
        else    
+               if is_yes "$ALLOW_USE_SSL"; then
+                       if is_no "$ALLOW_TCP_CONNECTIONS"; then
+                               nls "You must enable ALLOW_TCP_CONNECTIONS in order to use SSL"
+                               exit 1
+                       elif [ ! -f "$POSTGRES_DATA_DIR/server.key" ]; then
+                               nls "$POSTGRES_DATA_DIR/server.key not found!"
+                               exit 1
+                       elif [ ! -f "$POSTGRES_DATA_DIR/server.crt" ]; then
+                               nls "$POSTGRES_DATA_DIR/server.crt not found!"
+                               exit 1
+                       fi
+               fi
+               
                # Sanity check
                [ -f /tmp/.s.PGSQL.5432 ] || rm -f /tmp/.s.PGSQL.5432
                
@@ -79,11 +93,12 @@ case "$1" in
                msg_starting PostgreSQL 
                busy
                PGSQL_CMDLINE="$([ -n "$POSTGRES_DATA_DIR" ] && echo "-D $POSTGRES_DATA_DIR") \
-                   $([ "$POSTGRES_QUIET". = yes. ] && echo '-s')";
+                   $(is_yes "$POSTGRES_QUIET" && echo '-s')";
                POSTMASTER_OPTIONS=" \
-                   $([ "$POSTGRES_QUIET". = yes. ] && echo '-S') \
-                   $([ "$POSTGRES_DISABLE_FSYNC". = yes. ] && echo '-F') \
-                   $([ "$ALLOW_TCP_CONNECTIONS". = yes. ] && echo '-i')";
+                   $(is_yes "$POSTGRES_QUIET" && echo '-S') \
+                   $(is_yes "$POSTGRES_DISABLE_FSYNC" && echo '-F') \
+                   $(is_yes "$ALLOW_TCP_CONNECTIONS" && echo '-i') \
+                   $(is_yes "$ALLOW_USE_SSL" && echo '-l')";
 
                TMPDIR=/tmp su postgres -c "\
                        $(echo "/usr/bin/pg_ctl start $PGSQL_CMDLINE -l $POSTGRES_LOG") \
index 6ea32be9d08d51c9afb2d2c8a97c383fb688aeba..f9d73fc00b6b164b09fbcd7cd8fe8592660c0fb0 100644 (file)
@@ -13,6 +13,11 @@ POSTGRES_QUIET=no
 # only on unix socket
 ALLOW_TCP_CONNECTIONS=no
 
+# Allow using SSL on TCP connections. Requires ALLOW_TCP_CONNECTIONS to be
+# set to yes. Also, you must supply key and certificate files
+# ($POSTGRES_DATA_DIR/server.{key,crt})
+ALLOW_USE_SSL=no
+
 # Disable automatic fsync() call after each transac tion. This option
 # improves performance, but an operating system crash while a transaction is
 # in progress will probably cause data loss.
This page took 0.288881 seconds and 4 git commands to generate.