Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Debugging

James O. D. Hunt edited this page Nov 4, 2016 · 18 revisions

Runtime

To enable full debug for cc-oci-runtime when running under docker, follow the instructions below.

Note that enabling debug is slightly awkward in this scenario due to the fact that docker does not currently provide a way to pass extra command-line options to the runtime. To get around this restriction, the runtime provides a helper script called cc-oci-runtime.sh which reads extra arguments to pass to the runtime from /etc/cc-oci-runtime/cc-oci-runtime.sh.cfg on a normal system.

# Adjust directory as required
$ logdir=/tmp/cc-oci-runtime
$ sudo mkdir -p "$logdir"

# Create the configuration directory
$ sudo mkdir -p /etc/cc-oci-runtime/

# Create the config file containing the extra command-line arguments to be
# passed to the real runtime.
$ cat << EOT | sudo tee -a /etc/cc-oci-runtime/cc-oci-runtime.sh.cfg
--debug
--global-log
$logdir/cc-oci-runtime.log
--hypervisor-log-dir
$logdir
EOT

# Tell docker to run the helper script as the runtime.
# This script will launch the real runtime with the correct arguments.
$ sudo sed -i -e 's!/usr/bin/cc-oci-runtime!/usr/bin/cc-oci-runtime.sh!g' /lib/systemd/system/docker-cor.service

# Apply
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker-cor

Full instructions on how to use the helper script are at the top of the script itself:

$ more /usr/bin/cc-oci-runtime.sh