Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
prelogin.cpp
Go to the documentation of this file.
1
5// standard includes
6#include <algorithm>
7#include <array>
8#include <cctype>
9#include <cstdlib>
10#include <filesystem>
11#include <fstream>
12#include <iostream>
13#include <iterator>
14#include <optional>
15#include <sstream>
16#include <vector>
17
18// lib includes
19#include <grp.h>
20#include <pwd.h>
21#include <sys/stat.h>
22#include <unistd.h>
23
24// local includes
25#include "prelogin.h"
26#include "src/config.h"
27#include "src/logging.h"
28#include "src/utility.h"
29#include "virtual_display.h"
30
31using namespace std::literals;
32namespace fs = std::filesystem;
33
34namespace platf::prelogin {
35
36 namespace {
37
38 constexpr auto generated_marker = "# hermes-prelogin: generated"sv;
39
41 constexpr std::array session_targets {
42 "graphical-session.target"sv,
43 "graphical-session-pre.target"sv,
44 "xdg-desktop-autostart.target"sv,
45 };
46
48 constexpr std::array dependency_keys {
49 "After"sv,
50 "Before"sv,
51 "Wants"sv,
52 "Requires"sv,
53 "Requisite"sv,
54 "BindsTo"sv,
55 "PartOf"sv,
56 "Upholds"sv,
57 };
58
59 constexpr auto docs_pointer = "The steps are in docs/getting_started.md, under \"Before anyone logs in\"."sv;
60
61 std::string_view trim(std::string_view text) {
62 while (!text.empty() && std::isspace(static_cast<unsigned char>(text.front()))) {
63 text.remove_prefix(1);
64 }
65 while (!text.empty() && std::isspace(static_cast<unsigned char>(text.back()))) {
66 text.remove_suffix(1);
67 }
68 return text;
69 }
70
71 std::string lower(std::string_view text) {
72 std::string out {text};
73 std::transform(out.begin(), out.end(), out.begin(), [](unsigned char c) {
74 return static_cast<char>(std::tolower(c));
75 });
76 return out;
77 }
78
79 std::vector<std::string_view> lines_of(std::string_view text) {
80 std::vector<std::string_view> lines;
81 while (!text.empty()) {
82 const auto end = text.find('\n');
83 lines.push_back(text.substr(0, end));
84 if (end == std::string_view::npos) {
85 break;
86 }
87 text.remove_prefix(end + 1);
88 }
89 return lines;
90 }
91
92 std::optional<std::string> read_file(const fs::path &path) {
93 std::ifstream in {path, std::ios::binary};
94 if (!in) {
95 return std::nullopt;
96 }
97 return std::string {std::istreambuf_iterator<char> {in}, std::istreambuf_iterator<char> {}};
98 }
99
100 std::string env_or(const char *name, const std::string &fallback) {
101 const char *value = std::getenv(name);
102 return value && *value ? std::string {value} : fallback;
103 }
104
105 std::string home() {
106 if (const char *value = std::getenv("HOME"); value && *value) {
107 return value;
108 }
109 if (const auto *account = ::getpwuid(::getuid()); account && account->pw_dir) {
110 return account->pw_dir;
111 }
112 return {};
113 }
114
115 fs::path user_unit_dir() {
116 return fs::path {env_or("XDG_CONFIG_HOME", home() + "/.config")} / "systemd" / "user";
117 }
118
120 fs::path linger_marker() {
121 return fs::path {env_or("XDG_STATE_HOME", home() + "/.local/state")} / "hermes" / "prelogin-linger";
122 }
123
124 struct packaged_unit_t {
125 std::string name;
126 fs::path path;
127 };
128
135 std::optional<packaged_unit_t> find_packaged_unit() {
136 std::error_code ec;
137 for (const char *name : {"hermes.service", "sunshine.service"}) {
138 for (const char *dir : {"/etc/systemd/user", "/usr/local/lib/systemd/user", "/usr/lib/systemd/user"}) {
139 const auto path = fs::path {dir} / name;
140 if (fs::is_regular_file(path, ec)) {
141 return packaged_unit_t {name, path};
142 }
143 }
144 }
145 return std::nullopt;
146 }
147
155 std::optional<bool> opens_without_seat_grant(const fs::path &node, bool write_required = true) {
156 struct stat info {};
157 if (::stat(node.c_str(), &info) != 0) {
158 return std::nullopt;
159 }
160 const uid_t uid = ::getuid();
161 if (info.st_uid == uid) {
162 return (info.st_mode & S_IRUSR) && (!write_required || (info.st_mode & S_IWUSR));
163 }
164
165 const auto *account = ::getpwuid(uid);
166 std::vector<gid_t> groups;
167 if (account) {
168 int count = 64;
169 groups.resize(static_cast<size_t>(count));
170 if (::getgrouplist(account->pw_name, account->pw_gid, groups.data(), &count) < 0) {
171 groups.resize(static_cast<size_t>(count));
172 ::getgrouplist(account->pw_name, account->pw_gid, groups.data(), &count);
173 }
174 groups.resize(static_cast<size_t>(std::max(count, 0)));
175 }
176 if (std::find(groups.begin(), groups.end(), info.st_gid) != groups.end()) {
177 return (info.st_mode & S_IRGRP) && (!write_required || (info.st_mode & S_IWGRP));
178 }
179 return (info.st_mode & S_IROTH) && (!write_required || (info.st_mode & S_IWOTH));
180 }
181
182 std::optional<bool> hermes_kms_opens_without_seat_grant() {
183 std::error_code ec;
184 std::optional<bool> result;
185 for (const auto &entry : fs::directory_iterator {"/sys/class/drm", ec}) {
186 const auto name = entry.path().filename().string();
187 if (!name.starts_with("renderD")) {
188 continue;
189 }
190 const auto driver = fs::read_symlink(entry.path() / "device" / "driver", ec);
191 if (ec || driver.filename() != "hermes-kms") {
192 ec.clear();
193 continue;
194 }
195 // Hermes-KMS private ioctls need only an O_RDONLY render fd. The
196 // packaged driver reserves O_RDWR for root so generic GPU probes skip
197 // this capture-only node.
198 const auto opens = opens_without_seat_grant(fs::path {"/dev/dri"} / name, false);
199 if (opens.value_or(false)) {
200 return true;
201 }
202 if (opens) {
203 result = false;
204 }
205 }
206 return result;
207 }
208
210 void append_conf_dir(const fs::path &dir, std::vector<std::string> &files) {
211 std::error_code ec;
212 std::vector<fs::path> paths;
213 for (const auto &entry : fs::directory_iterator {dir, ec}) {
214 if (entry.path().extension() == ".conf") {
215 paths.push_back(entry.path());
216 }
217 }
218 std::sort(paths.begin(), paths.end());
219 for (const auto &path : paths) {
220 if (auto text = read_file(path)) {
221 files.push_back(std::move(*text));
222 }
223 }
224 }
225
226 const char *marker_for(state_e state) {
227 switch (state) {
228 case state_e::ready:
229 return "ok ";
230 case state_e::missing:
231 return "missing";
232 case state_e::unknown:
233 return "unknown";
234 case state_e::note:
235 return "note ";
236 }
237 return " ";
238 }
239
240 void print(const report_t &report) {
241 std::cout << "Reaching this machine before anyone logs in: "
242 << (report.ready ? "ready" : report.enabled ? "set to start at boot, but not ready" : "not set up")
243 << "\n\n";
244 for (const auto &check : report.checks) {
245 std::cout << " " << marker_for(check.state) << " " << check.title << ": " << check.detail << '\n';
246 if (!check.fix.empty()) {
247 std::cout << " -> " << check.fix << '\n';
248 }
249 }
250 std::cout << std::endl;
251 }
252
254 bool run(const std::string &command) {
255 bool timed_out = false;
256 if (VDISPLAY::boundedCommandOutput(command + " >/dev/null 2>&1", 30s, &timed_out)) {
257 return true;
258 }
259 std::cerr << (timed_out ? "Timed out: " : "Failed: ") << command << std::endl;
260 return false;
261 }
262
263 int usage(const char *name) {
264 std::cerr << "Usage: " << name << " --prelogin status|enable|disable\n\n"
265 << " status say what stands between this machine and being reachable before login\n"
266 << " enable start Hermes with your user manager, and that manager at boot\n"
267 << " disable go back to starting Hermes with the graphical session\n"
268 << std::endl;
269 return 2;
270 }
271
272 int enable() {
273 const auto packaged = find_packaged_unit();
274 if (!packaged) {
275 std::cerr << "No packaged hermes.service or sunshine.service was found to start at boot." << std::endl;
276 return 1;
277 }
278 const auto source = read_file(packaged->path);
279 if (!source) {
280 std::cerr << "Cannot read " << packaged->path.string() << '.' << std::endl;
281 return 1;
282 }
283
284 const auto target = user_unit_dir() / packaged->name;
285 if (const auto existing = read_file(target); existing && !is_generated_unit(*existing)) {
286 std::cerr << target.string() << " is a unit of your own, and this would replace it. Move it away first."
287 << std::endl;
288 return 1;
289 }
290
291 std::error_code ec;
292 fs::create_directories(target.parent_path(), ec);
293 {
294 std::ofstream out {target, std::ios::binary | std::ios::trunc};
295 out << from_boot_unit(*source, packaged->path.string());
296 if (!out) {
297 std::cerr << "Cannot write " << target.string() << '.' << std::endl;
298 return 1;
299 }
300 }
301 if (!run("systemctl --user daemon-reload") || !run("systemctl --user enable " + packaged->name)) {
302 return 1;
303 }
304
305 if (!collect_facts().linger.value_or(false)) {
306 if (!run("loginctl enable-linger")) {
307 return 1;
308 }
309 const auto marker = linger_marker();
310 fs::create_directories(marker.parent_path(), ec);
311 std::ofstream {marker} << "enabled by hermes --prelogin\n";
312 }
313
314 const auto result = report();
315 print(result);
316 std::cout << "This takes effect the next time Hermes starts: at the next boot, or with\n"
317 << "`systemctl --user restart " << packaged->name << "`, which ends a stream in progress." << std::endl;
318 return result.ready ? 0 : 1;
319 }
320
321 int disable() {
322 std::error_code ec;
323 const auto packaged = find_packaged_unit();
324 if (packaged) {
325 const auto target = user_unit_dir() / packaged->name;
326 if (const auto existing = read_file(target)) {
327 if (!is_generated_unit(*existing)) {
328 std::cerr << target.string() << " is a unit of your own; it was left as it is." << std::endl;
329 } else {
330 // While the copy still exists, so that its default.target link is
331 // the one removed.
332 run("systemctl --user disable " + packaged->name);
333 fs::remove(target, ec);
334 run("systemctl --user daemon-reload");
335 run("systemctl --user enable " + packaged->name);
336 }
337 }
338 }
339
340 const auto marker = linger_marker();
341 if (fs::exists(marker, ec)) {
342 run("loginctl disable-linger");
343 fs::remove(marker, ec);
344 }
345
346 print(report());
347 return 0;
348 }
349
350 } // namespace
351
352 std::string state_name(state_e state) {
353 switch (state) {
354 case state_e::ready:
355 return "ready";
356 case state_e::missing:
357 return "missing";
358 case state_e::unknown:
359 return "unknown";
360 case state_e::note:
361 return "note";
362 }
363 return "unknown";
364 }
365
366 bool is_generated_unit(std::string_view unit) {
367 for (const auto line : lines_of(unit)) {
368 if (trim(line) == generated_marker) {
369 return true;
370 }
371 }
372 return false;
373 }
374
375 bool unit_waits_for_session(std::string_view unit) {
376 for (const auto raw : lines_of(unit)) {
377 const auto line = trim(raw);
378 if (line.empty() || line.front() == '#' || line.front() == ';') {
379 continue;
380 }
381 const auto equals = line.find('=');
382 if (equals == std::string_view::npos) {
383 continue;
384 }
385 std::istringstream words {std::string {line.substr(equals + 1)}};
386 for (std::string word; words >> word;) {
387 if (std::find(session_targets.begin(), session_targets.end(), word) != session_targets.end()) {
388 return true;
389 }
390 }
391 }
392 return false;
393 }
394
395 std::string from_boot_unit(std::string_view packaged_unit, std::string_view source_path) {
396 std::ostringstream out;
397 out << generated_marker << '\n'
398 << "# Written by `hermes --prelogin enable` from " << source_path << ": the same\n"
399 << "# service, started with the user manager instead of the graphical session, so\n"
400 << "# that it is running before anyone logs in. `hermes --prelogin disable`\n"
401 << "# removes this file; changes made here are lost the next time it is written.\n";
402
403 std::string section;
404 bool restart_seen = false;
405 bool install_written = false;
406
407 // What a section owes the unit once all of its own lines are through.
408 const auto close_section = [&]() {
409 if (section == "[Service]" && !restart_seen) {
410 out << "Restart=on-failure\nRestartSec=5s\n";
411 }
412 if (section == "[Install]") {
413 out << "WantedBy=default.target\n";
414 install_written = true;
415 }
416 };
417
418 for (const auto raw : lines_of(packaged_unit)) {
419 const auto line = trim(raw);
420 // The packaged comments explain a unit that waits for the session.
421 if (line.empty() || line.front() == '#' || line.front() == ';') {
422 continue;
423 }
424 if (line.front() == '[' && line.back() == ']') {
425 close_section();
426 section = std::string {line};
427 out << '\n' << section << '\n';
428 continue;
429 }
430
431 const auto equals = line.find('=');
432 const auto key = trim(line.substr(0, equals));
433 const auto value = equals == std::string_view::npos ? std::string_view {} : trim(line.substr(equals + 1));
434
435 if (section == "[Unit]" && std::find(dependency_keys.begin(), dependency_keys.end(), key) != dependency_keys.end()) {
436 std::string kept;
437 std::istringstream words {std::string {value}};
438 for (std::string word; words >> word;) {
439 if (std::find(session_targets.begin(), session_targets.end(), word) == session_targets.end()) {
440 kept += kept.empty() ? word : ' ' + word;
441 }
442 }
443 if (!kept.empty()) {
444 out << key << '=' << kept << '\n';
445 }
446 continue;
447 }
448 if (section == "[Install]" && (key == "WantedBy" || key == "RequiredBy" || key == "UpheldBy")) {
449 continue;
450 }
451 if (section == "[Service]" && key == "Restart") {
452 restart_seen = true;
453 }
454 out << line << '\n';
455 }
456 close_section();
457 if (!install_written) {
458 out << "\n[Install]\nWantedBy=default.target\n";
459 }
460 return out.str();
461 }
462
463 sddm_settings_t sddm_settings(const std::vector<std::string> &files) {
464 sddm_settings_t settings;
465 for (const auto &file : files) {
466 std::string section;
467 for (const auto raw : lines_of(file)) {
468 const auto line = trim(raw);
469 if (line.empty() || line.front() == '#' || line.front() == ';') {
470 continue;
471 }
472 if (line.front() == '[' && line.back() == ']') {
473 section = lower(line);
474 continue;
475 }
476 const auto equals = line.find('=');
477 if (equals == std::string_view::npos) {
478 continue;
479 }
480 const auto key = lower(trim(line.substr(0, equals)));
481 const auto value = trim(line.substr(equals + 1));
482 if (section == "[general]" && key == "displayserver") {
483 settings.display_server = lower(value);
484 } else if (section == "[autologin]" && key == "user") {
485 settings.autologin_user = std::string {value};
486 }
487 }
488 }
489 return settings;
490 }
491
492 report_t assess(const facts_t &facts) {
494 report.enabled = facts.unit_from_boot && facts.unit_enabled;
495
496 const auto add = [&report](std::string id, state_e state, std::string title, std::string detail, std::string fix = {}) {
497 report.checks.push_back({std::move(id), state, std::move(title), std::move(detail), std::move(fix)});
498 return state == state_e::ready;
499 };
500 const auto user = facts.user.empty() ? "this user"s : facts.user;
501 bool ready = true;
502
503 if (facts.unit_name.empty()) {
504 ready &= add("unit", state_e::missing, "Start at boot", "No packaged hermes.service or sunshine.service was found, so there is no unit to start at boot.", "Install Hermes from a package, or write a user unit that starts it from default.target.");
505 } else if (report.enabled) {
506 ready &= add("unit", state_e::ready, "Start at boot", facts.unit_name + (facts.unit_generated ? " starts with the user manager." : " is a unit of your own that starts with the user manager."));
507 } else {
508 ready &= add("unit", state_e::missing, "Start at boot", facts.unit_name + " starts with the graphical session, and there is none before login.", "Run `hermes --prelogin enable`.");
509 }
510
511 if (!facts.linger) {
512 ready &= add("linger", state_e::unknown, "User manager at boot", "Whether the user manager for " + user + " runs from boot could not be read.");
513 } else if (*facts.linger) {
514 ready &= add("linger", state_e::ready, "User manager at boot", "The user manager for " + user + " runs from boot.");
515 } else {
516 ready &= add("linger", state_e::missing, "User manager at boot", "The user manager for " + user + " only runs while they are logged in.", "Run `hermes --prelogin enable`, or `loginctl enable-linger " + user + "`.");
517 }
518
519 if (facts.display_manager.empty()) {
520 ready &= add("greeter", state_e::unknown, "Login screen", "No display manager is enabled, so there is no login screen to stream.");
521 } else if (facts.display_manager == "sddm") {
522 if (!facts.sddm) {
523 ready &= add("greeter", state_e::unknown, "Login screen", "SDDM's configuration could not be read.");
524 } else if (facts.sddm->display_server == "wayland") {
525 ready &= add("greeter", state_e::ready, "Login screen", "SDDM uses its Wayland greeter, which lights a new output by itself.");
526 } else {
527 ready &= add("greeter", state_e::missing, "Login screen", "SDDM uses its X11 greeter, which never lights a virtual display.", "As root, set DisplayServer=wayland for SDDM, in /etc/sddm.conf too if it is set there. " + std::string {docs_pointer});
528 }
529 if (facts.sddm && !facts.sddm->autologin_user.empty()) {
530 add("autologin", state_e::note, "Autologin", "SDDM logs " + facts.sddm->autologin_user + " in by itself, so the login screen is never shown and none of this is used while that stays on.");
531 }
532 } else if (facts.display_manager == "plasmalogin") {
533 // Plasma Login Manager's greeter is KWin on Wayland. Seen on CachyOS:
534 // Hermes started before login, made a Hermes-KMS virtual display, and
535 // the greeter drew the login screen on it.
536 ready &= add("greeter", state_e::ready, "Login screen", "Plasma Login Manager's greeter runs on KWin Wayland, which lights a new output by itself.");
537 } else if (facts.display_manager == "gdm") {
538 ready &= add("greeter", state_e::unknown, "Login screen", "GDM's greeter is a Wayland session and should light a new output, but it has not been run with Hermes.");
539 } else {
540 ready &= add("greeter", state_e::unknown, "Login screen", facts.display_manager + " has not been run with Hermes; its greeter has to light a new output by itself.");
541 }
542
543 if (!facts.input_without_session) {
544 ready &= add("input", state_e::unknown, "Input before login", "/dev/uinput was not found.");
545 } else if (*facts.input_without_session) {
546 ready &= add("input", state_e::ready, "Input before login", "Hermes can create its keyboard and mouse with no session of its own.");
547 } else {
548 ready &= add("input", state_e::missing, "Input before login", "/dev/uinput is granted to whoever is on the seat, which before login is the greeter.", "Run `sudo usermod -aG input " + user + "` and reboot.");
549 }
550
551 if (facts.virtual_display_backend != "hermes_kms") {
552 ready &= add("virtual_display", state_e::missing, "Virtual display", "Only the Hermes-KMS virtual display has been run before login; this host is set to '" + facts.virtual_display_backend + "'.", "Set virtual_display_backend to hermes_kms.");
553 } else if (!facts.hermes_kms_without_session) {
554 ready &= add("virtual_display", state_e::unknown, "Virtual display", "No Hermes-KMS device was found.", "Install and load the Hermes-KMS driver.");
555 } else if (*facts.hermes_kms_without_session) {
556 ready &= add("virtual_display", state_e::ready, "Virtual display", "The Hermes-KMS device opens with no session.");
557 } else {
558 ready &= add("virtual_display", state_e::missing, "Virtual display", "The Hermes-KMS device belongs to root until someone is on the seat.", "Run `sudo /usr/lib/hermes-kms/hermes-kms-setup configure --user auto`, from the hermes-kms-seatd package (hermes-kms-seatd-git on Arch).");
559 }
560
561 report.ready = ready;
562 return report;
563 }
564
566 facts_t facts;
567 std::error_code ec;
568
569 if (const auto *account = ::getpwuid(::getuid()); account && account->pw_name) {
570 facts.user = account->pw_name;
571 }
572
573 if (const auto packaged = find_packaged_unit()) {
574 facts.unit_name = packaged->name;
575 const auto dir = user_unit_dir();
576 if (const auto text = read_file(dir / packaged->name)) {
577 facts.unit_generated = is_generated_unit(*text);
579 }
580 facts.unit_enabled = fs::is_symlink(dir / "default.target.wants" / packaged->name, ec);
581 }
582
583 if (!facts.user.empty() && fs::is_directory("/var/lib/systemd/linger", ec)) {
584 facts.linger = fs::exists(fs::path {"/var/lib/systemd/linger"} / facts.user, ec);
585 }
586
587 const auto display_manager = fs::read_symlink("/etc/systemd/system/display-manager.service", ec);
588 if (!ec) {
589 facts.display_manager = display_manager.stem().string();
590 }
591 if (facts.display_manager == "sddm") {
592 std::vector<std::string> files;
593 append_conf_dir("/usr/lib/sddm/sddm.conf.d", files);
594 append_conf_dir("/etc/sddm.conf.d", files);
595 if (auto text = read_file("/etc/sddm.conf")) {
596 files.push_back(std::move(*text));
597 }
598 if (!files.empty()) {
599 facts.sddm = sddm_settings(files);
600 }
601 }
602
603 facts.input_without_session = opens_without_seat_grant("/dev/uinput");
604 facts.virtual_display_backend = config::video.virtual_display_backend;
605 facts.hermes_kms_without_session = hermes_kms_opens_without_seat_grant();
606 return facts;
607 }
608
610 return assess(collect_facts());
611 }
612
613 void log_report() {
614 const auto result = report();
615 if (!result.enabled) {
616 return;
617 }
618 if (result.ready) {
619 BOOST_LOG(info) << "[Prelogin] This host is set up to be reached before anyone logs in."sv;
620 return;
621 }
622 BOOST_LOG(warning) << "[Prelogin] Hermes starts at boot, but this host cannot be reached before login yet:"sv;
623 for (const auto &check : result.checks) {
624 if (check.state == state_e::ready || check.state == state_e::note) {
625 continue;
626 }
627 BOOST_LOG(warning) << "[Prelogin] "sv << check.title << ": "sv << check.detail
628 << (check.fix.empty() ? ""s : " Fix: " + check.fix);
629 }
630 }
631
632 int command(const char *name, int argc, char *argv[]) {
633 if (argc != 1) {
634 return usage(name);
635 }
636 if (::getuid() == 0) {
637 std::cerr << "Run this as the user Hermes streams for, not as root." << std::endl;
638 return 2;
639 }
640
641 const std::string_view action {argv[0]};
642 if (action == "status"sv) {
643 const auto result = report();
644 print(result);
645 return result.ready ? 0 : 1;
646 }
647 if (action == "enable"sv) {
648 return enable();
649 }
650 if (action == "disable"sv) {
651 return disable();
652 }
653 return usage(name);
654 }
655
656} // namespace platf::prelogin
Declarations for the configuration of Sunshine.
Declarations for logging related functions.
std::string read_file(const char *path)
Read a file to string.
@ existing
Someone else's rule already forwards to the requested destination.
report_t report()
assess(collect_facts()).
Definition prelogin.cpp:609
bool is_generated_unit(std::string_view unit)
Whether unit was written by from_boot_unit().
Definition prelogin.cpp:366
int command(const char *name, int argc, char *argv[])
hermes --prelogin status|enable|disable.
Definition prelogin.cpp:632
report_t assess(const facts_t &facts)
Decide every check from facts.
Definition prelogin.cpp:492
void log_report()
Say at startup what stands between this host and being reachable before login. Silent unless Hermes i...
Definition prelogin.cpp:613
facts_t collect_facts()
Look at this machine.
Definition prelogin.cpp:565
bool unit_waits_for_session(std::string_view unit)
Whether unit depends on a target that only exists once somebody has logged in, whoever wrote it.
Definition prelogin.cpp:375
sddm_settings_t sddm_settings(const std::vector< std::string > &files)
Read SDDM's settings from its configuration files.
Definition prelogin.cpp:463
std::string from_boot_unit(std::string_view packaged_unit, std::string_view source_path)
Turn the packaged unit into one that starts with the user manager.
Definition prelogin.cpp:395
Set up and check what it takes for Hermes to be reachable before login.
@ note
Worth saying, and no obstacle.
Definition prelogin.h:27
@ unknown
Could not be determined, or not something that has been run.
Definition prelogin.h:26
@ missing
Known to be absent; fix says what to do.
Definition prelogin.h:25
std::string unit_name
"hermes.service"; empty when no packaged unit was found.
Definition prelogin.h:52
std::string display_manager
"sddm", "gdm", ...; empty when none is enabled.
Definition prelogin.h:57
std::optional< bool > hermes_kms_without_session
A Hermes-KMS node opens with no seat grant.
Definition prelogin.h:61
bool unit_from_boot
A unit in the user's own directory that does not wait for the session.
Definition prelogin.h:53
bool unit_generated
...and it is the copy --prelogin enable writes.
Definition prelogin.h:54
std::optional< bool > input_without_session
/dev/uinput opens with no seat grant.
Definition prelogin.h:59
std::optional< sddm_settings_t > sddm
Unset when SDDM's configuration could not be read.
Definition prelogin.h:58
bool unit_enabled
The unit is wanted by default.target.
Definition prelogin.h:55
bool enabled
Hermes' unit is set to start at boot.
Definition prelogin.h:39
bool ready
Every requirement is known to be in place.
Definition prelogin.h:40
std::string display_server
[General] DisplayServer, lower-case; empty when unset.
Definition prelogin.h:45
std::string autologin_user
[Autologin] User; SDDM logs in by itself whenever it is set.
Definition prelogin.h:46
Declarations for utility functions.
Virtual display declarations for Linux.