Ajout : vm_remote : rule_gpg .
[lhc/ateliers.git] / etc / sv / postgres / configure.sh
index db32e16..6bb2b1d 100644 (file)
@@ -1,6 +1,6 @@
 # DOC: http://wiki.postgresql.org/wiki/Shared_Database_Hosting
 
-rule apt_get_install postgresql-9.1
+#rule apt_get_install postgresql-9.1
 rule insserv_remove  postgresql
 rule adduser postgres \
  --disabled-login \
@@ -50,13 +50,15 @@ sudo install -m 640 -o postgres -g postgres /dev/stdin \
 sudo install -m 640 -o postgres -g postgres /dev/stdin \
  /etc/postgresql/9.1/main/pg_ident.conf <<-EOF
        # MAPNAME       SYSTEM-USERNAME         PG-USERNAME
+       admin           postgres                postgres
+       admin           root                    postgres
        EOF
 sudo install -m 640 -o postgres -g postgres /dev/stdin \
  /etc/postgresql/9.1/main/start.conf <<-EOF
        EOF
 sudo install -m 640 -o postgres -g postgres /dev/stdin \
  /etc/postgresql/9.1/main/pg_hba.conf <<-EOF
-       local all postgres peer
+       local all postgres peer map=admin
        local all all      peer
        EOF
 sudo install -m 640 -o postgres -g postgres-data \
@@ -69,7 +71,7 @@ sudo find "$tool"/etc/postgresql/bin/ -type f -perm /+x -exec \
 sudo ln -fns \
         ../sv/"$sv" \
  /etc/service/"$sv"
-rule runit_sv_start "$sv"
+rule _runit_sv_start "$sv"
 while ! sudo -u postgres psql </dev/null
 do sleep 1; done
 
@@ -110,12 +112,14 @@ sudo -u postgres psql template1 -a -f - <<-EOF
 #       et utilisateurices depuis public.
 sudo -u postgres psql template1 -a -f - <<-EOF
        \set ON_ERROR_STOP on
-       REVOKE ALL ON pg_auth_members FROM public;
-       REVOKE ALL ON pg_authid       FROM public;
-       REVOKE ALL ON pg_database     FROM public;
-       REVOKE ALL ON pg_group        FROM public;
-       REVOKE ALL ON pg_roles        FROM public;
-       REVOKE ALL ON pg_settings     FROM public;
-       REVOKE ALL ON pg_tablespace   FROM public;
-       REVOKE ALL ON pg_user         FROM public;
+       REVOKE ALL ON ALL TABLES IN SCHEMA pg_catalog FROM public;
+       REVOKE ALL ON               SCHEMA pg_catalog FROM public;
+       -- REVOKE ALL ON pg_auth_members FROM public;
+       -- REVOKE ALL ON pg_authid       FROM public;
+       -- REVOKE ALL ON pg_database     FROM public;
+       -- REVOKE ALL ON pg_group        FROM public;
+       -- REVOKE ALL ON pg_roles        FROM public;
+       -- REVOKE ALL ON pg_settings     FROM public;
+       -- REVOKE ALL ON pg_tablespace   FROM public;
+       -- REVOKE ALL ON pg_user         FROM public;
        EOF