diff --git a/pkg/open-vm-tools/Dockerfile b/pkg/open-vm-tools/Dockerfile index 57ae2ce66..5ed20d3d8 100644 --- a/pkg/open-vm-tools/Dockerfile +++ b/pkg/open-vm-tools/Dockerfile @@ -13,4 +13,7 @@ ENTRYPOINT [] CMD [] WORKDIR / COPY --from=mirror /out/ / +COPY scripts /etc/vmware-tools/scripts CMD ["/usr/bin/vmtoolsd"] + +LABEL org.mobyproject.config='{"pid": "host", "capabilities": ["CAP_SYS_BOOT"]}' diff --git a/pkg/open-vm-tools/scripts/poweroff-vm-default.d/poweroff.sh b/pkg/open-vm-tools/scripts/poweroff-vm-default.d/poweroff.sh new file mode 100755 index 000000000..73701e006 --- /dev/null +++ b/pkg/open-vm-tools/scripts/poweroff-vm-default.d/poweroff.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# send SIGTERM to the init system (PID 1), which causes a clean VM host-initiated shutdown +kill -s SIGTERM 1 +exit 0