Changeset 3139
- Timestamp:
- 04/16/12 16:21:10 (13 months ago)
- Location:
- alternc/trunk
- Files:
-
- 10 edited
-
debian/alternc.config (modified) (4 diffs)
-
debian/alternc.postinst (modified) (1 diff)
-
debian/changelog (modified) (2 diffs)
-
etc/alternc/templates/postfix/myalias.cf (modified) (1 diff)
-
etc/alternc/templates/postfix/mydomain.cf (modified) (1 diff)
-
etc/alternc/templates/postfix/mygid.cf (modified) (1 diff)
-
etc/alternc/templates/postfix/myrelay.cf (modified) (1 diff)
-
etc/alternc/templates/postfix/myvirtual.cf (modified) (1 diff)
-
install/alternc.install (modified) (2 diffs)
-
install/mysql.sh (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/debian/alternc.config
r2974 r3139 27 27 MYSQL_USER=sysusr 28 28 MYSQL_PASS="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..10)' `" 29 MYSQL_MAIL_USER=alternc_mail_user 30 MYSQL_MAIL_PASS="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..10)' `" 29 31 MYSQL_CLIENT=localhost 30 32 FQDN="`cat /etc/mailname 2>/dev/null || hostname -f`" … … 54 56 fi 55 57 58 if [ -r /etc/alternc/my_mail.cnf ]; then 59 # make mysql configuration available as shell variables 60 # to convert from .cnf to shell syntax, we: 61 # * match only lines with "equal" in them (/=/) 62 # * remove whitespace around the = and add a left quote operator ' (;s) 63 # * add a right quote operator at the end of line (;s) 64 # * convert mysql variables into our MYSQL_ naming convention (;s) 65 # * print the result (;p) 66 eval `sed -n -e "/=/{s/ *= *\"\?/='/;s/\"\?\$/'/;s/host/MYSQL_HOST/;s/user/MYSQL_MAIL_USER/;s/password/MYSQL_MAIL_PASS/;s/database/MYSQL_DATABASE/;p}" /etc/alternc/my_mail.cnf` 67 fi 56 68 57 69 # mettre les valeurs de local.sh comme "default" pour debconf … … 158 170 fi 159 171 172 if [ -z "$RET" ] 173 then 174 db_set alternc/mysql/alternc_mail_user "$MYSQL_MAIL_USER" 175 fi 176 177 if [ -z "$RET" ] 178 then 179 db_set alternc/mysql/alternc_mail_password "$MYSQL_MAIL_PASS" 180 fi 160 181 db_input medium alternc/desktopname || true 161 182 db_input medium alternc/hostingname || true … … 171 192 db_input low alternc/mysql/user || true 172 193 db_input low alternc/mysql/password || true 194 db_input low alternc/mysql/alternc_mail_password || true 195 db_input low alternc/mysql/alternc_mail_user || true 173 196 db_input low alternc/mysql/client || true 174 197 db_input low alternc/sql/backup_type || true -
alternc/trunk/debian/alternc.postinst
r3138 r3139 232 232 else 233 233 echo "running an older version of sudo" 234 echo "copy content of /usr/share/doc/aegir-provision/examples/example.sudoers into /etc/sudoers for aegir to run properly" 234 #FIXME 235 echo "copy content of /usr/share/doc/examples/example.sudoers into /etc/sudoers.d for to run properly" 235 236 fi 236 237 -
alternc/trunk/debian/changelog
r3138 r3139 2 2 3 3 * Templating of dovecot and postfix 4 adding a view for dovecot usage (dovecot_view)5 adding of user vmail dedicated to the mail system4 adding a view for dovecot usage (dovecot_view) 5 adding of user vmail dedicated to the mail system 6 6 * Bugfixes 7 7 … … 31 31 alternc (1.0.2) stable; urgency=high 32 32 * Bugfix : dependency on gamin OR fam : gamin is better for courier-imap 33 and fam makes sasl imap auth fail33 and fam makes sasl imap auth fail 34 34 * Bugfix : adding french messages for domain new error messages 35 35 * Bugfix : Fixing domaines types templates issues (incompatibility with pre 1.0 alternc) -
alternc/trunk/etc/alternc/templates/postfix/myalias.cf
r3137 r3139 3 3 # 4 4 5 user = %%db user%%6 password = %%db pwd%%5 user = %%db_mail_user%% 6 password = %%db_mail_pwd%% 7 7 hosts =%%dbhost%% 8 8 dbname = %%dbname%% -
alternc/trunk/etc/alternc/templates/postfix/mydomain.cf
r2990 r3139 3 3 # 4 4 5 user = %%db user%%6 password = %%db pwd%%5 user = %%db_mail_user%% 6 password = %%db_mail_pwd%% 7 7 hosts =%%dbhost%% 8 8 dbname = %%dbname%% -
alternc/trunk/etc/alternc/templates/postfix/mygid.cf
r2990 r3139 3 3 # 4 4 5 user = %%db user%%6 password = %%db pwd%%5 user = %%db_mail_user%% 6 password = %%db_mail_pwd%% 7 7 hosts =%%dbhost%% 8 8 dbname = %%dbname%% -
alternc/trunk/etc/alternc/templates/postfix/myrelay.cf
r2559 r3139 3 3 # 4 4 5 user = %%db user%%6 password = %%db pwd%%5 user = %%db_mail_user%% 6 password = %%db_mail_pwd%% 7 7 hosts =%%dbhost%% 8 8 dbname = %%dbname%% -
alternc/trunk/etc/alternc/templates/postfix/myvirtual.cf
r3137 r3139 3 3 # 4 4 5 user = %%db user%%6 password = %%db pwd%%5 user = %%db_mail_user%% 6 password = %%db_mail_pwd%% 7 7 hosts =%%dbhost%% 8 8 dbname = %%dbname%% -
alternc/trunk/install/alternc.install
r2997 r3139 111 111 fi 112 112 113 if [ -r /etc/alternc/my_mail.cnf ]; then 114 # make mysql configuration available as shell variables 115 # to convert from .cnf to shell syntax, we: 116 # * match only lines with "equal" in them (/=/) 117 # * remove whitespace around the = and add a left quote operator ' (;s) 118 # * add a right quote operator at the end of line (;s) 119 # * convert mysql variables into our MYSQL_ naming convention (;s) 120 # * print the result (;p) 121 eval `sed -n -e "/=/{s/ *= *\"\?/='/;s/\"\?\$/'/;s/host/MYSQL_HOST/;s/user/MYSQL_USER/;s/password/MYSQL_PASS/;s/database/MYSQL_DATABASE/;p}" /etc/alternc/my.cnf` 122 chown root:alterncpanel /etc/alternc/my_mail.cnf 123 chmod 640 /etc/alternc/my_mail.cnf 124 fi 125 113 126 WARNING="WARNING: Do not edit this file, edit the one in /etc/alternc/templates and launch alternc.install again." 114 127 … … 149 162 s\\%%dbuser%%\\$MYSQL_USER\\; 150 163 s\\%%dbpwd%%\\$MYSQL_PASS\\; 164 s\\%%db_mail_user%%\\$MYSQL_MAIL_USER\\; 165 s\\%%db_mail_pwd%%\\$MYSQL_MAIL_PASS\\; 151 166 s\\%%ALTERNC_LOC%%\\$ALTERNC_LOC\\; 152 167 s\\%%warning_message%%\\$WARNING\\; -
alternc/trunk/install/mysql.sh
r2913 r3139 35 35 # * password 36 36 # * database 37 # * mail_user 38 # * mail_password 37 39 # * MYSQL_CLIENT 38 40 # … … 48 50 49 51 MYSQL_CONFIG="/etc/alternc/my.cnf" 52 MYSQL_MAIL_CONFIG="/etc/alternc/my_mail.cnf" 50 53 51 54 . /etc/alternc/local.sh … … 53 56 # this means (a) creating the user and (b) creating the database 54 57 grant="GRANT ALL ON *.* TO '$user'@'${MYSQL_CLIENT}' IDENTIFIED BY '$password' WITH GRANT OPTION; 55 CREATE DATABASE IF NOT EXISTS $database; "58 CREATE DATABASE IF NOT EXISTS $database;GRANT ALL ON '$database'.dovecot_view TO '$mail_user'@'${MYSQL_CLIENT}' IDENTIFIED BY '$mail_password'; " 56 59 57 60 echo -n "Trying debian.cnf: " … … 111 114 fi 112 115 116 if [ -f $MYSQL_MAIL_CONFIG ]; then 117 echo "Updating mysql configuration in $MYSQL_MAIL_CONFIG" 118 else 119 echo "Creating mysql configuration in $MYSQL_MAIL_CONFIG" 120 cat > $MYSQL_MAIL_CONFIG <<EOF 121 # AlternC - Web Hosting System - MySQL mail user Configuration 122 # Automatically generated by AlternC configuration, do not edit 123 # This file will be modified on package configuration 124 # (e.g. upgrade or dpkg-reconfigure alternc) 125 [mysql] 126 database= 127 128 [client] 129 EOF 130 chown root:www-data $MYSQL_MAIL_CONFIG 131 chmod 640 $MYSQL_MAIL_CONFIG 132 fi 113 133 # create a sed script to create/update the file 114 134 set_value() { 115 135 var=$1 116 136 RET=$2 117 grep -Eq "^ *$var=" $MYSQL_CONFIG || echo "$var=" >> $MYSQL_CONFIG 137 file=$3 138 grep -Eq "^ *$var=" $file || echo "$var=" >> $file 118 139 SED_SCRIPT="$SED_SCRIPT;s\\^ *$var=.*\\$var=\"$RET\"\\" 119 140 } … … 124 145 host="localhost" 125 146 fi 126 set_value host $host 127 set_value database $database 128 set_value user $user 129 set_value password $password 147 #filling the config file for the sysusr 148 set_value host $host $MYSQL_CONFIG 149 set_value database $database $MYSQL_CONFIG 150 set_value user $user $MYSQL_CONFIG 151 set_value password $password $MYSQL_CONFIG 152 153 154 #filling the config file for the mailuser 155 set_value host $host $MYSQL_MAIL_CONFIG 156 set_value database $database $MYSQL_MAIL_CONFIG 157 set_value user $mail_user $MYSQL_MAIL_CONFIG 158 set_value password $mail_password $MYSQL_MAIL_CONFIG 159 130 160 131 161 # take extra precautions here with the mysql password: … … 141 171 # Now we should be able to use the mysql configuration 142 172 mysql="/usr/bin/mysql --defaults-file=$MYSQL_CONFIG" 173 mysql_mail="/usr/bin/mysql --defaults-file=$MYSQL_MAIL_CONFIG" 143 174 144 175 echo "Checking for MySQL connectivity" 145 $mysql -e "SHOW TABLES" >/dev/null && echo "MYSQL.SH OK!" || echo "MYSQL.SH FAILED!" 176 $mysql -e "SHOW TABLES" >/dev/null && echo "MYSQL.SH OK!" || echo "MYSQL.SH FAILED: database user setup failed" 177 $mysql_mail -e "SHOW TABLES" >/dev/null && echo "MYSQL.SH OK!" || echo "MYSQL.SH FAILED: database mail user setup failed" 146 178 147 179 # Final mysql setup: db schema
Note: See TracChangeset
for help on using the changeset viewer.
