From ebb6f281e7e31c19f46741618e178274fb54c128 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Mon, 23 May 2022 17:54:48 +0200 Subject: [PATCH] coreos-base/oem-gce: bring back shutdown scripts In the `init.sh` of the OEM GCE container, we have the following section: ```bash wait -n "${daemon_pids[@]}" || : kill "${daemon_pids[@]}" || : test -n "$stopping" || exit 1 exec /usr/bin/google_metadata_script_runner --script-type shutdown ``` `shutdown` script was not executed because container was receiving a `SIGKILL`, the started processes was not properly terminated. According to the `systemd-nspawn` manual: ```bash If --boot is not used and this option is not specified the container's processes are terminated abruptly via SIGKILL ``` Signed-off-by: Mathieu Tortuyaux --- .../coreos-base/oem-gce/files/units/oem-gce.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service index bc6333d6fe..50d06d05de 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service @@ -25,7 +25,7 @@ ExecStartPre=/usr/bin/umount /var/lib/flatcar-oem-gce.img Environment=SYSTEMD_NSPAWN_API_VFS_WRITABLE=1 ExecStart=/usr/bin/systemd-nspawn --keep-unit --register=no --link-journal=no \ --machine=oem-gce --capability=CAP_NET_ADMIN --bind=/dev/log --bind=/run/systemd --tmpfs=/run/lock --bind=/etc --bind=/home --bind-ro=/usr/share/google-oslogin/nsswitch.conf \ - --read-only --volatile=overlay --image=/var/lib/flatcar-oem-gce.img /init.sh + --read-only --volatile=overlay --image=/var/lib/flatcar-oem-gce.img --kill-signal=SIGTERM /init.sh [Install] WantedBy=multi-user.target