Skip to content

Commit 4363cc6

Browse files
committed
DEBUG
1 parent 9d88718 commit 4363cc6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

components/workspacekit/cmd/rings.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ var ring0Cmd = &cobra.Command{
8080

8181
defer log.Info("ring0 stopped")
8282

83+
defer func() {
84+
log.Info("ring0 ---- start sleeping")
85+
time.Sleep(20 * time.Minute)
86+
log.Info("ring0 ---- end sleeping")
87+
}()
88+
8389
ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
8490
defer cancel()
8591

@@ -97,6 +103,7 @@ var ring0Cmd = &cobra.Command{
97103
client.Close()
98104

99105
defer func() {
106+
log.Info("start connect to daemon")
100107
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
101108
defer cancel()
102109

@@ -111,6 +118,7 @@ var ring0Cmd = &cobra.Command{
111118
if err != nil {
112119
log.WithError(err).Error("cannot trigger teardown")
113120
}
121+
log.Info("end connect to daemon")
114122
}()
115123

116124
cmd := exec.Command("/proc/self/exe", "ring1")
@@ -154,6 +162,7 @@ var ring0Cmd = &cobra.Command{
154162
if cmd.Process == nil {
155163
return
156164
}
165+
log.WithField("status", cmd.ProcessState).WithField("pid", cmd.Process.Pid).Info("process status")
157166

158167
log.Warn("ring1 did not shut down in time - sending sigkill")
159168
err = cmd.Process.Kill()
@@ -170,6 +179,9 @@ var ring0Cmd = &cobra.Command{
170179
}()
171180

172181
err = cmd.Wait()
182+
if err != nil {
183+
log.WithError(err).Info("unexpected exit")
184+
}
173185
if eerr, ok := err.(*exec.ExitError); ok {
174186
state, ok := eerr.ProcessState.Sys().(syscall.WaitStatus)
175187
if ok && state.Signal() == syscall.SIGKILL {

0 commit comments

Comments
 (0)