Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce blacklist_interp to allow ignoring of interpreted files #39

Merged
merged 1 commit into from
Sep 24, 2016

Conversation

wolfgangkarall
Copy link
Contributor

My use case: running needrestart via ansible shows sometimes false positives for /tmp/ansible_* files, finding parent sshd -> wants to restart ssh.service more often than necessary.

@wolfgangkarall
Copy link
Contributor Author

Just an example output of such a case, it's no triggered every time:

$ ansible news3 -sa 'needrestart -v'
news3 | SUCCESS | rc=0 >>
Pending kernel upgrade!

Running kernel version:
  3.16.0-4-amd64

Diagnostics:
  The currently running kernel has an ABI compatible upgrade pending.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting. [Return]
Services to be restarted:
Skipping systemd-journald.service...
systemctl restart ssh.service[Core] Using UI 'NeedRestart::UI::stdio'...
[main] detected systemd
[main] #139 uses obsolete binary /lib/systemd/systemd-journald
[main] #139 is not a child
[Core] #20095 is a NeedRestart::Interp::Python
[Python] #20095: could not get a source file, skipping
[Core] #20096 is a NeedRestart::Interp::Python
[Core] #20096 uses obsolete script file(s):
[Core] #20096  /tmp/ansible_n7zaoH/ansible_module_command.py
[main] #20096 is a child of #20095
[main] #139 exe => /lib/systemd/systemd-journald
[main] #139 is systemd-journald.service
[main] #20095 exe => /usr/bin/python2.7
[Core] #20095 is a NeedRestart::Interp::Python
[Python] #20095: could not get a source file, skipping
[Core] #20095 source is UNKNOWN
[main] #20095 is ssh.service
[Kernel] Linux: kernel release 3.16.0-4-amd64, kernel version #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08)
[Kernel/Linux] /boot/vmlinuz-3.16.0-4-amd64 => 3.16.0-4-amd64 (debian-kernel@lists.debian.org) #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) [3.16.0-4-amd64]
[Kernel/Linux] Expected kernel version: 3.16.0-4-amd64

With blacklist_interp:

$ ansible news3 -sa 'needrestart -v'
news3 | SUCCESS | rc=0 >>
Pending kernel upgrade!

Running kernel version:
  3.16.0-4-amd64

Diagnostics:
  The currently running kernel has an ABI compatible upgrade pending.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting. [Return]
Services to be restarted:
Skipping systemd-journald.service...[Core] Using UI 'NeedRestart::UI::stdio'...
[main] detected systemd
[main] #139 uses obsolete binary /lib/systemd/systemd-journald
[main] #139 is not a child
[Core] #20257 is a NeedRestart::Interp::Python
[Python] #20257: could not get a source file, skipping
[Core] #20258 is a NeedRestart::Interp::Python
[Core] blacklisted: /tmp/ansible_X48_ye/ansible_module_command.py
[main] #139 exe => /lib/systemd/systemd-journald
[main] #139 is systemd-journald.service
[Kernel] Linux: kernel release 3.16.0-4-amd64, kernel version #1 SMP Debian 3.16.7-ckt25-2 (2016-04-08)
[Kernel/Linux] /boot/vmlinuz-3.16.0-4-amd64 => 3.16.0-4-amd64 (debian-kernel@lists.debian.org) #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) [3.16.0-4-amd64]
[Kernel/Linux] Expected kernel version: 3.16.0-4-amd64

@liske liske self-assigned this Sep 24, 2016
@liske liske merged commit 6252778 into liske:master Sep 24, 2016
@liske
Copy link
Owner

liske commented Sep 24, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants