From c85c6c746bcd2ec2b03ae77f0aca39486480cd0e Mon Sep 17 00:00:00 2001 From: Philip Guyton Date: Fri, 25 May 2018 17:20:26 +0100 Subject: [PATCH] remove redundant rc.local cleanup #1929 Remove rc.local cleanup code and associated template as we are now systemd based and this rc.local restoration mechanism only pertains to pre 3.8-9 (> 2.5 years ago) upgrades. Summary: - Remove mechanism that force overwrites rc.local with template file. Consequence: - Breaks upgrade from pre 3.8-9 Rockstor versions. --- conf/rc.local | 13 ------------- src/rockstor/scripts/initrock.py | 21 --------------------- 2 files changed, 34 deletions(-) delete mode 100644 conf/rc.local diff --git a/conf/rc.local b/conf/rc.local deleted file mode 100644 index a7e0ad258..000000000 --- a/conf/rc.local +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES -# -# It is highly advisable to create own systemd services or udev rules -# to run scripts during boot instead of using this file. -# -# In contrast to previous versions due to parallel execution during boot -# this script will NOT be run after all other services. -# -# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure -# that this script will be executed during boot. - -touch /var/lock/subsys/local diff --git a/src/rockstor/scripts/initrock.py b/src/rockstor/scripts/initrock.py index 1acb8ea57..88bfc4950 100644 --- a/src/rockstor/scripts/initrock.py +++ b/src/rockstor/scripts/initrock.py @@ -280,26 +280,6 @@ def update_smb_service(logging): return logging.info('%s looks correct. Not updating.' % name) -def cleanup_rclocal(logging): - # this could potentially be problematic if users want to have a custom - # rc.local file, which is not really needed or recommended due to better - # systemd alternative method. - - # This cleanup method can be safely removed when we know there are no - # <3.8-9 versions out there any more. - - rc_dest = '/etc/rc.d/rc.local' - rc_src = '%s/conf/rc.local' % BASE_DIR - sum1 = md5sum(rc_dest) - sum2 = md5sum(rc_src) - if (sum1 != sum2): - logging.info('updating %s' % rc_dest) - shutil.copy(rc_src, rc_dest) - logging.info('Done.') - return os.chmod(rc_dest, 755) - logging.info('%s looks correct. Not updating.' % rc_dest) - - def main(): loglevel = logging.INFO if (len(sys.argv) > 1 and sys.argv[1] == '-x'): @@ -340,7 +320,6 @@ def main(): logging.info('restarting nginx...') run_command([SUPERCTL, 'restart', 'nginx']) - cleanup_rclocal(logging) logging.info('Checking for flash and Running flash optimizations if ' 'appropriate.') run_command([FLASH_OPTIMIZE, '-x'], throw=False)