Merge pull request #10803 from Security-Onion-Solutions/TOoSmOotH-patch-1

Update needs_restarting.py
This commit is contained in:
Mike Reeves
2023-07-20 10:55:11 -04:00
committed by GitHub
2 changed files with 4 additions and 12 deletions

View File

@@ -3,22 +3,14 @@ import subprocess
def check():
os = __grains__['os']
osfam = __grains__['os_family']
retval = 'False'
if os == 'Ubuntu':
if osfam == 'Debian':
if path.exists('/var/run/reboot-required'):
retval = 'True'
elif os == 'CentOS Stream':
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':
elif osfam == 'RedHat':
cmd = 'needs-restarting -r > /dev/null 2>&1'
try:

View File

@@ -1,6 +1,6 @@
{% from 'vars/globals.map.jinja' import GLOBALS %}
{% if GLOBALS.os_family == 'Redhat' %}
{% if GLOBALS.os_family == 'RedHat' %}
{% set REPOPATH = '/etc/yum.repos.d/' %}
{% if GLOBALS.os == 'OEL' %}
{% set ABSENTFILES = [