feat: order/delay in service files, enable cmd, --all on unit commands

- install/uninstall/start/stop/enable take <name> or --all; *all kept as shortcuts
- add enable (enable at boot + start); startall no longer enables
- order/delay resolved by config.ResolveOrder and written into systemd,
  OpenRC and runit service files (After=/sleep), so they apply at boot
- install --all stops and disables units before removing their files
- update regenerates all installed, enabled units and removes disabled ones
- edit creates the config dir; docs and man page updated
- tests: fake Init for cmd, ResolveOrder, backend ordering output
This commit is contained in:
2026-10-12 21:31:41 +02:00
parent d1d0889eb3
commit 91811b4fa1
28 changed files with 1394 additions and 503 deletions
+28 -19
View File
@@ -30,29 +30,38 @@ podman\-compose containers become one \fBkind: stack\fR unit per project;
existing member units are disabled. As root, rootless Podman containers of
each user in \fBusers:\fR are also discovered.
.TP
.B install
Generate \fI.service\fR files for all enabled units and write them to the
appropriate systemd directory. Use \fB\-\-dry\-run\fR to preview without writing.
.B install \fIname\fR | \fB\-\-all\fR
Generate the service file for one enabled unit. Does not enable or start it.
Use \fB\-\-dry\-run\fR to preview without writing. With \fB\-\-all\fR (and no
name) it behaves like \fBinstallall\fR.
.TP
.B uninstall \fIname\fR
Disable, stop, and remove the service file for a specific unit.
.B installall
Generate service files for all enabled units. Disabled units that are
installed are stopped, disabled and removed. Supports \fB\-\-dry\-run\fR.
.TP
.B startall
Run \fBsystemctl enable \-\-now\fR for all enabled, installed units in startup
order.
.B uninstall \fIname\fR | \fB\-\-all\fR
Disable, stop, and remove the service file for a unit. With \fB\-\-all\fR, for
every installed unit in reverse startup order (same as \fBuninstallall\fR).
.TP
.B stopall
Run \fBsystemctl disable \-\-now\fR for all installed units in reverse startup
order.
.B start \fIname\fR | \fB\-\-all\fR
Start an installed unit without enabling it at boot. With \fB\-\-all\fR, start
all enabled, installed units in startup order: equal \fBorder\fR in parallel,
groups one after another (same as \fBstartall\fR). \fBorder\fR and \fBdelay\fR are
also written into the service files (systemd \fBAfter=\fR and \fBExecStartPre\fR,
OpenRC \fBafter\fR and \fBstart_pre\fR, runit \fBsv check\fR and \fBsleep\fR), so
they apply at boot.
.TP
.B start \fIname\fR
Start a specific unit by name (\fBsystemctl start\fR).
.B enable \fIname\fR | \fB\-\-all\fR
Like \fBstart\fR, but also enable at boot (same as \fBenableall\fR).
.TP
.B stop \fIname\fR
Stop a specific unit by name (\fBsystemctl stop\fR).
.B stop \fIname\fR | \fB\-\-all\fR
Stop an installed unit. With \fB\-\-all\fR, stop all installed units one at a time
in reverse startup order (same as \fBstopall\fR).
.TP
.B update \fIname\fR
Update a unit's config and recreate its service file.
Update a unit's config. An installed unit's service file is recreated, or
stopped and removed if the unit is now disabled. Other installed units are
regenerated too, as ordering depends on their neighbours.
.RS
.TP
.BR \-\-order " " \fIn\fR
@@ -127,15 +136,15 @@ Discover containers and install their service files:
.RS
.nf
sudo unitdore syncup
sudo unitdore install
sudo unitdore startall
sudo unitdore install \-\-all
sudo unitdore start \-\-all
.fi
.RE
.PP
Preview generated service files without writing:
.PP
.RS
sudo unitdore install \-\-dry\-run
sudo unitdore install nginx \-\-dry\-run
.RE
.PP
Start a single container unit: