diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py index aa1681db0e85..635909a75cf4 100644 --- a/cloudinit/cmd/main.py +++ b/cloudinit/cmd/main.py @@ -945,12 +945,12 @@ def main(sysv_args=None): ) parser.add_argument( - "--single-process", - dest="single_process", + "--all-stages", + dest="all_stages", action="store_true", help=( - "Run cloud-init's stages as a single process as an optimization." - "Requires init system integration." + "Run cloud-init's stages under a single process using a " + "syncronization protocol. This is not intended for CLI usage." ), default=False, ) @@ -1149,7 +1149,7 @@ def main(sysv_args=None): args = parser.parse_args(args=sysv_args) setattr(args, "skip_log_setup", False) - if not args.single_process: + if not args.all_stages: return sub_main(args) LOG.info("Running cloud-init in single process mode.") diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl index 46be3d59e73b..1ddfd62073ef 100644 --- a/systemd/cloud-init.service.tmpl +++ b/systemd/cloud-init.service.tmpl @@ -35,7 +35,7 @@ ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled [Service] Type=notify -ExecStart=/usr/bin/cloud-init --single-process +ExecStart=/usr/bin/cloud-init --all-stages KillMode=process TasksMax=infinity TimeoutStartSec=infinity diff --git a/tests/unittests/test_single_process.py b/tests/unittests/test_all_stages.py similarity index 97% rename from tests/unittests/test_single_process.py rename to tests/unittests/test_all_stages.py index 361e3372bc97..4dacca0b6840 100644 --- a/tests/unittests/test_single_process.py +++ b/tests/unittests/test_all_stages.py @@ -5,7 +5,6 @@ from threading import Thread from unittest import mock - from cloudinit import socket as ci_socket @@ -49,7 +48,7 @@ def __exit__(self, *_): signal.alarm(0) -def test_single_process_times_out(tmp_path): +def test_all_stages_times_out(tmp_path): """Verify that no "start" makes the protocol block""" with mock.patch.object( ci_socket, "DEFAULT_RUN_DIR", tmp_path @@ -72,7 +71,7 @@ def test_single_process_times_out(tmp_path): raise AssertionError("Expected the thing to timeout!") -def test_single_process(tmp_path): +def test_all_stages(tmp_path): """Verify that a socket can store "start" messages After a socket has been been bound but before it has started listening @@ -110,7 +109,7 @@ def test_single_process(tmp_path): assert expected == third.receive() -def test_single_process_threaded(tmp_path): +def test_all_stages_threaded(tmp_path): """Verify that arbitrary "start" order works""" # in milliseconds @@ -183,7 +182,7 @@ def syncer(index: int, name: str): assert expected == sync_storage[5].receive() -def test_single_process_exception(tmp_path): +def test_all_stages_exception(tmp_path): """Verify that exceptions log messages produce a valid warning message""" with mock.patch.object( ci_socket, "DEFAULT_RUN_DIR", tmp_path