From f1aabff1ce5272bc0d54d3da0d21d7b07e66477e Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Mon, 5 Sep 2016 16:53:20 +0200 Subject: [PATCH 1/1] =?utf8?q?Modifications=C2=A0:=20=20=20=20=20=20=20=20?= =?utf8?q?=20etc/postgresql/9.1=20->=20etc/postgresql/9.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- etc/postgresql/{9.1 => 9.4}/main/pg_hba.conf | 0 .../{9.1 => 9.4}/main/pg_ident.conf | 0 .../{9.1 => 9.4}/main/postgresql.conf | 10 +++--- etc/sv/postgres/local.sh | 34 +++++++++---------- etc/sv/postgres/remote.sh | 8 ++--- etc/sv/postgres/run | 7 ++-- 6 files changed, 30 insertions(+), 29 deletions(-) rename etc/postgresql/{9.1 => 9.4}/main/pg_hba.conf (100%) rename etc/postgresql/{9.1 => 9.4}/main/pg_ident.conf (100%) rename etc/postgresql/{9.1 => 9.4}/main/postgresql.conf (96%) diff --git a/etc/postgresql/9.1/main/pg_hba.conf b/etc/postgresql/9.4/main/pg_hba.conf similarity index 100% rename from etc/postgresql/9.1/main/pg_hba.conf rename to etc/postgresql/9.4/main/pg_hba.conf diff --git a/etc/postgresql/9.1/main/pg_ident.conf b/etc/postgresql/9.4/main/pg_ident.conf similarity index 100% rename from etc/postgresql/9.1/main/pg_ident.conf rename to etc/postgresql/9.4/main/pg_ident.conf diff --git a/etc/postgresql/9.1/main/postgresql.conf b/etc/postgresql/9.4/main/postgresql.conf similarity index 96% rename from etc/postgresql/9.1/main/postgresql.conf rename to etc/postgresql/9.4/main/postgresql.conf index 546a9e7..9e071b2 100644 --- a/etc/postgresql/9.1/main/postgresql.conf +++ b/etc/postgresql/9.4/main/postgresql.conf @@ -35,7 +35,7 @@ bonjour = off # advertise server via Bonjour #cpu_tuple_cost = 0.01 # same scale as above #cursor_tuple_fraction = 0.1 # range 0.0-1.0 #custom_variable_classes = '' # list of custom variable class names -data_directory = '/home/postgresql/data' # use data in another directory +data_directory = '/home/postgresql/data/9.4' # use data in another directory datestyle = 'iso, dmy' #db_user_namespace = off #deadlock_timeout = 1s @@ -64,7 +64,7 @@ default_text_search_config = 'pg_catalog.french' #enable_tidscan = on #escape_string_warning = on #exit_on_error = off # terminate session on any error? -#external_pid_file = '/run/postgresql/9.1-main.pid' # write an extra PID file +#external_pid_file = '/run/postgresql/9.4-main.pid' # write an extra PID file #extra_float_digits = 0 # min -15, max 3 #from_collapse_limit = 8 #fsync = on # turns forced synchronization on or off @@ -76,10 +76,10 @@ default_text_search_config = 'pg_catalog.french' #geqo_seed = 0.0 # range 0.0-1.0 #geqo_selection_bias = 2.0 # range 1.5-2.0 #geqo_threshold = 12 -hba_file = '/etc/postgresql/9.1/main/pg_hba.conf' # host-based authentication file +hba_file = '/etc/postgresql/9.4/main/pg_hba.conf' # host-based authentication file #hot_standby = off # "on" allows queries during recovery #hot_standby_feedback = off # send info from standby to prevent -ident_file = '/etc/postgresql/9.1/main/pg_ident.conf' # ident configuration file +ident_file = '/etc/postgresql/9.4/main/pg_ident.conf' # ident configuration file #intervalstyle = 'postgres' #join_collapse_limit = 8 # 1 disables collapsing of explicit #krb_caseins_users = off @@ -164,7 +164,7 @@ ssl_renegotiation_limit = 512MB # amount of data between renegotiations #track_counts = on #track_functions = none # none, pl, all #transform_null_equals = off -unix_socket_directory = '/run/postgresql' # (change requires restart) +unix_socket_directories = '/run/postgresql' # (change requires restart) unix_socket_group = 'postgres-data' # (change requires restart) unix_socket_permissions = 0770 # begin with 0 to use octal notation #update_process_title = on diff --git a/etc/sv/postgres/local.sh b/etc/sv/postgres/local.sh index 9e97c8a..d8f47de 100644 --- a/etc/sv/postgres/local.sh +++ b/etc/sv/postgres/local.sh @@ -1,6 +1,6 @@ # DOC: http://wiki.postgresql.org/wiki/Shared_Database_Hosting -"$tool"/local/apt-get-install postgresql-9.1 +"$tool"/local/apt-get-install postgresql-9.4 "$tool"/local/insserv-remove postgresql "$tool"/local/adduser postgres \ --disabled-login \ @@ -23,8 +23,8 @@ sudo install -d -m 1751 -o postgres -g postgres-data \ /home/postgresql \ /home/postgresql/etc \ /etc/postgresql \ - /etc/postgresql/9.1 \ - /etc/postgresql/9.1/main + /etc/postgresql/9.4 \ + /etc/postgresql/9.4/main sudo ln -fns \ /etc/postgresql \ /home/postgresql/etc/postgresql @@ -35,39 +35,39 @@ if sudo test ! -d /home/postgresql/data /home/postgresql/data sudo -u postgres pg_createcluster \ --datadir=/home/postgresql/data \ - --logfile=/home/postgresql/log/9.1/main/cluster.log \ + --logfile=/home/postgresql/log/9.4/main/cluster.log \ --socketdir=/run/postgresql \ - 9.1 main + 9.4 main fi sudo install -m 640 -o postgres -g postgres /dev/stdin \ - /etc/postgresql/9.1/main/pg_ctl.conf <<-EOF + /etc/postgresql/9.4/main/pg_ctl.conf <<-EOF pg_ctl_options = '' EOF sudo install -m 640 -o postgres -g postgres /dev/stdin \ - /etc/postgresql/9.1/main/start.conf <<-EOF + /etc/postgresql/9.4/main/start.conf <<-EOF EOF sudo install -m 640 -o postgres -g postgres \ - "$tool"/etc/postgresql/9.1/main/pg_ident.conf \ - /etc/postgresql/9.1/main/pg_ident.conf + "$tool"/etc/postgresql/9.4/main/pg_ident.conf \ + /etc/postgresql/9.4/main/pg_ident.conf sudo install -m 640 -o postgres -g postgres \ - "$tool"/etc/postgresql/9.1/main/pg_hba.conf \ - /etc/postgresql/9.1/main/pg_hba.conf + "$tool"/etc/postgresql/9.4/main/pg_hba.conf \ + /etc/postgresql/9.4/main/pg_hba.conf sudo install -m 640 -o postgres -g postgres-data \ - "$tool"/etc/postgresql/9.1/main/postgresql.conf \ - /etc/postgresql/9.1/main/postgresql.conf + "$tool"/etc/postgresql/9.4/main/postgresql.conf \ + /etc/postgresql/9.4/main/postgresql.conf sudo install -m 640 -o postgres -g postgres \ "$tool"/var/pub/x509/postgresql."$local_domainname"/crt+ca.pem \ - /etc/postgresql/9.1/main/server.crt + /etc/postgresql/9.4/main/server.crt sudo install -m 640 -o postgres -g postgres \ "$tool"/var/pub/x509/postgresql."$local_domainname"/crt.self-signed.pem \ - /etc/postgresql/9.1/main/root.crt + /etc/postgresql/9.4/main/root.crt sudo install -m 640 -o postgres -g postgres \ "$tool"/var/pub/x509/postgresql."$local_domainname"/crl.self-signed.pem \ - /etc/postgresql/9.1/main/root.crl + /etc/postgresql/9.4/main/root.crl for f in server.crt server.key root.crt root.crl do sudo ln -fns \ - /etc/postgresql/9.1/main/$f \ + /etc/postgresql/9.4/main/$f \ /home/postgresql/data/$f done diff --git a/etc/sv/postgres/remote.sh b/etc/sv/postgres/remote.sh index 9e87c3d..3624b35 100644 --- a/etc/sv/postgres/remote.sh +++ b/etc/sv/postgres/remote.sh @@ -3,13 +3,13 @@ set -efux sudo install -d -m 1771 -o postgres -g postgres-data \ /etc/postgresql \ - /etc/postgresql/9.1 \ - /etc/postgresql/9.1/main + /etc/postgresql/9.4 \ + /etc/postgresql/9.4/main sudo install -m 644 -o postgres -g postgres /dev/stdin \ - /etc/postgresql/9.1/main/.gitignore <<-EOF + /etc/postgresql/9.4/main/.gitignore <<-EOF server.key EOF sudo install -m 400 -o postgres -g postgres \ /dev/stdin \ - /etc/postgresql/9.1/main/server.key + /etc/postgresql/9.4/main/server.key ' diff --git a/etc/sv/postgres/run b/etc/sv/postgres/run index bf8c49e..1a14a0a 100755 --- a/etc/sv/postgres/run +++ b/etc/sv/postgres/run @@ -5,12 +5,13 @@ home="/home/postgresql" install -d -m 710 -o "$sv" -g "$sv"-data \ /run/postgresql +cd /run/postgresql exec /usr/bin/chpst \ -u "$sv":"$sv":"$sv"-data \ - /usr/lib/postgresql/9.1/bin/postgres \ - -D "$home"/data \ + /usr/lib/postgresql/9.4/bin/postgres \ + -D "$home"/data/9.4 \ -e \ - -c config_file=/etc/postgresql/9.1/main/postgresql.conf \ + -c config_file=/etc/postgresql/9.4/main/postgresql.conf \ -l \ -p 5432 -- 2.20.1