[−][src]Struct spirit_daemonize::UserDaemon
A stripped-down version of Daemon
without the user-switching options.
Sometimes, the daemon either needs to keep the root privileges or is started with the
appropriate user right away, therefore the user should not be able to configure the user
and
group
options.
This configuration fragment serves the role. Convert it to Daemon
first, by
into_daemon
(or using the Into
trait).
Examples
use spirit_daemonize::{Daemon, UserDaemon}; // No way to access the `pid_file` and others inside this thing and can't call `.daemonize()`. let user_daemon = UserDaemon::default(); let daemon: Daemon = user_daemon.into(); assert!(daemon.pid_file.is_none()); assert_eq!(daemon, Daemon::default());
Fields (Non-exhaustive)
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.pid_file: Option<PathBuf>
Where to store a PID file.
If not set, no PID file is created.
workdir: Option<PathBuf>
Switch to this working directory at startup.
If not set, working directory is not switched.
daemonize: bool
Enable the daemonization.
Even if this is false, some activity (setting PID file, etc) is still done, but it doesn't go to background.
Implementations
impl UserDaemon
[src]
pub fn into_daemon(self) -> Daemon
[src]
Trait Implementations
impl Clone for UserDaemon
[src]
fn clone(&self) -> UserDaemon
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for UserDaemon
[src]
impl Default for UserDaemon
[src]
fn default() -> UserDaemon
[src]
impl<'de> Deserialize<'de> for UserDaemon
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for UserDaemon
[src]
impl Fragment for UserDaemon
[src]
type Driver = OnceDriver<Self>
The default driver to be used by the fragment. Read more
type Resource = Daemonize
The actual product this Fragment
creates.
type Installer = DaemonizeInstaller
The default installer to be used unless a transformation or the user doesn't provide one. Read more
type Seed = ()
The intermediate product if the fragment supports two-stage creation of
Resource
s. If not, it can be set to ()
. Read more
fn make_seed(&self, _: &'static str) -> Result<(), AnyError>
[src]
fn make_resource(
&self,
_: &mut (),
_: &'static str
) -> Result<Daemonize, AnyError>
[src]
&self,
_: &mut (),
_: &'static str
) -> Result<Daemonize, AnyError>
const RUN_BEFORE_CONFIG: bool
[src]
fn create(
&self,
name: &'static str
) -> Result<Self::Resource, Box<dyn Error + 'static + Sync + Send>>
[src]
&self,
name: &'static str
) -> Result<Self::Resource, Box<dyn Error + 'static + Sync + Send>>
fn init<B>(
builder: B,
&'static str
) -> Result<B, Box<dyn Error + 'static + Sync + Send>> where
B: Extensible<Ok = B>,
<B as Extensible>::Config: DeserializeOwned,
<B as Extensible>::Config: Send,
<B as Extensible>::Config: Sync,
<B as Extensible>::Config: 'static,
<B as Extensible>::Opts: StructOpt,
<B as Extensible>::Opts: Send,
<B as Extensible>::Opts: Sync,
<B as Extensible>::Opts: 'static,
[src]
builder: B,
&'static str
) -> Result<B, Box<dyn Error + 'static + Sync + Send>> where
B: Extensible<Ok = B>,
<B as Extensible>::Config: DeserializeOwned,
<B as Extensible>::Config: Send,
<B as Extensible>::Config: Sync,
<B as Extensible>::Config: 'static,
<B as Extensible>::Opts: StructOpt,
<B as Extensible>::Opts: Send,
<B as Extensible>::Opts: Sync,
<B as Extensible>::Opts: 'static,
impl From<UserDaemon> for Daemon
[src]
fn from(ud: UserDaemon) -> Daemon
[src]
impl PartialEq<UserDaemon> for UserDaemon
[src]
fn eq(&self, other: &UserDaemon) -> bool
[src]
fn ne(&self, other: &UserDaemon) -> bool
[src]
impl Serialize for UserDaemon
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructDoc for UserDaemon
[src]
fn document() -> Documentation
[src]
impl StructuralEq for UserDaemon
[src]
impl StructuralPartialEq for UserDaemon
[src]
Auto Trait Implementations
impl RefUnwindSafe for UserDaemon
impl Send for UserDaemon
impl Sync for UserDaemon
impl Unpin for UserDaemon
impl UnwindSafe for UserDaemon
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,