Commit 9b583454 authored by Ad Schellevis's avatar Ad Schellevis

(ids) make sure the update process can only run once

parent 9908a158
...@@ -31,10 +31,20 @@ ...@@ -31,10 +31,20 @@
update suricata rules update suricata rules
""" """
import os import os
import sys
import fcntl
from ConfigParser import ConfigParser from ConfigParser import ConfigParser
from lib import metadata from lib import metadata
from lib import downloader from lib import downloader
# check for a running update process, this may take a while so it's better to check...
try:
lck = open('/tmp/suricata-rule-updater.py','w+')
fcntl.flock(lck, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
# already running, exit status 99
sys.exit(99)
if __name__ == '__main__': if __name__ == '__main__':
# load list of configured rules from generated config # load list of configured rules from generated config
enabled_rulefiles=[] enabled_rulefiles=[]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment