diff --git a/greetd/src/server.rs b/greetd/src/server.rs index fda6ae2..bed6752 100644 --- a/greetd/src/server.rs +++ b/greetd/src/server.rs @@ -160,6 +160,7 @@ pub async fn main(config: Config) -> Result<(), Error> { let mut alarm = signal(SignalKind::alarm()).expect("unable to listen for SIGALRM"); let mut child = signal(SignalKind::child()).expect("unable to listen for SIGCHLD"); let mut term = signal(SignalKind::terminate()).expect("unable to listen for SIGTERM"); + let mut int = signal(SignalKind::interrupt()).expect("unable to listen for SIGINT"); loop { tokio::select! { @@ -169,6 +170,10 @@ pub async fn main(config: Config) -> Result<(), Error> { ctx.terminate().await.map_err(|e| format!("terminate: {}", e))?; break; } + _ = int.recv() => { + ctx.terminate().await.map_err(|e| format!("terminate: {}", e))?; + break; + } stream = listener.0.accept() => match stream { Ok((stream, _)) => { let client_ctx = ctx.clone();