Bug 980541

Summary: Zypper does not always show the command as documented
Product: [openSUSE] openSUSE Tumbleweed Reporter: Björn Voigt <bjoernv>
Component: libzyppAssignee: E-mail List <zypp-maintainers>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: forgotten_DOcbB57LR0, seife
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Björn Voigt 2016-05-18 12:02:11 UTC
The manual page for Zypper says:

"ps

  After each upgrade or removal of packages, there may be running
  processes on the system which continue to use meanwhile deleted files.
  zypper ps lists all processes using deleted files, together with the
  corresponding files, and a service name hint, in case it’s a known
  service. This gives a hint which services may need to be restarted
  after an update. Usually programs which continue to use deleted shared
  libraries. The list contains the following information:

       PID       ID of the process
       PPID      ID of the parent process
       UID       ID of the user running the process
       Login     Login name of the user running the process
       Command   Command used to execute the process
       Service   Service name, if command is associated with a
                 system service
       Files     The list of the deleted files"


But often I do not see the command name, but some other function name.

One example:

# zypper ps -s
The following running processes use deleted files:

PID   | PPID  | UID  | User | Command        | Service
------+-------+------+------+----------------+--------
3321  | 1     | 1000 | user | dconf worker   |        
3899  | 1     | 1000 | user | QThread        |        
3958  | 3287  | 1000 | user | QThread        |        
3980  | 0     | 1000 | user | Thread (pooled |        
4262  | 3287  | 1000 | user | QThread        |        
12121 | 12114 | 1000 | user | seamonkey-bin  |

"seamonkey-bin" is correct. But the other processes have different command names. The "ps" names match the "zypper ps -s" description: "Command: Command used to execute the process". I truncated the session numbers as "...".

# ps ax|egrep '3321|3899|3958|3980|4262|12121'|grep -v grep
 3321 ?        Sl     0:00 /usr/lib/goa-daemon
 3899 ?        Sl     0:02 /usr/bin/kalarm -session ...
 3958 ?        Sl     4:43 /usr/bin/skype -session ...
 3980 ?        Sl     0:28 owncloud -session ...
 4262 ?        Sl     0:05 /usr/bin/korganizer -session ...
12121 pts/1    Sl    18:03 /usr/lib64/seamonkey/seamonkey-bin

The manual page or the Zypper command should be corrected.

I think, the "ps" process names are more useful for the users. If I see the "ps" names, I may manually restart the processes kalarm, skype etc. without rebooting. The "zypper ps" names are mostly not usable.
Comment 1 Stefan Seyfried 2016-07-12 15:18:27 UTC
I stumbled across the same issue.

This simple change to libzypp would be an obvious fix:

diff --git a/zypp/misc/CheckAccessDeleted.cc b/zypp/misc/CheckAccessDeleted.cc
index de705bd..31c408d 100644
--- a/zypp/misc/CheckAccessDeleted.cc
+++ b/zypp/misc/CheckAccessDeleted.cc
@@ -89,7 +89,7 @@ namespace zypp
         do { ++ch; } while ( *ch != '\0' );    // skip to next field
       }
 
-      if ( pinfo.command.size() == 15 )
+//    if ( pinfo.command.size() == 15 )
       {
         // the command name might be truncated, so we check against /proc/<pid>/exe
         Pathname command( filesystem::readlink( Pathname("/proc")/pinfo.pid/"exe" ) );
Comment 2 Stefan Seyfried 2016-07-12 15:26:24 UTC
https://github.com/openSUSE/libzypp/pull/62
Comment 3 Michael Andres 2016-07-14 17:05:45 UTC
Fixed in libzypp-16.1.3