mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Simplify logmark used in syslog
Instead of using `date | md5sum` and parsing the output to get the actual md5sum (without the stdin filename), use the current unixtime with a `logmark-` prefix.
This commit is contained in:
parent
c0734411ee
commit
95d89dfbac
1 changed files with 2 additions and 3 deletions
|
@ -18,6 +18,7 @@ import os
|
|||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
import apparmor.aa as apparmor
|
||||
import apparmor.ui as aaui
|
||||
|
@ -140,9 +141,7 @@ if os.path.exists('/var/log/audit/audit.log'):
|
|||
|
||||
while not done_profiling:
|
||||
if syslog:
|
||||
logmark = subprocess.check_output(['date | md5sum'], shell=True)
|
||||
logmark = logmark.decode('ascii').strip()
|
||||
logmark = re.search('^([0-9a-f]+)', logmark).groups()[0]
|
||||
logmark = 'logmark-%s' % str(int(time.time())) # unix timestamp, seconds only
|
||||
t=subprocess.call([apparmor.logger_path(), '-p', 'kern.warn', 'GenProf: %s'%logmark])
|
||||
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue