mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
stop cron before soup upgrades the manager, start cron at the end. add cron state that is in included in common
This commit is contained in:
@@ -4,8 +4,9 @@
|
|||||||
{% set role = grains.id.split('_') | last %}
|
{% set role = grains.id.split('_') | last %}
|
||||||
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
||||||
|
|
||||||
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
|
|
||||||
include:
|
include:
|
||||||
|
- cron.running
|
||||||
|
{% if grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-managersearch', 'so-import'] %}
|
||||||
- manager.elasticsearch # needed for elastic_curl_config state
|
- manager.elasticsearch # needed for elastic_curl_config state
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
@@ -360,6 +360,13 @@ run_check_net_err() {
|
|||||||
exit $exit_code
|
exit $exit_code
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
set_cron_service_name() {
|
||||||
|
if [[ "$OS" == "centos" ]]; then
|
||||||
|
cron_service_name="crond"
|
||||||
|
else
|
||||||
|
cron_service_name="cron"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
set_os() {
|
set_os() {
|
||||||
if [ -f /etc/redhat-release ]; then
|
if [ -f /etc/redhat-release ]; then
|
||||||
|
|||||||
@@ -988,6 +988,7 @@ main() {
|
|||||||
verify_latest_update_script
|
verify_latest_update_script
|
||||||
echo ""
|
echo ""
|
||||||
set_os
|
set_os
|
||||||
|
set_cron_service_name
|
||||||
set_palette
|
set_palette
|
||||||
check_elastic_license
|
check_elastic_license
|
||||||
echo ""
|
echo ""
|
||||||
@@ -1021,6 +1022,10 @@ main() {
|
|||||||
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
|
echo "Performing upgrade from Security Onion $INSTALLEDVERSION to Security Onion $NEWVERSION."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
echo "Stopping $cron_service_name service at $(date +"%T.%6N")."
|
||||||
|
echo ""
|
||||||
|
systemctl stop "$cron_service_name"
|
||||||
|
|
||||||
# update mine items prior to stopping salt-minion and salt-master
|
# update mine items prior to stopping salt-minion and salt-master
|
||||||
update_salt_mine
|
update_salt_mine
|
||||||
|
|
||||||
@@ -1191,6 +1196,9 @@ main() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Starting $cron_service_name service at $(date +"%T.%6N")."
|
||||||
|
systemctl start "$cron_service_name"
|
||||||
|
|
||||||
if [[ $NUM_MINIONS -gt 1 ]]; then
|
if [[ $NUM_MINIONS -gt 1 ]]; then
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|||||||
6
salt/cron/dead.sls
Normal file
6
salt/cron/dead.sls
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{% from "cron/map.jinja" import cronmap with context %}
|
||||||
|
|
||||||
|
crond_service:
|
||||||
|
service.dead:
|
||||||
|
- name: {{ cronmap.service }}
|
||||||
|
- enable: True
|
||||||
8
salt/cron/map.jinja
Normal file
8
salt/cron/map.jinja
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{% set cronmap = salt['grains.filter_by']({
|
||||||
|
'Ubuntu': {
|
||||||
|
'service': 'cron',
|
||||||
|
},
|
||||||
|
'CentOS': {
|
||||||
|
'service': 'crond',
|
||||||
|
},
|
||||||
|
}) %}
|
||||||
7
salt/cron/running.sls
Normal file
7
salt/cron/running.sls
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{% from "cron/map.jinja" import cronmap with context %}
|
||||||
|
|
||||||
|
crond_service:
|
||||||
|
service.running:
|
||||||
|
- name: {{ cronmap.service }}
|
||||||
|
- enable: True
|
||||||
|
- unless: pgrep soup
|
||||||
Reference in New Issue
Block a user