detached
Detach the current process in the background (daemonize).
def detached(
logfile: str = None,
pidfile: str = None,
uid: int, str = None,
gid: int, str = None,
umask: str, int = 0,
workdir: str = None,
fake: bool = False,
**opts: Any
) - > DaemonContext
Detach the current process in the background (daemonize).
Parameters
| Name | Type | Description |
|---|---|---|
| logfile | str = None | Optional path to a log file; the function verifies write access to this path before detaching. |
| pidfile | str = None | Optional path to a PID file; the process will exit if a lock exists for a currently running PID. |
| uid | int, str = None | Optional user ID or username used to set the effective user privileges of the child process. |
| gid | int, str = None | Optional group ID or group name used to set the effective group privileges of the child process. |
| umask | str, int = 0 | Optional file mode creation mask to be applied in the child process. |
| workdir | str = None | The working directory to change to after detaching; defaults to the current working directory. |
| fake | bool = False | If True, the process will not actually detach; this is intended for debugging purposes. |
| **opts | Any | Additional keyword arguments that are ignored by the function. |
Returns
| Type | Description |
|---|---|
DaemonContext | A context manager that handles the transition of the current process into a background daemon process. |