Commit 78b6725f authored by segfault's avatar segfault

Keep container running while configuring service

This is required by the SFTP configuration, which executes commands in
the container.
parent e6685e00
......@@ -120,29 +120,29 @@ class OnionService(DBusObject, metaclass=abc.ABCMeta):
logger.info("Installing service %r", self.Name)
self.Status = Status.INSTALLING
try:
self.TransactionStatus = _("Starting container to install packages")
self.TransactionStatus = _("Creating container")
self.container.create()
self.TransactionStatus = _("Starting container for setup")
with self.container.run():
with self.prevent_service_autostart():
self.container.install_packages(self.packages)
self.TransactionStatus = _("Configuring service")
self.create_state_dir()
self.create_data_files()
self.Address = self.private_key.derive_onion_address()
self.configure()
self.TransactionStatus = _("Bind-mounting config files")
# XXX: We could mount during the same container run where we install packages,
# to reduce installation time.
with self.container.run():
self.TransactionStatus = _("Configuring service")
self.create_state_dir()
self.create_data_files()
# Some services use the onion address during configuration, so set it before
self.Address = self.private_key.derive_onion_address()
# Some services configure files in the mount points, so mount them before
self.mount()
self.configure()
self.TransactionStatus = _("Initializing options")
self.initialize_options()
self.TransactionStatus = _("Initializing options")
self.initialize_options()
self.TransactionStatus = _("Configuring options")
self.configure_options()
self.TransactionStatus = _("Configuring options")
self.configure_options()
self.is_installed_file.touch()
self.Status = Status.STOPPED
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment