1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
Description: Fix cluster init on Debian
Update file paths and service names to work better on Debian.
Author: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Last-Update: 2019-01-12
--- a/crmsh/utils.py
+++ b/crmsh/utils.py
@@ -367,7 +367,7 @@
"""
if user == "root":
return cmd
- return "su -c \"{}\" {}".format(cmd, user)
+ return "su -s /bin/sh -c \"{}\" {}".format(cmd, user)
def chown(path, user, group):
@@ -2648,14 +2648,14 @@
"""
Check if package is installed
"""
- cmd = "rpm -q --quiet {}".format(pkg)
+ cmd = "dpkg-query --status {}".format(pkg)
if remote_addr:
# check on remote
prompt_msg = "Check whether {} is installed on {}".format(pkg, remote_addr)
rc, _, _ = run_cmd_on_remote(cmd, remote_addr, prompt_msg)
else:
# check on local
- rc, _ = get_stdout(cmd)
+ rc, _, _ = get_stdout_stderr(cmd)
return rc == 0
--- a/crmsh/bootstrap.py
+++ b/crmsh/bootstrap.py
@@ -42,12 +42,12 @@
logger_utils = log.LoggerUtils(logger)
-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"
CRM_CFG = "/etc/crm/crm.conf"
PROFILES_FILE = "/etc/crm/profiles.yml"
-SYSCONFIG_SBD = "/etc/sysconfig/sbd"
+SYSCONFIG_SBD = "/etc/default/sbd"
SYSCONFIG_PCMK = "/etc/sysconfig/pacemaker"
SYSCONFIG_NFS = "/etc/sysconfig/nfs"
SYSCONFIG_FW = "/etc/sysconfig/SuSEfirewall2"
@@ -758,7 +758,7 @@
"""
Configure passwordless SSH.
"""
- utils.start_service("sshd.service", enable=True)
+ utils.start_service("ssh.service", enable=True)
for user in USER_LIST:
configure_ssh_key(user)
@@ -1118,7 +1118,7 @@
clustername=_context.cluster_name,
ringXaddr=ringXaddr_res,
mcastport=mcastport_res,
- transport="udpu",
+ transport="knet",
ipv6=_context.ipv6,
two_rings=two_rings)
csync2_update(corosync.conf())
@@ -1378,7 +1378,7 @@
if not seed_host:
utils.fatal("No existing IP/hostname specified (use -c option)")
- utils.start_service("sshd.service", enable=True)
+ utils.start_service("ssh.service", enable=True)
for user in USER_LIST:
configure_ssh_key(user)
swap_public_ssh_key(seed_host, user)
--- a/crmsh/corosync.py
+++ b/crmsh/corosync.py
@@ -652,7 +652,7 @@
two_rings=False,
qdevice=None):
- if transport == "udpu":
+ if transport == "knet":
ring_tmpl = ""
for i in 0, 1:
ring_tmpl += " ring{}_addr: {}\n".format(i, ringXaddr[i])
@@ -691,6 +691,9 @@
expected_votes: 1
two_node: 0
}
+resources {
+ watchdog_device: off
+}
"""
if qdevice is not None:
quorum_tmpl = """quorum {
|