|
root / base / usr / src / zyginit / services / single-user-shell / service.toml
service.toml TOML 45 lines 1.6 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# single-user-shell — Interactive root shell on /dev/console for
# single-user (recovery) mode. Activated only when g_runlevel == SINGLE,
# either via -s in kernel boot args or `zygctl single` at runtime.
#
# Phase A: spawns /sbin/sh with no authentication. Physical console
# access == root in this mode. This is intentional — the primary use
# case is recovering from forgotten root passwords / borked configs,
# which can't gate on the very things we're trying to fix.
#
# Phase B (future): swap start.sh to invoke /sbin/sulogin which
# prompts for the root password and falls through to a root shell on
# success. Single TOML edit; the architecture stays the same.

[service]
name = "single-user-shell"
description = "Single-user-mode interactive root shell on /dev/console"
type = "daemon"

[exec]
start = "/etc/zyginit/services/single-user-shell/start.sh"

[runlevel]
mode = "single"

[dependencies]
# Filesystem needs to be mounted so /var/log etc. are readable for
# diagnosis. Everything beyond filesystem (network, ipmgmtd, dlmgmtd,
# etc.) is multi-user only and not started in single-user.
requires = ["root-fs", "filesystem"]

[restart]
# When the user types `exit`, supervisor respawns the shell — that's
# the expected single-user UX. To leave single-user, run
# `zygctl multi` (or `init 3`) which transitions runlevels and stops
# this service before starting multi-user services.
on = "always"
delay = 0

[contract]
# The shell forks children freely; don't let stray exits kill the
# contract. We rely on `restart=always` to bring the shell back if
# the immediate process dies.
param = ["inherit", "noorphan"]
fatal = ["hwerr"]