MCPcopy Create free account
hub / github.com/corosync/corosync / kill_node

Function kill_node

bindings/rust/src/cfg.rs:208–224  ·  view source on GitHub ↗

Tell another cluster node to shutdown. reason is a string that will be written to the system log files.

(handle: &Handle, nodeid: NodeId, reason: &str)

Source from the content-addressed store, hash-verified

206/// Tell another cluster node to shutdown. reason is a string that
207/// will be written to the system log files.
208pub fn kill_node(handle: &Handle, nodeid: NodeId, reason: &str) -> Result<()> {
209 let c_string = {
210 match CString::new(reason) {
211 Ok(cs) => cs,
212 Err(_) => return Err(CsError::CsErrInvalidParam),
213 }
214 };
215
216 let res = unsafe {
217 ffi::corosync_cfg_kill_node(handle.cfg_handle, u32::from(nodeid), c_string.as_ptr())
218 };
219 if res == ffi::CS_OK {
220 Ok(())
221 } else {
222 Err(CsError::from_c(res))
223 }
224}
225
226/// Ask this cluster node to shutdown. If [ShutdownFlags] is set to Request then
227///it may be refused by other applications

Callers

nothing calls this directly

Calls 1

corosync_cfg_kill_nodeFunction · 0.85

Tested by

no test coverage detected