- syncup: podman first, docker only as fallback (podman wins on name clash;
existing docker units found in podman switch to podman)
- syncup: group podman-compose containers into one `kind: stack` unit per
project (project, working_dir, compose_files, compose_bin from labels);
disable existing member units ("part of stack <project>")
- generator: compose mode (podman-compose up/stop, WorkingDirectory) with
pod start/stop fallback when compose binary/dir/files are missing
- reconcile: stacks disabled with "stack not found" when neither compose
files nor pod exist
- root: scan root + rootless users listed in `users:` (podman only)
- non-root: config ~/.config/unitdore/units.yaml, own user units only
- sysuser package: runuser with XDG_RUNTIME_DIR/DBUS env, home/linger lookup
- install: warn when linger is not enabled for user units
- testdata/stack: podman-compose test stack and captured podman ps fixture
- docs: README, generated-units, man page, AGENTS, PLAN
26 lines
652 B
Go
26 lines
652 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/warkanum/unitdore/config"
|
|
"github.com/warkanum/unitdore/sysuser"
|
|
)
|
|
|
|
// runtimeLabel is the RUNTIME column value for list/status.
|
|
func runtimeLabel(u config.Unit) string {
|
|
if u.IsStack() {
|
|
return u.Runtime + " (stack)"
|
|
}
|
|
return u.Runtime
|
|
}
|
|
|
|
// lingerHint prints, once per user, how to make user units start at boot.
|
|
func lingerHint(seen map[string]bool, u config.Unit) {
|
|
if u.User == "" || seen[u.User] || sysuser.LingerEnabled(u.User) {
|
|
return
|
|
}
|
|
seen[u.User] = true
|
|
fmt.Printf(" ! linger not enabled for %s — user units won't start at boot: sudo loginctl enable-linger %s\n", u.User, u.User)
|
|
}
|