[Debian-ha-commits] [crmsh] 02/04: d/patches: add fixes for cluster init on Debian
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Tue Jul 25 13:43:26 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository crmsh.
commit b87f5853f79788af7783888911a11f48e62c9e7a
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Tue Jul 25 15:31:29 2017 +0200
d/patches: add fixes for cluster init on Debian
---
debian/patches/0013-Fix-cluster-bootstrap.patch | 115 ++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 116 insertions(+)
diff --git a/debian/patches/0013-Fix-cluster-bootstrap.patch b/debian/patches/0013-Fix-cluster-bootstrap.patch
new file mode 100644
index 0000000..e4c58eb
--- /dev/null
+++ b/debian/patches/0013-Fix-cluster-bootstrap.patch
@@ -0,0 +1,115 @@
+Description: Fix cluster init on Debian
+ Update file paths and service names to work better on Debian.
+Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
+Last-Update: 2017-07-23
+--- a/crmsh/bootstrap.py
++++ b/crmsh/bootstrap.py
+@@ -31,10 +31,10 @@
+
+
+ LOG_FILE = "/var/log/ha-cluster-bootstrap.log"
+-CSYNC2_KEY = "/etc/csync2/key_hagroup"
+-CSYNC2_CFG = "/etc/csync2/csync2.cfg"
++CSYNC2_KEY = "/etc/csync2.key_hagroup"
++CSYNC2_CFG = "/etc/csync2.cfg"
+ COROSYNC_AUTH = "/etc/corosync/authkey"
+-SYSCONFIG_SBD = "/etc/sysconfig/sbd"
++SYSCONFIG_SBD = "/etc/default/sbd"
+ SYSCONFIG_FW = "/etc/sysconfig/SuSEfirewall2"
+ SYSCONFIG_FW_CLUSTER = "/etc/sysconfig/SuSEfirewall2.d/services/cluster"
+
+@@ -214,7 +214,7 @@
+ """
+ Check if package is installed
+ """
+- return invoke("rpm -q --quiet {}".format(pkg))
++ return invoke("dpkg-query --status {}".format(pkg))
+
+
+ def sleep(t):
+@@ -362,7 +362,7 @@
+ """
+ # Reload rsyslog to make sure it logs with the correct hostname
+ if service_is_active("rsyslog.service"):
+- invoke("systemctl reload rsyslog.service")
++ invoke("systemctl restart rsyslog.service")
+ datestr = utils.get_stdout("date --rfc-3339=seconds")[1]
+ log('================================================================')
+ log("%s %s" % (datestr, " ".join(sys.argv)))
+@@ -544,7 +544,7 @@
+ """
+ Configure passwordless SSH.
+ """
+- start_service("sshd.service")
++ start_service("ssh.service")
+ invoke("mkdir -m 700 -p /root/.ssh")
+ if os.path.exists("/root/.ssh/id_rsa"):
+ if not confirm("/root/.ssh/id_rsa already exists - overwrite?"):
+@@ -587,13 +587,13 @@
+
+ utils.str2file("""group ha_group
+ {
+-key /etc/csync2/key_hagroup;
++key /etc/csync2.key_hagroup;
+ host %s;
+ include /etc/booth;
+ include /etc/corosync/corosync.conf;
+ include /etc/corosync/authkey;
+-include /etc/csync2/csync2.cfg;
+-include /etc/csync2/key_hagroup;
++include /etc/csync2.cfg;
++include /etc/csync2.key_hagroup;
+ include /etc/ctdb/nodes;
+ include /etc/drbd.conf;
+ include /etc/drbd.d;
+@@ -601,8 +601,8 @@
+ include /etc/lvm/lvm.conf;
+ include /etc/multipath.conf;
+ include /etc/samba/smb.conf;
+-include /etc/sysconfig/pacemaker;
+-include /etc/sysconfig/sbd;
++include /etc/default/pacemaker;
++include /etc/default/sbd;
+ }
+ """ % (utils.this_node()), CSYNC2_CFG)
+
+@@ -1137,7 +1137,7 @@
+ if not seed_host:
+ error("No existing IP/hostname specified (use -c option)")
+
+- start_service("sshd.service")
++ start_service("ssh.service")
+ invoke("mkdir -m 700 -p /root/.ssh")
+
+ tmpdir = tmpfiles.create_dir()
+@@ -1171,8 +1171,8 @@
+ # authorized_keys file (again, to help with the case where the
+ # user has done manual initial setup without the assistance of
+ # ha-cluster-init).
+- if not invoke("ssh root@%s ha-cluster-init ssh_remote" % (seed_host)):
+- error("Can't invoke ha-cluster-init ssh_remote on %s" % (seed_host))
++ if not invoke("ssh root@%s crm cluster init ssh_remote" % (seed_host)):
++ error("Can't invoke crm cluster init ssh_remote on %s" % (seed_host))
+
+
+ def join_csync2(seed_host):
+@@ -1192,8 +1192,8 @@
+
+ # If we *were* updating /etc/hosts, the next line would have "\"$hosts_line\"" as
+ # the last arg (but this requires re-enabling this functionality in ha-cluster-init)
+- if not invoke("ssh root@{} ha-cluster-init csync2_remote {}".format(seed_host, utils.this_node())):
+- error("Can't invoke ha-cluster-init csync2_remote on {}".format(seed_host))
++ if not invoke("ssh root@{} crm cluster init csync2_remote {}".format(seed_host, utils.this_node())):
++ error("Can't invoke crm cluster init csync2_remote on {}".format(seed_host))
+
+ # This is necessary if syncing /etc/hosts (to ensure everyone's got the
+ # same list of hosts)
+@@ -1202,7 +1202,7 @@
+ # || error "Can't retrieve /etc/hosts from seed_host"
+ # install_tmp $tmp_conf /etc/hosts
+
+- if not invoke("scp root@%s:'/etc/csync2/{csync2.cfg,key_hagroup}' /etc/csync2" % (seed_host)):
++ if not invoke("scp root@%s:'/etc/csync2.{cfg,key_hagroup}' /etc" % (seed_host)):
+ error("Can't retrieve csync2 config from %s" % (seed_host))
+
+ start_service("csync2.socket")
diff --git a/debian/patches/series b/debian/patches/series
index b14c0d6..dd9aa4f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
0010-Fix-package-management.patch
0011-Fix-scripts-init.patch
0012-Fix-crm-history.patch
+0013-Fix-cluster-bootstrap.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/crmsh.git
More information about the Debian-HA-Commits
mailing list