mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-02 16:21:28 +03:00
unix: send SIGTERM instead of killing the service (#59)
This commit is contained in:
committed by
GitHub
parent
4b6faea93a
commit
e155819542
@@ -39,6 +39,15 @@ pub fn run() -> Result<()> {
|
||||
let mut service = start_service()?;
|
||||
frontend::run_frontend(&config)?;
|
||||
log::info!("terminating service");
|
||||
#[cfg(unix)]
|
||||
{
|
||||
// on unix we give the service a chance to terminate gracefully
|
||||
let pid = service.id() as libc::pid_t;
|
||||
unsafe {
|
||||
libc::kill(pid, libc::SIGINT);
|
||||
}
|
||||
service.wait()?;
|
||||
}
|
||||
service.kill()?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user