Need cockpit.spawn() to wait till the command (bash script with a couple of arguments) provided completes its execution entirely #19606
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
No, this isn't what happens. Two theories: (1) you don't |
Beta Was this translation helpful? Give feedback.
-
Very nice, cheers! |
Beta Was this translation helpful? Give feedback.
No, this isn't what happens.
cockpit.spawn().then(() => console.log("done"))
, or alternatively,await cockpit.spawn()
really does wait until the process finishes. You can save the result of spawn into a variable, and add some console.log() messages to follow when it finishes or catches.Two theories: (1) you don't
await
the call ofdoReplicaOfImage()
? (2) Your manage_image.sh script is failing early? I suggest addingset -x
and writing it to the console.