From 37ddf42b5bbd989e3c4b327c316c45bbdef67b2d Mon Sep 17 00:00:00 2001 From: Magnus Skjegstad Date: Thu, 11 May 2017 21:00:38 +0200 Subject: [PATCH] logging: add log capture to onboot and service startup Signed-off-by: Magnus Skjegstad --- projects/logging/pkg/init/etc/init.d/containers | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/logging/pkg/init/etc/init.d/containers b/projects/logging/pkg/init/etc/init.d/containers index 982a1bafc..fefaf9d25 100755 --- a/projects/logging/pkg/init/etc/init.d/containers +++ b/projects/logging/pkg/init/etc/init.d/containers @@ -1,5 +1,9 @@ #!/bin/sh +# start memlogd container + +/usr/bin/startmemlogd + # start onboot containers, run to completion if [ -d /containers/onboot ] @@ -9,7 +13,7 @@ then base="$(basename $f)" /bin/mount --bind "$f/rootfs" "$f/rootfs" mount -o remount,rw "$f/rootfs" - /usr/bin/runc run --bundle "$f" "$(basename $f)" + /usr/bin/logwrite -n "$(basename $f)" /usr/bin/runc run --bundle "$f" "$(basename $f)" printf " - $base\n" done fi @@ -24,7 +28,7 @@ then /bin/mount --bind "$f/rootfs" "$f/rootfs" mount -o remount,rw "$f/rootfs" log="/var/log/$base.log" - ctr run --runtime-config "$f/config.json" --rootfs "$f/rootfs" --id "$(basename $f)" $log >$log & + /usr/bin/logwrite -n "$(basename $f)" ctr run --runtime-config "$f/config.json" --rootfs "$f/rootfs" --id "$(basename $f)" $log >$log & printf " - $base\n" done fi