I have couple of instances on Google Compute Engine. There I have systemd service with
ExecStop option. Script execution may take a significant time (5-10 minutes).
When shutting down GCE instance, this script is run, however it is not finished as GCE instance shutdowns before it finishes and ignores it.
Correct finishing and full completing of this script is very important.
From Google docs:
Stopping an instance causes Compute Engine to send the ACPI Power Off signal to the instance. Modern guest operating systems are configured to perform a clean shutdown before powering off in response to the power off signal.
Is there any way to tell GCE to wait until systemd service finishes stopping?