ubuntu-init-switch: fix for determining if systemd

/run/systemd/ seems to exist even if systemd is not the init system.
but /run/systemd/system/ only exists if it has been used as init.
This commit is contained in:
Scott Moser 2014-07-31 15:10:31 -04:00
parent b14f059ae9
commit cb878b7cb1

View File

@ -111,7 +111,7 @@ def handle(name, cfg, cloud, log, args):
log.warn("%s: target set to %s, expected one of: %s",
name, target, str(supported))
if os.path.exists("/run/systemd"):
if os.path.exists("/run/systemd/system"):
current = "systemd"
else:
current = "upstart"