Modification : raccourcissement des noms UNIX pour MySQL : php5_ -> php_ .
authorJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Wed, 21 Aug 2013 17:09:44 +0000 (19:09 +0200)
committerroot <root@ateliers.heureux-cyclage.org>
Wed, 21 Aug 2013 17:09:44 +0000 (19:09 +0200)
18 files changed:
etc/nginx/site.d/agendav/local.sh
etc/nginx/site.d/cyclo-www/local.sh
etc/nginx/site.d/cyclocamp-www/local.sh
etc/nginx/site.d/davical/local.sh
etc/nginx/site.d/lhc-questionnaires/local.sh
etc/nginx/site.d/lhc-stats-tls/local.conf
etc/nginx/site.d/lhc-stats/http.conf
etc/nginx/site.d/lhc-stats/local.sh
etc/nginx/site.d/lhc-stats/site.conf
etc/nginx/site.d/lhc-www/local.sh
etc/nginx/site.d/ptitvelo-www/local.sh
etc/nginx/site.d/roundcube/local.sh
etc/nginx/site.d/roundcube/remote.sh
etc/postgresql/9.1/main/pg_ident.conf
etc/sv/php5-fpm/local.sh
local/dovecot-user-add
local/dovecot-user-del
local/roundcube-chpasswd

index 3ccb68c..2003da6 100644 (file)
@@ -1,11 +1,11 @@
 sudo adduser www-"$site"-tls www-"$site"
-sudo adduser php5_"$site" www-"$site"
-sudo adduser php5_"$site" postgres-data
-sudo adduser php5_"$site" log-php5-"$site"
+sudo adduser php_"$site" www-"$site"
+sudo adduser php_"$site" postgres-data
+sudo adduser php_"$site" log-php-"$site"
 
 hint="run before: remote/runit-configure nginx -- $site"
 assert "sudo test -f /etc/$site/config.php" hint
-sudo chgrp php5_$site /etc/"$site"/config.php
+sudo chgrp php_$site /etc/"$site"/config.php
 
 sudo sv start postgres
 while ! sudo -u postgres psql </dev/null
@@ -26,12 +26,12 @@ if test ! shared = "$(sudo -u postgres psql -AqtX "$site" <<-EOF
  )"
  then
        sudo cat "$home"/sql/pgsql.schema.sql |
-       sudo -u php5_"$site" psql -f - -U "$site" --set ON_ERROR_STOP=1 "$site"
+       sudo -u php_"$site" psql -f - -U "$site" --set ON_ERROR_STOP=1 "$site"
  fi
 
-sudo install -d -m 750 -o root -g php5_"$site" \
+sudo install -d -m 750 -o root -g php_"$site" \
  /etc/"$site"
 sudo find "$tool"/etc/"$site" -type f \
  -not -name config.php \
- -exec install -m 640 -o root -g php5_"$site" \
+ -exec install -m 640 -o root -g php_"$site" \
  -t /etc/"$site"/ {} +
index 1a81b1f..0e60791 100644 (file)
@@ -1,5 +1,5 @@
 pool=cyclo_www
-sudo adduser php5_"$pool" www-"$site"
+sudo adduser php_"$pool" www-"$site"
 sudo adduser www-"$site"-tls www-"$site"
-"$tool"/local/mysql-user-create     php5_"$pool"
-"$tool"/local/mysql-database-create php5_"$pool"
+"$tool"/local/mysql-user-create     php_"$pool"
+"$tool"/local/mysql-database-create php_"$pool"
index baefaff..8fd11fe 100644 (file)
@@ -1,5 +1,5 @@
 pool=cyclocamp_www
-sudo adduser php5_"$pool" www-"$site"
+sudo adduser php_"$pool" www-"$site"
 sudo adduser www-"$site"-tls www-"$site"
-"$tool"/local/mysql-user-create     php5_"$pool"
-"$tool"/local/mysql-database-create php5_"$pool"
+"$tool"/local/mysql-user-create     php_"$pool"
+"$tool"/local/mysql-database-create php_"$pool"
index 548c72a..5a05917 100644 (file)
@@ -1,7 +1,7 @@
 pool=davical
-sudo adduser php5_"$pool" www-"$site"
+sudo adduser php_"$pool" www-"$site"
 sudo adduser www-"$site"-tls www-"$site"
-sudo adduser php5_"$pool" postgres-data
+sudo adduser php_"$pool" postgres-data
 
 sudo install -m 640 -o root -g postgres /dev/stdin \
  /etc/davical/administration.yml <<-EOF
@@ -77,6 +77,6 @@ sudo -u postgres psql -qXAt ${DBA} -f "${DBADIR}/base-data.sql" "${DBNAME}"
 sudo -u postgres psql -qX ${DBA} -c "UPDATE usr SET password = '**${ADMINPW}' WHERE user_no = 1;" "${DBNAME}"
 
 eval home="~www-$pool"
-sudo install -m 640 -o root -g php5_"$pool" \
+sudo install -m 640 -o root -g php_"$pool" \
  "$tool"/etc/davical/davical."$local_domainname"-conf.php \
         /etc/davical/davical."$local_domainname"-conf.php
index 580e992..fa8e76b 100644 (file)
@@ -1,5 +1,5 @@
 pool=lhc_quest
-sudo adduser php5_"$pool" www-"$site"
+sudo adduser php_"$pool" www-"$site"
 sudo adduser www-"$site"-tls www-"$site"
-"$tool"/local/mysql-user-create     php5_"$pool"
-"$tool"/local/mysql-database-create php5_"$pool"
+"$tool"/local/mysql-user-create     php_"$pool"
+"$tool"/local/mysql-database-create php_"$pool"
index d81e006..49e2987 100644 (file)
@@ -19,7 +19,7 @@ location = /index.php {
        fastcgi_no_cache $no_cache;
        fastcgi_param REDIRECT_STATUS 200;
        
-       fastcgi_pass php5_fpm_lhc_stats;
+       fastcgi_pass php_fpm_lhc_stats;
  }
 
 # vim: ft=sh
index 58563f7..a208d3b 100644 (file)
@@ -1,4 +1,4 @@
-upstream php5_fpm_lhc_stats {
+upstream php_fpm_lhc_stats {
        server unix:/run/php5/fpm/lhc_stats;
  }
 
index 5f87955..39f1725 100644 (file)
@@ -1,5 +1,5 @@
 pool=lhc_stats
-sudo adduser php5_"$pool"    www-"$site"
+sudo adduser php_"$pool"    www-"$site"
 sudo adduser www-"$site"-tls www-"$site"
-"$tool"/local/mysql-user-create     php5_"$pool"
-"$tool"/local/mysql-database-create php5_"$pool"
+"$tool"/local/mysql-user-create     php_"$pool"
+"$tool"/local/mysql-database-create php_"$pool"
index f721c27..986e3b9 100644 (file)
@@ -60,7 +60,7 @@ location = /piwik.php {
        fastcgi_no_cache $no_cache;
        fastcgi_param REDIRECT_STATUS 200;
        
-       fastcgi_pass php5_fpm_lhc_stats;
+       fastcgi_pass php_fpm_lhc_stats;
  }
 location ~* ^.+\.php$ {
  ## Any other attempt to access PHP files redirects to the root.
index 53ea29b..0d0e85e 100644 (file)
@@ -1,3 +1,3 @@
 pool=lhc_www
-sudo adduser php5_"$pool" www-"$site"
+sudo adduser php_"$pool" www-"$site"
 sudo adduser www-"$site"-tls www-"$site"
index 4848b31..43d6d9b 100644 (file)
@@ -1,5 +1,5 @@
 pool=ptitvelo_www
-sudo adduser php5_"$pool"    www-"$site"
+sudo adduser php_"$pool"    www-"$site"
 sudo adduser www-"$site"-tls www-"$site"
-"$tool"/local/mysql-user-create     php5_"$pool"
-"$tool"/local/mysql-database-create php5_"$pool"
+"$tool"/local/mysql-user-create     php_"$pool"
+"$tool"/local/mysql-database-create php_"$pool"
index 6920cef..67a2675 100644 (file)
@@ -7,9 +7,9 @@ sudo install -m 664 -o www -g www \
  "$tool"/var/pub/x509/"$site"."$local_domainname"/crt+ca.pem \
  /etc/nginx/x509.d/"$site"/crt.pem
 
-sudo adduser php5_"$site" www-"$site"
-sudo adduser php5_"$site" postgres-data
-sudo adduser php5_"$site" log-php5-"$site"
+sudo adduser php_"$site" www-"$site"
+sudo adduser php_"$site" postgres-data
+sudo adduser php_"$site" log-php-"$site"
 
 "$tool"/local/runit-sv-configure postgres
 "$tool"/local/runit-sv-start     postgres
@@ -78,7 +78,7 @@ sudo debconf-set-selections <<-EOF || true
        # for internal use.
        roundcube-core  roundcube/internal/skip-preseed boolean false
        # PostgreSQL username for roundcube:
-       roundcube-core  roundcube/db/app-user   string  php5_$site
+       roundcube-core  roundcube/db/app-user   string  php_$site
        # Reinstall database for roundcube?
        roundcube-core  roundcube/dbconfig-reinstall    boolean false
        # Connection method for MySQL database of roundcube:
@@ -152,14 +152,14 @@ sudo etckeeper commit -m "runit-configure nginx -- $site"
  roundcube \
  roundcube-pgsql \
  roundcube-plugins
-sudo chgrp php5_$site /var/log/roundcube/
+sudo chgrp php_$site /var/log/roundcube/
 
-sudo install -d -m 750 -o root -g php5_"$site" \
+sudo install -d -m 750 -o root -g php_"$site" \
  /etc/"$site"
 sudo find "$tool"/etc/"$site" -type f \
- -exec install -m 640 -o root -g php5_"$site" \
+ -exec install -m 640 -o root -g php_"$site" \
  -t /etc/"$site"/ {} +
 
-sudo install -m 500 -o php5_"$site" -g root \
+sudo install -m 500 -o php_"$site" -g root \
   "$tool"/local/roundcube-chpasswd \
  /usr/local/bin/roundcube-chpasswd
index 8f4128a..318b155 100644 (file)
@@ -13,8 +13,8 @@ cat - <<-EOF |
        EOF
 "$tool"/remote/ssh root@"$local_fqdn" ' \
        set -efux
-       sudo install -d -m 750 -o root -g php5_'"$site"' \
+       sudo install -d -m 750 -o root -g php_'"$site"' \
         /etc/'"$site"'
-       sudo install -m 640 -o root -g php5_'"$site"' /dev/stdin \
+       sudo install -m 640 -o root -g php_'"$site"' /dev/stdin \
         /etc/'"$site"'/key.inc.php
  '
index 8e1e3d6..a6d593c 100644 (file)
@@ -2,10 +2,10 @@
 admin      postgres              postgres
 admin      root                  postgres
 role       postgres              davical_dba
-role       php5_davical          davical_app
+role       php_davical          davical_app
 role       openerp_cyclofficines openerp_cyclo_ivry
 role       openerp_cyclofficines openerp_cyclo_paris_est
 user       postgres              agendav
 user       root                  roundcube
-user       /^php5_(.*)$          \1
+user       /^php_(.*)$           \1
 user       /^(.*)$               \1
index d06341c..5d99315 100644 (file)
@@ -46,7 +46,7 @@ for pool in $(
         -name "php-fpm.conf" \
         -printf '%P\n')
  do pool=${pool%\/php-fpm\.conf}
-       "$tool"/local/adduser php5_"$pool" \
+       "$tool"/local/adduser php_"$pool" \
         --disabled-login \
         --disabled-password \
         --group \
@@ -56,7 +56,7 @@ for pool in $(
         --system
        sudo install -d -m 770 -o php5 -g php5 \
         /etc/php5/fpm/pool.d/"$pool"
-       "$tool"/local/adduser log-php5-"$pool" \
+       "$tool"/local/adduser log-php-"$pool" \
         --disabled-login \
         --disabled-password \
         --group \
@@ -67,7 +67,7 @@ for pool in $(
        sudo install -d -m 1771 -o log-php5 -g log-php5 \
         /home/www/log/php5 \
         /home/www/log/php5/fpm
-       sudo install -d -m 2770 -o log-php5-"$pool" -g log-php5-"$pool" \
+       sudo install -d -m 2770 -o log-php-"$pool" -g log-php-"$pool" \
         /home/www/log/php5/fpm/"$pool"
        sudo install -m 660 -o php5 -g php5 /dev/stdin \
         /etc/php5/fpm/pool.d/"$pool"/php-fpm.conf <<-EOF
@@ -79,7 +79,7 @@ for pool in $(
                env[TEMP] = /tmp
                env[TMPDIR] = /tmp
                env[TMP] = /tmp
-               group = php5_$pool
+               group = php_$pool
                #listen = 127.0.0.1:9000
                listen = /run/php5/fpm/$pool
                #listen.allowed_clients = 127.0.0.1
@@ -100,7 +100,7 @@ for pool in $(
                rlimit_core = unlimited
                rlimit_files = 131072
                slowlog = /home/www/log/php5/fpm/$pool/slow.log
-               user = php5_$pool
+               user = php_$pool
                $(cat "$tool"/etc/php5/fpm/pool.d/"$pool"/php-fpm.conf)
                EOF
  done
index 5e9c35f..aa79314 100755 (executable)
@@ -46,7 +46,7 @@ shift
        sudo chmod -t ~mail/acl/dovecot."$domain"
                # NOTE: permet les mv shared.db{.lock,} effectués par dovecot
        
-       sudo install -d -o mail -g php5_roundcube -m 1770 \
+       sudo install -d -o mail -g php_roundcube -m 1770 \
         /etc/dovecot/dovecot."$domain"
        sudo install -d -o mail -g postfix -m 750 \
         /etc/mail/dovecot
@@ -201,5 +201,5 @@ shift
                !!
                EOF
        sort -k 1,1 -t : |
-       sudo install -o php5_roundcube -g php5_roundcube -m 0640 /dev/stdin "$new_passwd"
+       sudo install -o php_roundcube -g php_roundcube -m 0640 /dev/stdin "$new_passwd"
        sudo mv -f "$new_passwd" "$old_passwd"
index 513f7aa..5e63d32 100755 (executable)
@@ -67,7 +67,7 @@ shift
                 done 4<<-EOF 3>&1 >&2 |
                        $(sudo cat "$old_passwd")
                        EOF
-               sudo install -o php5_roundcube -g php5_roundcube -m 0640 /dev/stdin "$new_passwd"
+               sudo install -o php_roundcube -g php_roundcube -m 0640 /dev/stdin "$new_passwd"
                sudo mv -f "$new_passwd" "$old_passwd"
         fi
 # setup_nss
@@ -100,7 +100,7 @@ shift
 # setup_roundcube
        if test "${purge:+set}"
         then
-               sudo -u php5_roundcube psql -1AqtX --set ON_ERROR_STOP=1 -U roundcube roundcube <<-EOF
+               sudo -u php_roundcube psql -1AqtX --set ON_ERROR_STOP=1 -U roundcube roundcube <<-EOF
                        DO LANGUAGE plpgsql \$\$
                                DECLARE uid integer;
                        BEGIN
index 92cf455..8dd78ba 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh -efu
 
-test "$(id -n -u)" = php5_roundcube
+test "$(id -n -u)" = php_roundcube
 
 IFS=: read -r user password
 IFS=@ read -r user domain <<-EOF