我有一个自动安装配置:
#cloud-config
autoinstall:
version: 1
late-commands:
- curtin in-target --interactive --target=/target -- echo "Hello! This is output from late-commands"在执行迟来的命令时,它将打印:
finish: subiquity/Late/run/command_0: curtin in-target --interactive --target=/target -- echo "Hello! This is output from late-commands"有没有办法让它也打印一个迟来的命令的输出?我想调试late-commands。
发布于 2021-02-22 14:32:09
我在安装错误时在/var/log/syslog自动安装配置部分打印error-commands:
#cloud-config
autoinstall:
late-commands:
- echo "This is the error to debug" && exit 125
error-commands:
- tail -200 /var/log/syslog此subiquity代码处理early-commands、late-commands和error-commands:https://github.com/CanonicalLtd/subiquity/blob/a76581cd2b973b55e55c6ac05b5bf47168493140/subiquity/server/controllers/cmdlist.py#L77-L120
这些自动安装键如何处理输出:
early-commands - echo+sysloglate-commands - syslogerror-commands - echo+syslog (如果自动安装其他系统日志)因此,在late-commands中,我无法回显控制台。但是,只要我运行的是一个非交互式的自动安装,我就可以从error-commands回音。我使用它打印syslog的最后一行,其中包含完整的错误消息:This is the error to debug。
https://askubuntu.com/questions/1318118
复制相似问题