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

dpkg-query failed when binary are /usr/lib/jvm/java-X-openjdk-amd64/jre/bin/java #56

Closed
mayasd opened this issue Feb 10, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@mayasd
Copy link

mayasd commented Feb 10, 2017

Hi,

On a server I know there are binaries that use obsolete libraries but needrestart does not display them :

~ # needrestart -l
Scanning processes...                                                                                                                                                                                                                         
Scanning candidates...                                                                                                                                                                                                                        
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.

But when I execute checkrestart, I see java and php5 binaries that use obsoletes libraries :

Found 5 processes using old versions of upgraded files
(3 distinct programs)
(3 distinct packages)
These processes do not seem to have an associated init script to restart them:

php5-cli:
        18763   /usr/bin/php5
openjdk-8-jre-headless:amd64:
        32472   /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
        32408   /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
openjdk-7-jre-headless:amd64:
        23304   /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
        7600    /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java

Now I execute needrestart with verbose option :

[main] eval /etc/needrestart/needrestart.conf
[main] needrestart v2.11
[main] running in root mode
[Core] Using UI 'NeedRestart::UI::stdio'...
[Core] #308 is a NeedRestart::Interp::Python
[Python] #308: source=/usr/bin/fail2ban-server
[main] #7600 uses obsolete binary /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
[main] #7600 is not a child
[main] #18763 uses deleted /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
[main] #18763 is not a child
[Core] #20122 is a NeedRestart::Interp::Perl
[Perl] #20122: source=/usr/share/tomcat7/app/app/app.cgi
[Core] #23138 is a NeedRestart::Interp::Java
[Core] #23138 uses obsolete script file(s):
[Core] #23138  /home/user/libs/app.jar
[main] #23138 is a child of #23137
[main] #23304 uses obsolete binary /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
[main] #23304 is not a child
[main] #32408 uses deleted /lib/x86_64-linux-gnu/libresolv-2.19.so
[main] #32408 is not a child
[main] #32472 uses deleted /lib/x86_64-linux-gnu/libresolv-2.19.so
[main] #32472 is not a child
[main] #7600 exe => /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
[Core] #7600 is a NeedRestart::Interp::Java
[Core] #7600 source is UNKNOWN
[main] #7600 running /etc/needrestart/hook.d/10-dpkg
[main] #7600 package: amd64
dpkg-query: package 'amd64' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
[main] #7600 running /etc/needrestart/hook.d/20-rpm
[main] #7600 running /etc/needrestart/hook.d/90-none
[main] #18763 exe => /usr/bin/php5
[main] #18763 running /etc/needrestart/hook.d/10-dpkg
[main] #18763 package: php5-cli
[main] #18763 running /etc/needrestart/hook.d/20-rpm
[main] #18763 running /etc/needrestart/hook.d/90-none
[main] #23137 exe => /usr/bin/daemon
[main] #23137 running /etc/needrestart/hook.d/10-dpkg
[main] #23137 package: daemon
[main] #23137 running /etc/needrestart/hook.d/20-rpm
[main] #23137 running /etc/needrestart/hook.d/90-none
[main] #23304 exe => /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
[Core] #23304 is a NeedRestart::Interp::Java
[Core] #23304 source is UNKNOWN
[main] #23304 running /etc/needrestart/hook.d/10-dpkg
[main] #23304 package: amd64
dpkg-query: package 'amd64' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
[main] #23304 running /etc/needrestart/hook.d/20-rpm
[main] #23304 running /etc/needrestart/hook.d/90-none
[main] #32408 exe => /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
[Core] #32408 is a NeedRestart::Interp::Java
[Core] #32408 source is UNKNOWN
[main] #32408 running /etc/needrestart/hook.d/10-dpkg
[main] #32408 package: amd64
dpkg-query: package 'amd64' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
[main] #32408 running /etc/needrestart/hook.d/20-rpm
[main] #32408 running /etc/needrestart/hook.d/90-none
[main] #32472 exe => /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
[Core] #32472 is a NeedRestart::Interp::Java
[Core] #32472 source is UNKNOWN
[main] #32472 running /etc/needrestart/hook.d/10-dpkg
[main] #32472 package: amd64
dpkg-query: package 'amd64' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
[main] #32472 running /etc/needrestart/hook.d/20-rpm
[main] #32472 running /etc/needrestart/hook.d/90-none
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.

I see there are errors when needrestart get package name of java binaries :

[main] #32408 exe => /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
[Core] #32408 is a NeedRestart::Interp::Java
[Core] #32408 source is UNKNOWN
[main] #32408 running /etc/needrestart/hook.d/10-dpkg
[main] #32408 package: amd64
dpkg-query: package 'amd64' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

But I don't see any errors for the php5 binary then I still don't know why needrestart without verbose option does not display any messages for php5 binary.

@liske liske self-assigned this Feb 10, 2017
@liske liske added the bug label Feb 10, 2017
@liske
Copy link
Owner

liske commented Feb 10, 2017

Hi,

php5-cli

Looking at the verbose output needrestart does detect it uses outdated script files but it is unable to find a service correponding to php5-cli:

[main] #18763 uses deleted /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
[main] #18763 is not a child
...
[main] #18763 exe => /usr/bin/php5
[main] #18763 running /etc/needrestart/hook.d/10-dpkg
[main] #18763 package: php5-cli
[main] #18763 running /etc/needrestart/hook.d/20-rpm
[main] #18763 running /etc/needrestart/hook.d/90-none

Since needrestart is unable to find a service nor is 18763 part of a user session (attached to some sort of TTY) it is not reported (remember: needrestart handles daemons (and reports sessions)). Maybe some warnings about such processes should be added to make clear they are not handled by needrestart?

multiarch

There seems to be a problem with multiarch packages in the dpkg hook. But this is not an issue for you, if it would work, the result will stay the same (since openjdk-*-jre-headless does not provide any daemons nor services). Could you please provide the command line of the java processes? Needrestart tries to find the initial class file and lookup to which package the file belongs to but seems to fail. If the package provides services it is possible to restart the process (should work for tomcat and such daemons).

@liske liske modified the milestones: v2.12, v2.11-3 Feb 10, 2017
@liske liske closed this as completed in 22b1519 Oct 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants