From 5ec8930a6f4cac2f1207ff2a96bc894d508cac6a Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 22 Feb 2019 10:51:18 +0100 Subject: [PATCH 1/3] ugly patch https://github.com/OpenNebula/one/commit/320a8c26c0c455edfdc5ea87ae2fad38817ee856?diff=unified --- eole/one.patch | 33 +++++++++++++++++++++++++++++++++ posttemplate/90-one-db | 6 ++++++ 2 files changed, 39 insertions(+) create mode 100644 eole/one.patch diff --git a/eole/one.patch b/eole/one.patch new file mode 100644 index 0000000..eb6c240 --- /dev/null +++ b/eole/one.patch @@ -0,0 +1,33 @@ +--- onehost_helper.rb 2019-02-09 11:13:40.592653423 +0100 ++++ lib/one/ruby/cli/one_helper/onehost_helper.rb 2019-02-09 11:13:48.820708340 +0100 +@@ -349,7 +349,7 @@ + sync_cmd = "rsync -Laz --delete #{REMOTES_LOCATION}" << + " #{host['NAME']}:#{remote_dir}" + else +- sync_cmd = "scp -rp #{REMOTES_LOCATION}/. " << ++ sync_cmd = "scp -rp #{REMOTES_LOCATION}/* " << + "#{host['NAME']}:#{remote_dir} 2> /dev/null" + end + +--- one_im_exec.rb 2019-02-09 11:14:41.809061980 +0100 ++++ lib/one/mads/one_im_exec.rb 2019-02-09 11:14:45.981089826 +0100 +@@ -74,7 +74,7 @@ + if !action_is_local?(:MONITOR) + if do_update == "1" || @options[:force_copy] + # Use SCP to sync: +- sync_cmd = "scp -r #{@local_scripts_base_path}/. " \ ++ sync_cmd = "scp -r #{@local_scripts_base_path}/* " \ + "#{host}:#{@remote_scripts_base_path}" + + # Use rsync to sync: +--- CommandManager.rb 2019-02-09 11:14:53.877142524 +0100 ++++ lib/one/ruby/CommandManager.rb 2019-02-09 11:15:07.325232276 +0100 +@@ -268,7 +268,7 @@ + SSHCommand.run("mkdir -p #{remote_dir}",host,logger) + + # Use SCP to sync: +- sync_cmd = "scp -rp #{REMOTES_LOCATION}/. #{host}:#{remote_dir}" ++ sync_cmd = "scp -rp #{REMOTES_LOCATION}/* #{host}:#{remote_dir}" + + # Use rsync to sync: + # sync_cmd = "rsync -Laz #{REMOTES_LOCATION} #{host}:#{@remote_dir}" diff --git a/posttemplate/90-one-db b/posttemplate/90-one-db index 213d001..55654e5 100644 --- a/posttemplate/90-one-db +++ b/posttemplate/90-one-db @@ -81,4 +81,10 @@ echo EchoGras "Mise à jour de la base de données ONE" echo updateDB +# FIXME ugly patch +grep -q "\/\." /usr/lib/one/ruby/CommandManager.rb +if [ $? = 0 ]; then + cd /usr + patch -fp0 < /usr/share/eole/one.patch +fi exit ${?} From babaddf7e417593ec83ad73b711d4b7cd680830f Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 22 Feb 2019 10:57:27 +0100 Subject: [PATCH 2/3] Revert "ugly patch https://github.com/OpenNebula/one/commit/320a8c26c0c455edfdc5ea87ae2fad38817ee856?diff=unified" This reverts commit 5ec8930a6f4cac2f1207ff2a96bc894d508cac6a. --- eole/one.patch | 33 --------------------------------- posttemplate/90-one-db | 6 ------ 2 files changed, 39 deletions(-) delete mode 100644 eole/one.patch diff --git a/eole/one.patch b/eole/one.patch deleted file mode 100644 index eb6c240..0000000 --- a/eole/one.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- onehost_helper.rb 2019-02-09 11:13:40.592653423 +0100 -+++ lib/one/ruby/cli/one_helper/onehost_helper.rb 2019-02-09 11:13:48.820708340 +0100 -@@ -349,7 +349,7 @@ - sync_cmd = "rsync -Laz --delete #{REMOTES_LOCATION}" << - " #{host['NAME']}:#{remote_dir}" - else -- sync_cmd = "scp -rp #{REMOTES_LOCATION}/. " << -+ sync_cmd = "scp -rp #{REMOTES_LOCATION}/* " << - "#{host['NAME']}:#{remote_dir} 2> /dev/null" - end - ---- one_im_exec.rb 2019-02-09 11:14:41.809061980 +0100 -+++ lib/one/mads/one_im_exec.rb 2019-02-09 11:14:45.981089826 +0100 -@@ -74,7 +74,7 @@ - if !action_is_local?(:MONITOR) - if do_update == "1" || @options[:force_copy] - # Use SCP to sync: -- sync_cmd = "scp -r #{@local_scripts_base_path}/. " \ -+ sync_cmd = "scp -r #{@local_scripts_base_path}/* " \ - "#{host}:#{@remote_scripts_base_path}" - - # Use rsync to sync: ---- CommandManager.rb 2019-02-09 11:14:53.877142524 +0100 -+++ lib/one/ruby/CommandManager.rb 2019-02-09 11:15:07.325232276 +0100 -@@ -268,7 +268,7 @@ - SSHCommand.run("mkdir -p #{remote_dir}",host,logger) - - # Use SCP to sync: -- sync_cmd = "scp -rp #{REMOTES_LOCATION}/. #{host}:#{remote_dir}" -+ sync_cmd = "scp -rp #{REMOTES_LOCATION}/* #{host}:#{remote_dir}" - - # Use rsync to sync: - # sync_cmd = "rsync -Laz #{REMOTES_LOCATION} #{host}:#{@remote_dir}" diff --git a/posttemplate/90-one-db b/posttemplate/90-one-db index 55654e5..213d001 100644 --- a/posttemplate/90-one-db +++ b/posttemplate/90-one-db @@ -81,10 +81,4 @@ echo EchoGras "Mise à jour de la base de données ONE" echo updateDB -# FIXME ugly patch -grep -q "\/\." /usr/lib/one/ruby/CommandManager.rb -if [ $? = 0 ]; then - cd /usr - patch -fp0 < /usr/share/eole/one.patch -fi exit ${?} From a85189fd8f8b6e2719ab0040e0cefae4202143eb Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 22 Feb 2019 14:02:50 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Conditionnement=20sur=20le=20mode=20HA=20et?= =?UTF-8?q?=20Leader=20pour=20l'ex=C3=A9cution=20de=20l'init=5Fha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postservice/30-one-mng | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/postservice/30-one-mng b/postservice/30-one-mng index 635f170..3344d36 100755 --- a/postservice/30-one-mng +++ b/postservice/30-one-mng @@ -456,8 +456,11 @@ function init_ha() { function main() { wait_true_retcode "Wait for oned to be started" "onecluster show 0 > /dev/null" - if [ "$(CreoleGet activer_one_ha)" = "oui" ] && [ "$(CreoleGet one_ha_server_index)" = "0" ]; then - init_ha + if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then + + if [ "$(CreoleGet one_ha_server_index)" != "0" ]; then + return + fi fi # # Rename default cluster @@ -490,6 +493,13 @@ function main() # Création des Datastores # manage_datastores "${clst_name}" + + # + # Dans le cas du mode HA, seul le leader fait l'init + # + if [ "$(CreoleGet activer_one_ha)" = "oui" ]; then + init_ha + fi } main