mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #10803 from Security-Onion-Solutions/TOoSmOotH-patch-1
Update needs_restarting.py
This commit is contained in:
@@ -3,22 +3,14 @@ import subprocess
|
|||||||
|
|
||||||
def check():
|
def check():
|
||||||
|
|
||||||
os = __grains__['os']
|
osfam = __grains__['os_family']
|
||||||
retval = 'False'
|
retval = 'False'
|
||||||
|
|
||||||
if os == 'Ubuntu':
|
if osfam == 'Debian':
|
||||||
if path.exists('/var/run/reboot-required'):
|
if path.exists('/var/run/reboot-required'):
|
||||||
retval = 'True'
|
retval = 'True'
|
||||||
|
|
||||||
elif os == 'CentOS Stream':
|
elif osfam == 'RedHat':
|
||||||
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
|
||||||
|
|
||||||
try:
|
|
||||||
needs_restarting = subprocess.check_call(cmd, shell=True)
|
|
||||||
except subprocess.CalledProcessError:
|
|
||||||
retval = 'True'
|
|
||||||
|
|
||||||
elif os == 'Rocky':
|
|
||||||
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
|
|
||||||
{% if GLOBALS.os_family == 'Redhat' %}
|
{% if GLOBALS.os_family == 'RedHat' %}
|
||||||
{% set REPOPATH = '/etc/yum.repos.d/' %}
|
{% set REPOPATH = '/etc/yum.repos.d/' %}
|
||||||
{% if GLOBALS.os == 'OEL' %}
|
{% if GLOBALS.os == 'OEL' %}
|
||||||
{% set ABSENTFILES = [
|
{% set ABSENTFILES = [
|
||||||
|
|||||||
Reference in New Issue
Block a user