From dfa62e70bd9942fd3c82d77217d48615a78bbcfc Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 28 Sep 2012 09:03:54 -0400 Subject: restart salt-minion instead of start. Packages on debian/ubuntu should start on installation. As a result, if we want to get config changes we've inserted to be read, we need to restart. Note one interesting thing here. upstart considers 'restart' as "restart only if currently running", while 'service' considers restart to be "stop if running, then start". So the use of 'service' here is important, rather than just 'restart' --- cloudinit/config/cc_salt_minion.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cloudinit') diff --git a/cloudinit/config/cc_salt_minion.py b/cloudinit/config/cc_salt_minion.py index 79ed8807..8a1440d9 100644 --- a/cloudinit/config/cc_salt_minion.py +++ b/cloudinit/config/cc_salt_minion.py @@ -56,5 +56,6 @@ def handle(name, cfg, cloud, log, _args): util.write_file(pub_name, salt_cfg['public_key']) util.write_file(pem_name, salt_cfg['private_key']) - # Start salt-minion - util.subp(['service', 'salt-minion', 'start'], capture=False) + # restart salt-minion. 'service' will start even if not started. if it + # was started, it needs to be restarted for config change. + util.subp(['service', 'salt-minion', 'restart'], capture=False) -- cgit v1.2.3