Skip to content

Commit

Permalink
[wasm] fix SIGTERM handling
Browse files Browse the repository at this point in the history
Signed-off-by: Youtirsin <[email protected]>
  • Loading branch information
Youtirsin committed Sep 2, 2023
1 parent 5652258 commit 8f6e1b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wasm/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

use std::process::exit;

use containerd_shim::asynchronous::monitor::monitor_notify_by_pid;
use futures::StreamExt;
use log::{debug, error, warn};
Expand Down Expand Up @@ -57,7 +59,11 @@ async fn handle_signals(signals: Signals) {
let mut signals = signals.fuse();
while let Some(sig) = signals.next().await {
match sig {
libc::SIGTERM | libc::SIGINT => {
libc::SIGTERM => {
debug!("received {}", sig);
exit(sig);
}
libc::SIGINT => {
debug!("received {}", sig);
}
libc::SIGCHLD => loop {
Expand Down

0 comments on commit 8f6e1b5

Please sign in to comment.