From 5bfc36d8f63eff9388577e1954f11642a9f32a46 Mon Sep 17 00:00:00 2001 From: Manohar Castelino Date: Fri, 29 Sep 2017 15:51:46 -0700 Subject: [PATCH] Debug: Provide a way to enable a debug console to the VM Provide an additional unit file to enable a debug console. Also provide an additional agent service file variant that can be used to launch the VM in debug mode. The console can be attached using socat console.sock - Fixes #123 Signed-off-by: Manohar Castelino --- Makefile | 4 ++-- clear-containers-debug.service.in | 10 ++++++++++ clear-containers-debug.target | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 clear-containers-debug.service.in create mode 100644 clear-containers-debug.target diff --git a/Makefile b/Makefile index 7bd0c445a..12b5a4874 100644 --- a/Makefile +++ b/Makefile @@ -29,9 +29,9 @@ HAVE_SYSTEMD := $(shell pkg-config --exists systemd 2>/dev/null && echo 'yes') ifeq ($(HAVE_SYSTEMD),yes) UNIT_DIR := $(shell pkg-config --variable=systemdsystemunitdir systemd) -UNIT_FILES = clear-containers.service +UNIT_FILES = clear-containers.service clear-containers-debug.service GENERATED_FILES := $(UNIT_FILES) -UNIT_FILES += clear-containers.target +UNIT_FILES += clear-containers.target clear-containers-debug.target endif SED = sed diff --git a/clear-containers-debug.service.in b/clear-containers-debug.service.in new file mode 100644 index 000000000..37469fb87 --- /dev/null +++ b/clear-containers-debug.service.in @@ -0,0 +1,10 @@ +[Unit] +Description=Clear Container debug console + +[Service] +Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +StandardInput=tty +StandardOutput=tty +PrivateDevices=yes +Type=simple +ExecStart=/usr/bin/bash diff --git a/clear-containers-debug.target b/clear-containers-debug.target new file mode 100644 index 000000000..b2483594d --- /dev/null +++ b/clear-containers-debug.target @@ -0,0 +1,8 @@ +[Unit] +Description=Clear Containers Agent Target +Requires=basic.target +Requires=clear-containers.service +Wants=clear-containers-debug-console.service +Conflicts=rescue.service rescue.target +After=basic.target rescue.service rescue.target +AllowIsolate=yes