Switch deprecated before_exec to pre_exec
See
@@ -261,18 +261,20 @@ pub trait Hook: fmt::Debug + Sized + Send {
&pkg.svc_user);
}
- cmd.before_exec(|| {
+ unsafe {
+ cmd.pre_exec(|| {
// Run in your own process group! This prevents terminal
// signals (e.g. ^C) sent to a Supervisor running in the
// foreground from being passed down to any running hooks,
// which could cause them to terminate prematurely, among
// other things.
- if unsafe { libc::setpgid(0, 0) } == 0 {
+ if libc::setpgid(0, 0) == 0 {
Ok(())
} else {
Err(IoError::last_os_error())
}
});
+ }
Ok(cmd.spawn()?)
}
