Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
detached_scope.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <chrono>
8#include <cstddef>
9#include <string>
10
11namespace platf::detached_scope {
12
17 inline std::string unit_name(long hermes_pid, unsigned launch, std::size_t index) {
18 return "hermes-app-" + std::to_string(hermes_pid) + '-' + std::to_string(launch) + '-' + std::to_string(index) + ".scope";
19 }
20
28 inline std::string wrap(const std::string &systemd_run, const std::string &unit, std::chrono::seconds stop_timeout, const std::string &command) {
29 return systemd_run + " --user --scope --quiet --collect --unit=" + unit + " --property=TimeoutStopSec=" +
30 std::to_string(stop_timeout.count()) + " -- " + command;
31 }
32
33} // namespace platf::detached_scope
std::string unit_name(long hermes_pid, unsigned launch, std::size_t index)
std::string wrap(const std::string &systemd_run, const std::string &unit, std::chrono::seconds stop_timeout, const std::string &command)