mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #11009 from Security-Onion-Solutions/fix/soruleupdate
ensure only 1 instance of so-rule-update runs. execute the cmd at the end of state run
This commit is contained in:
@@ -63,19 +63,21 @@ delete_so-idstools_so-status.disabled:
|
|||||||
|
|
||||||
so-rule-update:
|
so-rule-update:
|
||||||
cron.present:
|
cron.present:
|
||||||
- name: /usr/sbin/so-rule-update > /opt/so/log/idstools/download.log 2>&1
|
- name: /usr/sbin/so-rule-update > /opt/so/log/idstools/download_cron.log 2>&1
|
||||||
- identifier: so-rule-update
|
- identifier: so-rule-update
|
||||||
- user: root
|
- user: root
|
||||||
- minute: '1'
|
- minute: '1'
|
||||||
- hour: '7'
|
- hour: '7'
|
||||||
|
|
||||||
|
# order this last to give so-idstools container time to be ready
|
||||||
run_so-rule-update:
|
run_so-rule-update:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
- name: '/usr/sbin/so-rule-update > /opt/so/log/idstools/download.log 2>&1'
|
- name: '/usr/sbin/so-rule-update > /opt/so/log/idstools/download_idstools_state.log 2>&1'
|
||||||
- require:
|
- require:
|
||||||
- docker_container: so-idstools
|
- docker_container: so-idstools
|
||||||
- onchanges:
|
- onchanges:
|
||||||
- file: idstoolsetcsync
|
- file: idstoolsetcsync
|
||||||
|
- order: last
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# if this script isn't already running
|
||||||
|
if [[ ! "`pidof -x $(basename $0) -o %PPID`" ]]; then
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
{%- from 'vars/globals.map.jinja' import GLOBALS %}
|
{%- from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
@@ -34,3 +38,5 @@ for arg in "$@"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
docker exec so-idstools /bin/bash -c "cd /opt/so/idstools/etc && idstools-rulecat --force ${argstr}"
|
docker exec so-idstools /bin/bash -c "cd /opt/so/idstools/etc && idstools-rulecat --force ${argstr}"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user