File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -60,14 +60,22 @@ if limactl ls -q | grep -q "$NAME"; then
60
60
exit 1
61
61
fi
62
62
63
+ function diagnose() {
64
+ NAME=" $1 "
65
+ set -x +e
66
+ tail " $HOME /.lima/${NAME} " /* .log
67
+ limactl shell " $NAME " systemctl status
68
+ limactl shell " $NAME " systemctl
69
+ limactl shell " $NAME " sudo cat /var/log/cloud-init-output.log
70
+ set +x -e
71
+ }
72
+
63
73
INFO " Starting \" $NAME \" from \" $FILE \" "
64
74
trap ' limactl delete -f $NAME' EXIT
65
75
set -x
66
76
if ! limactl start --tty=false " $FILE " ; then
67
77
ERROR " Failed to start \" $NAME \" "
68
- tail " $HOME /.lima/${NAME} " /* .log
69
- limactl shell " $NAME " systemctl status || true
70
- limactl shell " $NAME " cat /var/log/cloud-init-output.log || true
78
+ diagnose " $NAME "
71
79
exit 1
72
80
fi
73
81
@@ -93,7 +101,7 @@ if [[ -n ${CHECKS["systemd"]} ]]; then
93
101
set -x
94
102
if ! limactl shell " $NAME " systemctl is-system-running --wait; then
95
103
ERROR ' "systemctl is-system-running" failed'
96
- limactl shell " $NAME " systemctl
104
+ diagnose " $NAME "
97
105
if [[ -z ${CHECKS["systemd-strict"]} ]]; then
98
106
INFO ' Ignoring "systemctl is-system-running" failure'
99
107
else
You can’t perform that action at this time.
0 commit comments