https://rancher.com/ logo
Title
w

worried-monkey-96416

05/17/2022, 1:26 PM
Hi, is there any way to enable verbose logging for cloud-init during the boot process to see what sections have actually been executed (passed
if
statements) from files in
/system/oem
and
/usr/local/cloud-config
and in what order?
r

ripe-mechanic-63260

05/18/2022, 10:48 AM
You can export
LOGLEVEL=debug
to see xtra debugging for yip
I wonder if we should just enable it by default, as it ends in the journal anyway
w

worried-monkey-96416

05/19/2022, 12:53 PM
I'm playing with the Alpine flavor so I wonder if the journal is preserved when switched from systemd in initrd to openrc init system on the real root. Even if so, it might be a challenge to explore journald logs on Alpine.
You can export
LOGLEVEL=debug
to see xtra debugging for yip
Where do you mean to export it?
r

ripe-mechanic-63260

05/19/2022, 12:55 PM
mmmh, I dont know how the alpine runs the cos-setup-X services which are the ones running the cloud-configs stored in the system
in any case, the logs should be sent to stdout, so the equivalent for openrc should allow tyou to see them
and for exporting, it should be done just before
elemental run-stage
commands are done
w

worried-monkey-96416

05/19/2022, 2:09 PM
I guess there is no straightforward way for doing this for
initramfs
and
rootfs
stages (
cos-setup-initramfs
and
cos-setup-rootfs
systemd services) which are executed in initrd. So initrd needs to be rebuilt to pass custom env vars to these units
I can't see any hooks here in systemd unit: https://github.com/rancher-sandbox/cOS-toolkit/blob/master/packages/cos-setup/cos-setup-initramfs.service I hoped that
elemental
itself supports different log levels controlled e.g. with cmdline args
r

ripe-mechanic-63260

05/19/2022, 2:12 PM
well, elemental uses the yip lib underneath to run the cloud-config stuff, so that is itws own thing
but maybe we should hook up the LOGLEVEL=true to our debug flag so it reports everything
you could also once booted, run
LOGLEVEL=true elemental run-stage "STAGE"
so it re-runs those stages
­čĹŹ 1