From f6c144ae16bd181f429ebe175f8a3607d4eb5643 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 28 Aug 2020 09:43:21 -0400 Subject: [PATCH] Amend to work more cleanly installed after xCAT xCAT intervenes on tftp a lot, so we need to stay away and clearly indicate that we are. --- confluent_server/bin/osdeploy | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/confluent_server/bin/osdeploy b/confluent_server/bin/osdeploy index 14b4c09f..0829b980 100644 --- a/confluent_server/bin/osdeploy +++ b/confluent_server/bin/osdeploy @@ -160,11 +160,14 @@ def install_tftp_content(): emprint('Unable to detect a directory for tftp content (check that tftp server is installed)') return 1 if os.path.exists('/usr/lib/systemd/system/tftp.socket'): - try: - subprocess.check_call(['systemctl', 'enable', 'tftp.socket', '--now']) - print('Ensured that tftp servicec is enabled') - except Exception: - emprint('Unable to automatically enable and start tftp.socket, tftp server may already be running outside of systemd control') + if tftplocation == `/tftpboot`: + emprint('/tftpboot is detected as tftp directory, will not try to automatically enable tftp, as it is presumed to be externally managed') + else: + try: + subprocess.check_call(['systemctl', 'enable', 'tftp.socket', '--now']) + print('TFTP service is enabled and running') + except Exception: + emprint('Unable to automatically enable and start tftp.socket, tftp server may already be running outside of systemd control') else: emprint( 'Detected {0} as tftp directory, but unable to determine tftp service, ensure that a tftp server is installed and enabled manually'.format(tftplocation))