File tree Expand file tree Collapse file tree
mkosi.skeleton/usr/lib/systemd/system-preset Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,3 +19,9 @@ rm -f "$B"/etc/ssh/ssh_host_*_key "$B"/etc/ssh/ssh_host_*_key.pub
1919# Build outputs are merged after package installation, so refresh the final
2020# rootfs cache after manually staged NVIDIA and container-runtime libraries.
2121ldconfig -r " $B "
22+
23+ # systemd applies the first matching rule across all preset files sorted by
24+ # name, so a distro preset such as Debian's 90-systemd.preset would shadow the
25+ # `disable *` in 99-dstack-default.preset. Keep dstack's policy the only one.
26+ find " $B " /usr/lib/systemd/system-preset " $B " /etc/systemd/system-preset \
27+ -maxdepth 1 -name ' *.preset' ! -name ' *dstack*' -print -delete 2> /dev/null || true
Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22enable systemd-networkd.service
3+ # The only unit WantedBy=network-online.target, which dstack-prepare waits on.
4+ enable systemd-networkd-wait-online.service
35enable systemd-resolved.service
46enable chrony.service
57enable docker.service
Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ test ! -e "$D/../common/rootfs/wg-checker.service"
124124# only meaningful with a terminal disable. Without it, every package pulled in
125125# by Packages= would start at boot with no diff to 80-dstack.preset.
126126grep -q ' ^disable \*$' " $D /mkosi.skeleton/usr/lib/systemd/system-preset/99-dstack-default.preset"
127+ # ...and it is only terminal if no foreign preset sorts before it.
128+ grep -q " ! -name '\*dstack\*'" " $D /mkosi.postinst" || {
129+ echo ' mkosi.postinst must drop foreign preset files' >&2 ; exit 1; }
130+ grep -qx ' enable systemd-networkd-wait-online.service' \
131+ " $D /mkosi.skeleton/usr/lib/systemd/system-preset/80-dstack.preset"
127132# The TEE simulator serves synthetic quotes; its preset must not ship in prod.
128133if grep -rq ' dstack-tee-simulator' " $D /mkosi.skeleton/" ; then
129134 echo ' simulator preset must live in the dev profile skeleton' >&2
You can’t perform that action at this time.
0 commit comments