From 4bdf633075fd1f425bf8d9cf2ca9666ec714c8b3 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sat, 7 Jun 2014 11:30:21 -0700 Subject: [PATCH] fix(update): Fix restart of update-engine The name was missing .service. --- initialize/update.go | 5 +++-- initialize/update_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/initialize/update.go b/initialize/update.go index 7c59c13..d7a5ecc 100644 --- a/initialize/update.go +++ b/initialize/update.go @@ -12,7 +12,8 @@ import ( ) const ( - locksmithUnit = "locksmithd.service" + locksmithUnit = "locksmithd.service" + updateEngineUnit = "update-engine.service" ) // updateOption represents a configurable update option, which, if set, will be @@ -154,7 +155,7 @@ func (uc UpdateConfig) Units(root string) ([]system.Unit, error) { } if rue { ue := system.Unit{ - Name: "update-engine", + Name: updateEngineUnit, Command: "restart", } units = append(units, ue) diff --git a/initialize/update_test.go b/initialize/update_test.go index ae72eaf..a1f87e2 100644 --- a/initialize/update_test.go +++ b/initialize/update_test.go @@ -114,8 +114,8 @@ SERVER=http://foo.com` t.Errorf("unexpected number of files returned from UpdateConfig: want 1, got %d", len(uu)) } else { unit := uu[0] - if unit.Name != "update-engine" { - t.Errorf("bad name for generated unit: want update-engine, got %s", unit.Name) + if unit.Name != "update-engine.service" { + t.Errorf("bad name for generated unit: want update-engine.service, got %s", unit.Name) } if unit.Command != "restart" { t.Errorf("bad command for generated unit: want restart, got %s", unit.Command)