Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
detached_scope.h File Reference

Run an app's detached commands in transient systemd scopes. More...

#include <chrono>
#include <cstddef>
#include <string>
Include dependency graph for detached_scope.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string platf::detached_scope::unit_name (long hermes_pid, unsigned launch, std::size_t index)
std::string platf::detached_scope::wrap (const std::string &systemd_run, const std::string &unit, std::chrono::seconds stop_timeout, const std::string &command)

Detailed Description

Run an app's detached commands in transient systemd scopes.

Definition in file detached_scope.h.

Function Documentation

◆ unit_name()

std::string platf::detached_scope::unit_name ( long hermes_pid,
unsigned launch,
std::size_t index )
inline

The unit a detached command of one launch runs in: unique per Hermes process, launch and command, and a valid unit name for any input.

Definition at line 17 of file detached_scope.h.

◆ wrap()

std::string platf::detached_scope::wrap ( const std::string & systemd_run,
const std::string & unit,
std::chrono::seconds stop_timeout,
const std::string & command )
inline

The command line that runs command in the transient scope unit of the user's systemd manager. systemd-run –scope executes it in place, so its pid is the one Hermes started, and everything it starts stays in the scope whether it forks, calls setsid or enters a container. Stopping the unit sends them all SIGTERM, then SIGKILL after stop_timeout.

Definition at line 28 of file detached_scope.h.