mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 01:02:46 +01:00
add delay to salt-minion service starting - https://github.com/Security-Onion-Solutions/securityonion/issues/3543
This commit is contained in:
@@ -3,4 +3,5 @@
|
|||||||
salt:
|
salt:
|
||||||
minion:
|
minion:
|
||||||
version: 3003
|
version: 3003
|
||||||
check_threshold: 3600 # in seconds, threshold used for so-salt-minion-check. any value less than 600 seconds may cause a lot of salt-minion restarts since the job to touch the file occurs every 5-8 minutes by default
|
check_threshold: 3600 # in seconds, threshold used for so-salt-minion-check. any value less than 600 seconds may cause a lot of salt-minion restarts since the job to touch the file occurs every 5-8 minutes by default
|
||||||
|
service_start_delay: 30 # in seconds.
|
||||||
@@ -2,9 +2,11 @@
|
|||||||
{% from 'salt/map.jinja' import UPGRADECOMMAND with context %}
|
{% from 'salt/map.jinja' import UPGRADECOMMAND with context %}
|
||||||
{% from 'salt/map.jinja' import SALTVERSION %}
|
{% from 'salt/map.jinja' import SALTVERSION %}
|
||||||
{% from 'salt/map.jinja' import INSTALLEDSALTVERSION %}
|
{% from 'salt/map.jinja' import INSTALLEDSALTVERSION %}
|
||||||
|
{% from 'salt/minion.defaults.yaml' import salt.minion.service_start_delay as service_start_delay %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- salt
|
- salt
|
||||||
|
- systemd.reload
|
||||||
|
|
||||||
install_salt_minion:
|
install_salt_minion:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
@@ -32,8 +34,21 @@ set_log_levels:
|
|||||||
- listen_in:
|
- listen_in:
|
||||||
- service: salt_minion_service
|
- service: salt_minion_service
|
||||||
|
|
||||||
|
salt_minion_service_unit_file:
|
||||||
|
file.managed:
|
||||||
|
- name: /etc/systemd/system/multi-user.target.wants/salt-minion.service
|
||||||
|
- source: salt://salt/service/salt-minion.servic.jinja
|
||||||
|
- template: jinja
|
||||||
|
- defaults:
|
||||||
|
- service_start_delay: {{ service_start_delay }}
|
||||||
|
- onchanges_in:
|
||||||
|
- module: systemd_reload
|
||||||
|
- listen_in:
|
||||||
|
- service: salt_minion_service
|
||||||
|
|
||||||
salt_minion_service:
|
salt_minion_service:
|
||||||
service.running:
|
service.running:
|
||||||
- name: salt-minion
|
- name: salt-minion
|
||||||
- enable: True
|
- enable: True
|
||||||
- onlyif: test "{{INSTALLEDSALTVERSION}}" == "{{SALTVERSION}}"
|
- onlyif: test "{{INSTALLEDSALTVERSION}}" == "{{SALTVERSION}}"
|
||||||
|
|
||||||
|
|||||||
30
salt/salt/service/salt-minion.service.jinja
Normal file
30
salt/salt/service/salt-minion.service.jinja
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=The Salt Minion
|
||||||
|
Documentation=man:salt-minion(1) file:///usr/share/doc/salt/html/contents.html https://docs.saltstack.com/en/latest/contents.html
|
||||||
|
After=network.target salt-master.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
KillMode=process
|
||||||
|
Type=notify
|
||||||
|
NotifyAccess=all
|
||||||
|
LimitNOFILE=8192
|
||||||
|
ExecStart=/usr/bin/salt-minion
|
||||||
|
ExecStartPre=/bin/sleep {{ salt['pillar.get']('salt:minion:service_start_delay', service_start_delay) }}
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
3
salt/systemd/reload.sls
Normal file
3
salt/systemd/reload.sls
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
systemd_reload:
|
||||||
|
module.run:
|
||||||
|
- service.systemctl_reload: []
|
||||||
Reference in New Issue
Block a user