Struct daemonize::Daemonize [] [src]

pub struct Daemonize<T> { /* fields omitted */ }

Daemonization options.

Fork the process in the background, disassociate from its process group and the control terminal. Change umask value to 0o027, redirect all standard streams to /dev/null. Change working directory to / or provided value.

Optionally:

  • maintain and lock the pid-file;
  • drop user privileges;
  • drop group privileges;
  • change root directory;
  • change the pid-file ownership to provided user (and/or) group;
  • execute any provided action just before dropping privileges.

Methods

impl Daemonize<()>
[src]

[src]

impl<T> Daemonize<T>
[src]

[src]

Create pid-file at path, lock it exclusive and write daemon pid.

[src]

If chown is true, daemonize will change the pid-file ownership, if user or group are provided

[src]

Change working directory to path or / by default.

[src]

Drop privileges to user.

[src]

Drop privileges to group.

[src]

Change umask to mask or 0o027 by default.

[src]

Change root to path

[src]

Execute action just before dropping privileges. Most common usecase is to open listening socket. Result of action execution will be returned by start method.

[src]

Configuration for the child process's standard output stream.

[src]

Configuration for the child process's standard error stream.

[src]

Start daemonization process.

Trait Implementations

impl<T> Debug for Daemonize<T>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> !Send for Daemonize<T>

impl<T> !Sync for Daemonize<T>