Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various OS upgrade fixes #296

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coriolis/osmorphing/osmount/redhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ def setup(self):

def _allow_ssh_env_vars(self):
self._exec_cmd('sudo sed -i -e "\$aAcceptEnv *" /etc/ssh/sshd_config')
self._exec_cmd("sudo service sshd reload")
utils.restart_service(self._ssh, "sshd")
return True
2 changes: 1 addition & 1 deletion coriolis/osmorphing/osmount/ubuntu.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def setup(self):

def _allow_ssh_env_vars(self):
self._exec_cmd('sudo sed -i -e "\$aAcceptEnv *" /etc/ssh/sshd_config')
self._exec_cmd("sudo service ssh reload")
utils.restart_service(self._ssh, "sshd")
return True
9 changes: 9 additions & 0 deletions coriolis/providers/replicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,14 @@ def _setup_certificates(self, ssh, args):
},
}

def _change_binary_se_context(self, ssh):
cmd = "sudo chcon -t bin_t %s" % REPLICATOR_PATH
try:
utils.exec_ssh_cmd(ssh, cmd, get_pty=True)
except exception.CoriolisException:
LOG.warn("Could not change SELinux context of replicator binary. "
"Error was:%s", utils.get_exception_details())

@utils.retry_on_error()
def _setup_replicator(self, ssh):
# copy the binary, set up the service, generate certificates,
Expand All @@ -723,6 +731,7 @@ def _setup_replicator(self, ssh):

args = self._parse_replicator_conn_info(self._conn_info)
self._copy_replicator_cmd(ssh)
self._change_binary_se_context(ssh)
group_existed = self._setup_replicator_group(
ssh, group_name=REPLICATOR_GROUP_NAME)
if not group_existed:
Expand Down
Loading