Skip to main content

Crate platform

Crate platform 

Source
Expand description

Where Dreamer keeps per-user runtime and state files, and the checks that keep them private (owner-restricted runtime directories and sockets).

DirectoryDefaultOverride
runtime (socket, lock)$XDG_RUNTIME_DIR/dreamer, else $TMPDIR/dreamer-<uid>, else /tmp/dreamer-<uid>DREAMER_RUNTIME_DIR
state (log, action ledger)$XDG_STATE_HOME/dreamer, else ~/.local/state/dreamerDREAMER_STATE_DIR
data (managed agent installs, Dreamer Web)$XDG_DATA_HOME/dreamer, else ~/.local/share/dreamerDREAMER_DATA_DIR

Constants§

SOCKET_PATH_MAX
The longest Unix socket path the system accepts, in bytes (the size of sun_path, less its terminating NUL).

Functions§

check_socket_path
Refuse a socket path the system could not bind, before trying, with a reason a person can act on.
data_dir
Data Dreamer installs and keeps for the user, such as managed agent harnesses and the Dreamer Web component. The same place on macOS and Linux.
detach_session
Detach from the launching terminal: a new session has no controlling terminal, so closing the terminal or SSH session sends it no hangup.
heap_in_use
Bytes the allocator has handed out and not had back, without the freed memory it keeps for reuse: what a process really holds, where resident size also counts retained free pages. None where it cannot tell.
ledger_path
lock_holder
The pid recorded in the daemon’s startup lock, if any.
lock_path
log_path
owner_only
Restrict a file (the socket, the log) to its owner.
phys_footprint
A process’s physical footprint on macOS, in bytes: the memory the kernel charges it for (dirty and compressed pages, as Activity Monitor shows), which leaves out free pages the allocator still has mapped but that resident size counts. None elsewhere, or when the process is gone or belongs to another user.
private_dir
Create dir (mode 0700) or check that the existing one belongs to this user and is closed to everyone else. Never loosens or takes over a directory it does not own.
process_alive
Whether a process with this pid exists.
release_free_memory
Hand memory that the allocator holds but no longer uses back to the system: glibc’s malloc_trim, or macOS’s malloc pressure relief. A daemon that has just dropped many terminal mirrors calls this so its resident size shrinks with them. Elsewhere it does nothing.
rpc_socket_path
The JSON-RPC endpoint, beside the native socket.
runtime_dir
session_of
The session a process belongs to (diagnostics and tests).
socket_path
state_dir
terminate
Ask a process to stop (SIGTERM).
terminate_group
Signal a whole process group: SIGTERM, or SIGKILL with force.
uid