Documentation
¶
Overview ¶
Package spawn runs the shell commands the config names (click actions, power commands): process.rs's run_if_set and spawn_quiet.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Detached ¶ added in v0.2.0
Detached starts cmd with no stdio in a session and a systemd scope of its own, named for name, and reaps it in the background. The scope is what lets it outlive the shell: restarting the shell's unit stops every process in its cgroup, so an app the shell launched must not stay there.
func Owned ¶ added in v0.2.0
Owned is `sh -c command` bound to ctx as a whole: it runs in a process group of its own, and ctx's end signals that group, so the script's children stop with it. exec.CommandContext alone kills only sh, and a watch script's pipeline outlived every bar rebuild.
func Quiet ¶
Quiet runs cmd through sh -c without waiting, in a session and a scope of its own (Detached): stdout discarded, and a failure logged with its exit code and stderr once it exits, so the child is always reaped. The returned error is a failure to start; how the command ends is only logged. A blank command runs nothing.
func ScopeName ¶ added in v0.2.0
ScopeName is the unit a launched process runs in: app-lys\x2dshell-<name>-<pid>.scope, name reduced to its program and escaped as systemd-escape does.
func Scoped ¶ added in v0.2.0
Scoped starts cmd in a session of its own and moves it into its own scope, for the caller to wait on; the error is a failure to start. Without a systemd user manager there is no unit cgroup to leave, so it stays where it is; a manager that refuses the scope is logged, the process already running.
Types ¶
This section is empty.