Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / misc / CheckAccessDeleted.h
index 10c1455..a3ebdcb 100644 (file)
@@ -21,18 +21,19 @@ namespace zypp
 { /////////////////////////////////////////////////////////////////
 
   /**
-   * Check for running processes which access deleted files or libraries.
+   * Check for running processes which access deleted executables or libraries.
    *
    * Executed after commit, this gives a hint which processes/services
    * need to be restarted.
    *
-   * Per default upon construtcion or explicit call to \ref check,
+   * Per default upon construction or explicit call to \ref check,
    * information about running processes which access deleted files
    * or libraries is collected and provided as a \ref ProcInfo
    * container.
    */
   class CheckAccessDeleted
   {
+
     public:
       /**
        * Data about one running process accessing deleted files.
@@ -44,17 +45,16 @@ namespace zypp
         std::string puid;              //!< process user ID
         std::string login;             //!< process login name
         std::string command;           //!< process command name
-        std::vector<std::string> files;        //!< list of deleted files or libraries accessed
+        std::vector<std::string> files;        //!< list of deleted executables or libraries accessed
 
-        /** Guess if command was started by an \c /etc/init.d/ script.
-         * The name of an \c /etc/init.d/ script that might be used to restart the
-         * command.
+        /** Guess if command was started by a systemd service script.
+         * The service name  might be used to restart the service.
          * \warning This is just a guess.
         */
         std::string service() const;
       };
 
-      typedef size_t                                           size_type;
+      typedef size_t                                   size_type;
       typedef ProcInfo                                 value_type;
       typedef std::vector<ProcInfo>::const_iterator    const_iterator;
 
@@ -68,11 +68,19 @@ namespace zypp
       { if ( doCheck_r ) check(); }
 
     public:
-      /** Check for running processes which access deleted files or libraries.
+      /** Check for running processes which access deleted executables or libraries.
+       *
+       * Per default \ref check will try guess and collect executables and
+       * libraries only by looking at the files path and name. (e.g named
+       * \c lib* or located in \c *bin/).
+       *
+       * A verbose check will omit this test and collect all processes using
+       * any deleted file.
+       *
        * \return the number of processes found.
        * \throws Exception On error collecting the data (e.g. no lsof installed)
        */
-      size_type check();
+      size_type check( bool verbose_r = false );
 
       bool empty() const               { return _data.empty(); }
       size_type size() const           { return _data.size(); }
@@ -80,17 +88,10 @@ namespace zypp
       const_iterator end() const       { return _data.end(); }
 
     public:
-      /** Guess if \c command was started by an \c /etc/init.d/ script.
-       * The name of an \c /etc/init.d/ script that might be used to restart the
-       * command. \c command may be specifies by name, full path or pid.
+      /** Guess if pid was started by a systemd service script.
+       * The service name  might be used to restart the service.
        * \warning This is just a guess.
        */
-      static std::string findService( const char * command_r );
-      /** \overload Taking a string.*/
-      static std::string findService( const std::string & command_r );
-      /** \overload Taking a pathname. */
-      static std::string findService( const Pathname & command_r );
-      /** \overload taking the pid. */
       static std::string findService( pid_t pid_r );
 
     private: