Skip to content

Commit

Permalink
build: Set systemd unit name based on project
Browse files Browse the repository at this point in the history
Set the name of the systemd(1) unit based on the project being built for.

The unit name is used to construct the kernel command line, and then
used by the guests systemd to launch the agent, but previously only the
clear containers agent was supported.

Fixes clearcontainers#955.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Jan 24, 2018
1 parent 322bcb6 commit 9be4882
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ const project = "$(PROJECT_NAME)"
// prefix used to denote non-standard CLI commands and options.
const projectPrefix = "$(PROJECT_TYPE)"

// systemdUnitName is the systemd(1) target used to launch the agent.
const systemdUnitName = "$(PROJECT_TAG).target"

// commit is the git commit the runtime is compiled from.
var commit = "$(COMMIT)"

Expand Down
2 changes: 1 addition & 1 deletion create.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func getKernelParams(containerID string) []vc.Param {
},
{
Key: "systemd.unit",
Value: "clear-containers.target",
Value: systemdUnitName,
},
{
Key: "systemd.mask",
Expand Down

0 comments on commit 9be4882

Please sign in to comment.