mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
fix needs_restarting module
This commit is contained in:
@@ -4,20 +4,19 @@ import subprocess
|
||||
def check():
|
||||
|
||||
os = __grains__['os']
|
||||
retval = 'False'
|
||||
|
||||
if os == 'Ubuntu':
|
||||
if path.exists('/var/run/reboot-required'):
|
||||
retval = 'True'
|
||||
else:
|
||||
retval = 'False'
|
||||
|
||||
elif os == 'CentOS':
|
||||
cmd = 'needs-restarting -r > /dev/null 2>&1'
|
||||
|
||||
try:
|
||||
needs_restarting = subprocess.check_call(cmd.split(), shell=True)
|
||||
needs_restarting = subprocess.check_call(cmd, shell=True)
|
||||
except subprocess.CalledProcessError:
|
||||
retval = 'True'
|
||||
retval = 'False'
|
||||
|
||||
else:
|
||||
retval = 'Unsupported OS: %s' % os
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package_update_reboot_required_motd:
|
||||
file.append:
|
||||
file.managed:
|
||||
- name: /etc/motd
|
||||
- source: salt://motd/files/package_update_reboot_required.jinja
|
||||
- template: jinja
|
||||
|
||||
Reference in New Issue
Block a user