Skip to content

Commit

Permalink
Add service to kill k3s before umount
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Lönnegren <fredrik.lonnegren@suse.com>
  • Loading branch information
frelon committed Feb 6, 2023
1 parent c3ba48d commit 148d0d7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .obs/specfile/elemental.spec
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ rm -rf %{buildroot}/usr/libexec/.placeholder
%dir %{_sysconfdir}/NetworkManager/conf.d
%config %{_sysconfdir}/NetworkManager/conf.d/rke2-canal.conf
%dir %{_unitdir}
%{_unitdir}/shutdown-k3s.service
%{_unitdir}/elemental-populate-node-labels.service
%{_sbindir}/elemental-populate-node-labels
%dir /usr/libexec
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.image
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ COPY --from=elemental-cli /usr/bin/elemental /usr/bin/elemental
COPY framework/files/ /

# Enable services
RUN systemctl enable NetworkManager sshd elemental-populate-node-labels systemd-timesyncd
RUN systemctl enable NetworkManager sshd elemental-populate-node-labels systemd-timesyncd shutdown-k3s

ARG IMAGE_TAG=latest
ARG IMAGE_COMMIT=""
Expand Down
11 changes: 11 additions & 0 deletions framework/files/usr/lib/systemd/system/shutdown-k3s.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Kill containerd-shims on shutdown
DefaultDependencies=false
Before=shutdown.target umount.target

[Service]
ExecStart=/usr/local/bin/k3s-killall.sh
Type=oneshot

[Install]
WantedBy=shutdown.target

0 comments on commit 148d0d7

Please sign in to comment.