Browse Source

Merge branch 'develop'

2.5.2/master
Teddy Cornaut 7 months ago
parent
commit
8a4a2f5808
1 changed files with 29 additions and 23 deletions
  1. 29
    23
      postservice/61-pve

+ 29
- 23
postservice/61-pve View File

@@ -3,8 +3,8 @@
3 3
 
4 4
 function synchroHost()
5 5
 {
6
-	local hst=${1}
7
-	local WORKDIR=${2}
6
+    local hst=${1}
7
+    local WORKDIR=${2}
8 8
     local jobs_error_log="/var/www/html/mse/app/logs/jobs-error.log"
9 9
     local crond_file="/etc/cron.d/pve-jobs-run"
10 10
 
@@ -38,11 +38,17 @@ function synchroHost()
38 38
     --include="mpm_worker.conf" \
39 39
     /etc/apache2/mods-available/ root@${hst}:/etc/apache2/mods-available/
40 40
 
41
-	if [[ -f '/etc/rsyslog.d/eole-traps/mse.conf' ]]
42
-	then
43
-		echo "#### Synchro rsyslog"
44
-		rsync -e ssh -av --include="mse.conf" /etc/rsyslog.d/eole-traps/ root@${hst}:/etc/rsyslog.d/eole-traps/
45
-	fi
41
+    if [[ -f '/etc/rsyslog.d/eole-traps/mse.conf' ]]
42
+    then
43
+        echo "#### Synchro rsyslog"
44
+        rsync -e ssh -av --include="mse.conf" /etc/rsyslog.d/eole-traps/ root@${hst}:/etc/rsyslog.d/eole-traps/
45
+    fi
46
+
47
+    if [[ -f '/etc/logrotate.d/mse' ]]
48
+    then
49
+        echo "#### Synchro logrotate"
50
+        rsync -e ssh -av --include="mse" /etc/logrotate.d/ root@${hst}:/etc/logrotate.d/
51
+    fi
46 52
 
47 53
     echo "#### Synchro PHP-FPM"
48 54
     rsync -e ssh -av \
@@ -65,7 +71,7 @@ function synchroHost()
65 71
     cmd="${cmd} chown -R :www-data app/{cache,logs,spool,webservices};"
66 72
     cmd="${cmd} chmod -R g+rw app/{cache,logs,spool,webservices};"
67 73
 
68
-    # Creation CRON spool mailer 
74
+    # Creation CRON spool mailer
69 75
     cmd="${cmd} echo \"*/5 * * * * root cd /var/www/html/mse; php app/console swiftmailer:spool:send --message-limit=500 --env=prod > /dev/null 2>>${jobs_error_log}\" > ${crond_file};"
70 76
 
71 77
     # Activation mods apache
@@ -73,10 +79,10 @@ function synchroHost()
73 79
     cmd="${cmd} a2enmod mpm_worker;"
74 80
     apacheMods="proxy_fcgi rewrite expires remoteip"
75 81
 
76
-	for mod in ${apacheMods}
77
-	do
78
-		cmd="${cmd} a2enmod ${mod};"
79
-	done
82
+    for mod in ${apacheMods}
83
+    do
84
+        cmd="${cmd} a2enmod ${mod};"
85
+    done
80 86
 
81 87
     # Redémarrage service apache
82 88
     cmd="${cmd} a2ensite mse;"
@@ -95,25 +101,25 @@ LOGFILE=/var/log/eole/mse-sync.log
95 101
 
96 102
 if [[ -e ${LOGFILE} ]]
97 103
 then
98
-	[[ -e ${LOGFILE}.bck ]] && rm ${LOGFILE}.bck
99
-	mv ${LOGFILE} ${LOGFILE}.bck
104
+    [[ -e ${LOGFILE}.bck ]] && rm ${LOGFILE}.bck
105
+    mv ${LOGFILE} ${LOGFILE}.bck
100 106
 fi
101 107
 
102 108
 WORKDIR="/var/www/html/mse"
103 109
 childs=""
104 110
 for worker in $(CreoleGet mseSlaves)
105 111
 do
106
-	synchroHost ${worker} ${WORKDIR} 2>&1 >> /var/log/eole/mse-sync.log &
107
-	childs+="${worker}:${!} "
112
+    synchroHost ${worker} ${WORKDIR} 2>&1 >> /var/log/eole/mse-sync.log &
113
+    childs+="${worker}:${!} "
108 114
 done
109 115
 
110 116
 for child in ${childs}
111 117
 do
112
-	name=${child%:*}
113
-	pid=${child#*:}
114
-	while [[ -d /proc/${pid}  ]]
115
-	do
116
-		sleep 1
117
-	done
118
-	echo Worker ${name} sync done
118
+    name=${child%:*}
119
+    pid=${child#*:}
120
+    while [[ -d /proc/${pid}  ]]
121
+    do
122
+        sleep 1
123
+    done
124
+    echo Worker ${name} sync done
119 125
 done

Loading…
Cancel
Save