summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/config/cc_set_passwords.py2
-rw-r--r--cloudinit/distros/debian.py1
-rw-r--r--cloudinit/distros/gentoo.py2
-rw-r--r--cloudinit/distros/rhel.py1
4 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py
index 56a36906..06974248 100644
--- a/cloudinit/config/cc_set_passwords.py
+++ b/cloudinit/config/cc_set_passwords.py
@@ -136,7 +136,7 @@ def handle(_name, cfg, cloud, log, args):
util.write_file(ssh_util.DEF_SSHD_CFG, "\n".join(lines))
try:
- cmd = ['service']
+ cmd = cloud.distro.init_cmd or ['service']
cmd.append(cloud.distro.get_option('ssh_svcname', 'ssh'))
cmd.append('restart')
util.subp(cmd)
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index 1ae232fd..3b912728 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -48,6 +48,7 @@ class Distro(distros.Distro):
network_conf_fn = "/etc/network/interfaces"
tz_conf_fn = "/etc/timezone"
tz_local_fn = "/etc/localtime"
+ init_cmd = ['service']
def __init__(self, name, cfg, paths):
distros.Distro.__init__(self, name, cfg, paths)
diff --git a/cloudinit/distros/gentoo.py b/cloudinit/distros/gentoo.py
index b6291dc6..82d49fc3 100644
--- a/cloudinit/distros/gentoo.py
+++ b/cloudinit/distros/gentoo.py
@@ -60,7 +60,7 @@ class Distro(distros.Distro):
def install_packages(self, pkglist):
self.update_package_sources()
- self.package_command('install', pkgs=pkglist)
+ self.package_command('', pkgs=pkglist)
def _write_network(self, settings):
util.write_file(self.network_conf_fn, settings)
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py
index 30195384..7cc7a813 100644
--- a/cloudinit/distros/rhel.py
+++ b/cloudinit/distros/rhel.py
@@ -49,6 +49,7 @@ class Distro(distros.Distro):
network_script_tpl = '/etc/sysconfig/network-scripts/ifcfg-%s'
resolve_conf_fn = "/etc/resolv.conf"
tz_local_fn = "/etc/localtime"
+ init_cmd = ['service']
def __init__(self, name, cfg, paths):
distros.Distro.__init__(self, name, cfg, paths)