Struct Pid1

Source
pub struct Pid1 { /* private fields */ }
Expand description

Pid1 provides process supervision over processes specified by rc_conf and rc.d.

Implementations§

Source§

impl Pid1

Source

pub fn new(options: Pid1Options) -> Result<Self, Error>

Create a new Pid1 from the provided options.

Source

pub fn shutdown(self) -> Result<(), Error>

Consume the pid1 and shut it down properly. First processes get the SIGTERM, then they get the SIGKILL. Will return only after all resources are reclaimed.

Source

pub fn reconfigure(&self, options: Pid1Options) -> Result<(), Error>

Reconfigure the Pid1 to use the new options. This will call reload after loading the new options.

Source

pub fn reload(&self) -> Result<(), Error>

Reload the configuration from the rc_conf and rc.d paths provided as of the last configuration.

Source

pub fn kill(&self, target: Target, signal: Signal) -> Result<(), Error>

Send the specified signal to all processes that match the target.

Source

pub fn list_services(&self) -> Vec<String>

List the available services.

Source

pub fn enabled_services(&self) -> Vec<String>

List the enabled services.

Source

pub fn start(&self, service: &str) -> Result<(), Error>

Start the named service.

Source

pub fn restart(&self, service: &str) -> Result<(), Error>

Stop then start the named service.

Source

pub fn stop(&self, service: &str) -> Result<(), Error>

Stop the named service.

Trait Implementations§

Source§

impl Debug for Pid1

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for Pid1

§

impl !RefUnwindSafe for Pid1

§

impl Send for Pid1

§

impl Sync for Pid1

§

impl Unpin for Pid1

§

impl !UnwindSafe for Pid1

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.