Merge "Use unit file to enable systemd service"

This commit is contained in:
Jenkins
2015-01-21 14:19:39 +00:00
committed by Gerrit Code Review

View File

@@ -82,9 +82,11 @@ def service_discovery(service_candidates):
# replacing a symlink with its real path
if os.path.islink(service_path):
real_path = os.path.realpath(service_path)
result['cmd_enable'] = "sudo systemctl enable %s" % real_path
unit_file_name = os.path.basename(real_path)
result['cmd_enable'] = ("sudo systemctl enable %s" %
unit_file_name)
result['cmd_disable'] = ("sudo systemctl disable %s" %
real_path)
unit_file_name)
else:
result['cmd_enable'] = "sudo systemctl enable %s" % service
result['cmd_disable'] = "sudo systemctl disable %s" % service