From 0e484587a84c74293aa02779f85934f22a575ea2 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 9 Aug 2018 17:42:47 +0300 Subject: [PATCH 1/2] Added back policy.d block for daeomon autostart on install --- install/vst-install-ubuntu.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index a17517e3..bb74295b 100755 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -626,15 +626,15 @@ fi # Updating system apt-get update -# Disabling daemon autostart /usr/share/doc/sysv-rc/README.policy-rc.d.gz -#echo -e '#!/bin/sh \nexit 101' > /usr/sbin/policy-rc.d -#chmod a+x /usr/sbin/policy-rc.d +# Disabling daemon autostart on apt-get install +echo -e '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d +chmod a+x /usr/sbin/policy-rc.d # Installing apt packages apt-get -y install $software check_result $? "apt-get install failed" -# Restoring policy +# Restoring autostart policy rm -f /usr/sbin/policy-rc.d @@ -912,7 +912,7 @@ if [ -z "$ZONE" ]; then ZONE='UTC' fi for pconf in $(find /etc/php* -name php.ini); do - sed -i "s/;date.timezone =/date.timezone = $ZONE/g" $pconf + sed -i "s%;date.timezone =%date.timezone = $ZONE%g" $pconf sed -i 's%_open_tag = Off%_open_tag = On%g' $pconf done @@ -1129,8 +1129,8 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then fi cp -f $vestacp/roundcube/main.inc.php /etc/roundcube/ cp -f $vestacp/roundcube/db.inc.php /etc/roundcube/ - chmod 640 /etc/roundcube/debian-db-roundcube.php - chown root:www-data /etc/roundcube/debian-db-roundcube.php + chmod 640 /etc/roundcube/debian-db* + chown root:www-data /etc/roundcube/debian-db* cp -f $vestacp/roundcube/vesta.php \ /usr/share/roundcube/plugins/password/drivers/ cp -f $vestacp/roundcube/config.inc.php /etc/roundcube/plugins/password/ From 563a9d8b10243f5627f14ced6060867548b57380 Mon Sep 17 00:00:00 2001 From: dpeca Date: Sun, 12 Aug 2018 03:17:01 +0200 Subject: [PATCH 2/2] Avoid blocking v-backup-user because of already dumped db Well, in one db.conf I found duplicated entry for the same database. root@btvc:~# cat /usr/local/vesta/data/users/btvc2011/db.conf DB='btvc2011_cart' DBUSER='btvc2011_9091dn' MD5='*' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='1' SUSPENDED='no' TIME='' DATE='' DB='btvc2011_cart' DBUSER='btvc2011_admin' MD5='*' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='0' SUSPENDED='no' TIME='' DATE='' DB='btvc2011_cart' DBUSER='btvc2011_david' MD5='*' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='0' SUSPENDED='no' TIME='' DATE='' DB='btvc2011_cart' DBUSER='btvc2011_djn' MD5='*' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='0' SUSPENDED='no' TIME='' DATE='' DB='btvc2011_cart' DBUSER='btvc2011_jd' MD5='*' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='0' SUSPENDED='no' TIME='' DATE='' DB='btvc2011_cart' DBUSER='btvc2011_oscar' MD5='*' HOST='localhost' TYPE='mysql' CHARSET='UTF8' U_DISK='0' SUSPENDED='no' TIME='' DATE='' Obviously different users has access to the same database. I know that this is impossible to create in Vesta. But @Skamasle thirt-party script for importing cPanels backup obviously CAN do that... and many people use that cPanel importer. This fix will avoid databases that are already dumped. Without this fix backup script get stuck on stdin waiting for: gzip: /backup/tmp.4YlV9Yr4m5/db/btvc2011_cart/btvc2011_cart.mysql.sql.gz already exists; do you wish to overwrite (y or n)? --- bin/v-backup-user | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/v-backup-user b/bin/v-backup-user index bc57cafc..b9fa8420 100755 --- a/bin/v-backup-user +++ b/bin/v-backup-user @@ -393,13 +393,15 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then dump="$tmpdir/db/$database/$database.$TYPE.sql" grants="$tmpdir/db/$database/conf/$database.$TYPE.$DBUSER" - case $TYPE in - mysql) dump_mysql_database ;; - pgsql) dump_pgsql_database ;; - esac + if [ ! -f "$dump" ]; then + case $TYPE in + mysql) dump_mysql_database ;; + pgsql) dump_pgsql_database ;; + esac - # Compress dump - gzip -$BACKUP_GZIP $dump + # Compress dump + gzip -$BACKUP_GZIP $dump + fi done # Print total