diff --git a/Makefile b/Makefile index 57bcf89924..c7dc9d2a77 100644 --- a/Makefile +++ b/Makefile @@ -34,9 +34,17 @@ ifeq ($(TRACE),yes) endif endif +# If "yes", install additional services to redirect guest OS journal messages +# to the host using VSOCK. +TRACE_DEV_MODE := no + # Path to systemd unit directory if installed as not init. UNIT_DIR := /usr/lib/systemd/system +# Path to systemd drop-in snippet directory used to override the agent's +# service without having to modify the pristine agent service file. +SNIPPET_DIR := /etc/systemd/system/$(AGENT_SERVICE).d/ + GENERATED_FILES := # Define if agent will be built by seccomp tag SECCOMP := no @@ -53,6 +61,11 @@ ifeq ($(TRACE),yes) UNIT_FILES += jaeger-client-socat-redirector.service endif +ifeq ($(TRACE_DEV_MODE),yes) +UNIT_FILES += kata-journald-host-redirect.service +SNIPPET_FILES += kata-redirect-agent-output-to-journal.conf +endif + VERSION_FILE := ./VERSION VERSION := $(shell grep -v ^\# $(VERSION_FILE)) COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true) @@ -83,6 +96,11 @@ ifeq ($(INIT),no) @echo "Installing systemd unit files..." $(foreach f,$(UNIT_FILES),$(call INSTALL_FILE,$f,$(UNIT_DIR))) endif +ifeq ($(TRACE_DEV_MODE),yes) + @echo "Installing systemd snippet files..." + @mkdir -p $(SNIPPET_DIR) + $(foreach f,$(SNIPPET_FILES),$(call INSTALL_FILE,$f,$(SNIPPET_DIR))) +endif build-image: # build an docker image for development