Quellcode durchsuchen

prepare pg_hba.conf already at the source; adjust postgresql.conf for automatic VACUUM operations by default

Ralf S. Engelschall vor 18 Jahren
Ursprung
Commit
78674a433c
1 geänderte Dateien mit 17 neuen und 14 gelöschten Zeilen
  1. 17 14
      postgresql/postgresql.spec

+ 17 - 14
postgresql/postgresql.spec

@@ -47,7 +47,7 @@ Class:        BASE
 Group:        Database
 License:      GPL
 Version:      %{V_postgresql}
-Release:      20070514
+Release:      20070905
 
 #   package options
 %option       with_server       yes
@@ -535,6 +535,22 @@ AutoReqProv:  no
     ) || exit $?
 %endif
 
+    #   adjust default configuration for hourly auto-vacuum operation
+    %{l_shtool} subst \
+        -e 's;^# *\(stats_start_collector *=\) *[^#]*\(#.*\);\1 on \2;' \
+        -e 's;^# *\(stats_row_level *=\) *[^#]*\(#.*\);\1 on \2;' \
+        -e 's;^# *\(autovacuum *=\) *[^#]*\(#.*\);\1 on \2;' \
+        -e 's;^# *\(autovacuum_naptime *=\) *[^#]*\(#.*\);\1 1h \2;' \
+        $RPM_BUILD_ROOT%{l_prefix}/share/postgresql/postgresql.conf.sample
+
+    #   adjust default configuration for local access policy
+    ( echo ""
+      echo "#   OpenPKG PostgreSQL default access policy"
+      echo "local all all                           md5"
+      echo "host  all all 127.0.0.1 255.255.255.255 md5"
+      echo ""
+    ) >>$RPM_BUILD_ROOT%{l_prefix}/share/postgresql/pg_hba.conf.sample
+
     #   post-adjust pgcluster configuration filenames
 %if "%{with_pgcluster}" == "yes"
     cp $RPM_BUILD_ROOT%{l_prefix}/share/postgresql/pgreplicate.conf.sample \
@@ -650,19 +666,6 @@ AutoReqProv:  no
         $RPM_INSTALL_PREFIX/lib/openpkg/shtool prop \
             -p "Creating initial PostgreSQL DB in $RPM_INSTALL_PREFIX/var/postgresql/db"
 
-        #   adjust initial authentication configuration
-        cp $RPM_INSTALL_PREFIX/var/postgresql/db/pg_hba.conf \
-           $RPM_INSTALL_PREFIX/var/postgresql/db/pg_hba.conf.old
-        ( cat $RPM_INSTALL_PREFIX/var/postgresql/db/pg_hba.conf.old |\
-          sed -e 's;^\([^#]\);# \1;' -e 's;^$;#;'
-          echo ""
-          echo "#   OpenPKG PostgreSQL default access policy"
-          echo "local all all                           md5"
-          echo "host  all all 127.0.0.1 255.255.255.255 md5"
-          echo ""
-        ) >$RPM_INSTALL_PREFIX/var/postgresql/db/pg_hba.conf
-        rm -f $RPM_INSTALL_PREFIX/var/postgresql/db/pg_hba.conf.old
-
         #   display information about next steps
         ( echo "An initial PostgreSQL DB was created with the two standard"
           echo "databases 'template0' and 'template1'. The owner of both"