Browse Source

erreur template

tags/pkg/staging/eole-2.7.0/0.1.0-0
Emmanuel Garette 5 months ago
parent
commit
4ee18114f4
2 changed files with 1 additions and 67 deletions
  1. 0
    66
      posttemplate/25-mariadb-passwd
  2. 1
    1
      tmpl/galera.cnf

+ 0
- 66
posttemplate/25-mariadb-passwd View File

@@ -1,66 +0,0 @@
1
-#!/bin/bash
2
-
3
-systemctl stop mariadb
4
-
5
-mariadb_cfdir=/etc/mysql/
6
-dc=$mysql_cfgdir/mariadbBackup.cnf
7
-mariadb_rundir=/var/run/mysqld/
8
-mariadb_statedir=/var/lib/mysql
9
-
10
-if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then
11
-    pass="`sed -n 's/^[ ]*password *= *// p' $dc | head -n 1`"
12
-    # Basedir is deprecated. Remove the option if it's in an existing mariadbBackup.cnf
13
-    sed -i '/basedir/d' "$dc"
14
-else
15
-    pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`;
16
-    if [ ! -d "$mariadb_cfdir" ]; then
17
-      install -o 0 -g 0 -m 0755 -d $mariadb_cfdir
18
-    fi
19
-    umask 066
20
-    cat /dev/null > $dc
21
-    umask 022
22
-    echo "# Automatically generated DONT'T TOUCH !!!!!!"           >>$dc
23
-    echo "[client]"                                                >>$dc
24
-    echo "host     = localhost"                                    >>$dc
25
-    echo "user     = maria-sys-maint"                              >>$dc
26
-    echo "password = $pass"                                        >>$dc
27
-    echo "socket   = $mariadb_rundir/mysqld.sock"                  >>$dc
28
-    echo "[mysql_upgrade]"                                         >>$dc
29
-    echo "host     = localhost"                                    >>$dc
30
-    echo "user     = maria-sys-maint"	                           >>$dc
31
-    echo "password = $pass"                                        >>$dc
32
-    echo "socket   = $mariadb_rundir/mysqld.sock"                  >>$dc
33
-fi
34
-
35
-# If this dir chmod go+w then the admin did it. But this file should not.
36
-    chown 0:0 $dc
37
-    chmod 0600 $dc
38
-
39
-# If database doesn't exist we create it.
40
-mkdir /var/lib/mariadb-files
41
-mariadb_filesdir=/var/lib/mariadb-files
42
-
43
-if [ ! "$(ls -A "${mariadb_statedir}")" ] && [ -d "${mariadb_filesdir}" ]; then
44
-    existingdatabase=0
45
-    initfile=`mktemp --tmpdir=/var/lib/mariadb-files/`
46
-    touch "$initfile"
47
-    chmod 600 "$initfile"
48
-    chown mysql:mysql "$initfile"
49
-    echo "USE mysql; " >> "$initfile"
50
-    db_get mysql-server/root_password && rootpw="$RET"
51
-    if [ ! -z "$rootpw" ]; then
52
-      rootpw=$(printf %q "${rootpw}")
53
-      echo "ALTER USER 'root'@'localhost' IDENTIFIED BY '$rootpw';" >> "$initfile"
54
-    fi
55
-    echo "CREATE USER IF NOT EXISTS 'maria-sys-maint'@'localhost' IDENTIFIED BY '$pass';" >> "$initfile"
56
-    echo "GRANT ALL ON *.* TO 'maria-sys-maint'@'localhost' WITH GRANT OPTION;" >> "$initfile"
57
-    echo "SHUTDOWN;" >> "$initfile"
58
-    mysqld --initialize-insecure --user=mysql --init-file="$initfile"> /dev/null 2>&1 || true
59
-    rm "$initfile"
60
-else
61
-    existingdatabase=1
62
-fi
63
-
64
-systemctl start mariadb
65
-
66
-exit 0

+ 1
- 1
tmpl/galera.cnf View File

@@ -8,7 +8,7 @@ wsrep_on=ON
8 8
 wsrep_provider=/usr/lib/galera/libgalera_smm.so
9 9
 # Galera Cluster Configuration
10 10
 wsrep_cluster_name="%%dbClusterName"
11
-wsrep_cluster_address="gcomm://%%dbClusterMember
11
+wsrep_cluster_address="gcomm://%%custom_join(%%dbClusterMember, ',')"
12 12
 
13 13
 # Tunning
14 14
 wsrep_provider_options="gcache.size=%%dbClusterGcacheSizeMb"

Loading…
Cancel
Save