Let's consider that LocalScripts plugin is executing one by one the scripts existent in the LocalScripts folder.
During the scripts' execution, a shutdown or a reboot is requested.
At that moment, the script execution, which is wrapped in a cmdline shell, is given a SIGKILL and finishes with exit code 1, cascading to the next script getting created, which exits again with exit code 1 and so on.
The LocalScripts then sets the plugin state as executed in the corresponding registry key.
A reboot happens, and cloudbase-init runs again but LocalScripts plugin is not executed anymore, as its state is already Executed.
Let's consider that LocalScripts plugin is executing one by one the scripts existent in the LocalScripts folder.
During the scripts' execution, a shutdown or a reboot is requested.
At that moment, the script execution, which is wrapped in a cmdline shell, is given a SIGKILL and finishes with exit code 1, cascading to the next script getting created, which exits again with exit code 1 and so on.
The LocalScripts then sets the plugin state as executed in the corresponding registry key.
A reboot happens, and cloudbase-init runs again but LocalScripts plugin is not executed anymore, as its state is already Executed.