From 0e2753393b5698bbe7749ef1dc66541f26f6c2b1 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Mon, 28 Nov 2022 09:09:25 -0500 Subject: [PATCH 1/2] Remove BG for filecheck --- salt/strelka/filecheck/filecheck | 2 ++ salt/strelka/init.sls | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/salt/strelka/filecheck/filecheck b/salt/strelka/filecheck/filecheck index 816125fcb..c1a151de4 100644 --- a/salt/strelka/filecheck/filecheck +++ b/salt/strelka/filecheck/filecheck @@ -83,3 +83,5 @@ if __name__ == "__main__": except KeyboardInterrupt: observer.stop() observer.join() + + logging.info("Exiting filecheck") diff --git a/salt/strelka/init.sls b/salt/strelka/init.sls index ec49787f7..b58bdfaa7 100644 --- a/salt/strelka/init.sls +++ b/salt/strelka/init.sls @@ -162,11 +162,9 @@ filecheck_script: - mode: 755 filecheck_run: - cmd.run: - - name: 'python3 /opt/so/conf/strelka/filecheck' - - bg: True - - runas: socore - - unless: ps -ef | grep filecheck | grep -v grep + cron.present: + - name: 'ps -ef | grep filecheck | grep -v grep || python3 /opt/so/conf/strelka/filecheck >> /opt/so/log/strelka/filecheck_stdout.log 2>&1 &' + - user: socore filcheck_history_clean: cron.present: From e15ca408e70926a37d889866807951edd117a465 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Mon, 28 Nov 2022 09:11:41 -0500 Subject: [PATCH 2/2] Remove BG for filecheck --- salt/strelka/filecheck/filecheck | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/salt/strelka/filecheck/filecheck b/salt/strelka/filecheck/filecheck index c1a151de4..ccf0949ee 100644 --- a/salt/strelka/filecheck/filecheck +++ b/salt/strelka/filecheck/filecheck @@ -75,6 +75,8 @@ if __name__ == "__main__": event_handler =CreatedEventHandler() observer = Observer() + + logging.info("Starting filecheck") observer.schedule(event_handler, extract_path, recursive=True) observer.start() try: @@ -83,5 +85,5 @@ if __name__ == "__main__": except KeyboardInterrupt: observer.stop() observer.join() - + logging.info("Exiting filecheck")