Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
apparmor
apparmor
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 61
    • Issues 61
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 24
    • Merge Requests 24
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • AppArmor
  • apparmorapparmor
  • Merge Requests
  • !688

Merged
Opened Nov 28, 2020 by John Johansen@jjohansenOwner

aa-notify: don't crash if the logfile is not present due to rotation

  • Overview 7
  • Commits 1
  • Pipelines 6
  • Changes 1

If aa-notify races file rotation it may crash with a trace back to the log file being removed before the new one is moved into place.

Traceback (most recent call last):
   File "/usr/sbin/aa-notify", line 570, in <module>
     main()
   File "/usr/sbin/aa-notify", line 533, in main
      for message in notify_about_new_entries(logfile, args.wait):
   File "/usr/sbin/aa-notify", line 145, in notify_about_new_entries
     for event in follow_apparmor_events(logfile, wait):
   File "/usr/sbin/aa-notify", line 236, in follow_apparmor_events
     if os.stat(logfile).st_ino != log_inode:
FileNotFoundError: [Errno 2] No such file or directory: '/var/log/audit/audit.log'

If we hit this situation sleep and then retry opening the logfile.

Fixes: #130 (closed) MR: Signed-off-by: John Johansen john.johansen@canonical.com

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: apparmor/apparmor!688
Source branch: aa-notify

Revert this commit

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this commit

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.