libzypp  17.1.1
zypp::CheckAccessDeleted Class Reference

Check for running processes which access deleted executables or libraries. More...

#include <CheckAccessDeleted.h>

Classes

struct  ProcInfo
 Data about one running process accessing deleted files. More...
 

Public Types

typedef size_t size_type
 
typedef ProcInfo value_type
 
typedef std::vector< ProcInfo >::const_iterator const_iterator
 

Public Member Functions

 CheckAccessDeleted (bool doCheck_r=true)
 Default ctor performs check immediately. More...
 
size_type check (bool verbose_r=false)
 Check for running processes which access deleted executables or libraries. More...
 
bool empty () const
 
size_type size () const
 
const_iterator begin () const
 
const_iterator end () const
 

Static Public Member Functions

static std::string findService (pid_t pid_r)
 Guess if pid was started by a systemd service script. More...
 

Private Attributes

std::vector< ProcInfo_data
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const CheckAccessDeleted &obj)
 

Detailed Description

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 construction or explicit call to check, information about running processes which access deleted files or libraries is collected and provided as a ProcInfo container.

Definition at line 34 of file CheckAccessDeleted.h.

Member Typedef Documentation

◆ size_type

Definition at line 57 of file CheckAccessDeleted.h.

◆ value_type

◆ const_iterator

Definition at line 59 of file CheckAccessDeleted.h.

Constructor & Destructor Documentation

◆ CheckAccessDeleted()

zypp::CheckAccessDeleted::CheckAccessDeleted ( bool  doCheck_r = true)
inline

Default ctor performs check immediately.

Pass false and the initial check is omitted.

Exceptions
Exceptionif check throws.
See also
check.

Definition at line 67 of file CheckAccessDeleted.h.

Member Function Documentation

◆ check()

CheckAccessDeleted::size_type zypp::CheckAccessDeleted::check ( bool  verbose_r = false)

Check for running processes which access deleted executables or libraries.

Per default check will try guess and collect executables and libraries only by looking at the files path and name. (e.g named lib* or located in *bin/).

A verbose check will omit this test and collect all processes using any deleted file.

Returns
the number of processes found.
Exceptions
ExceptionOn error collecting the data (e.g. no lsof installed)

Definition at line 244 of file CheckAccessDeleted.cc.

◆ empty()

bool zypp::CheckAccessDeleted::empty ( ) const
inline

Definition at line 85 of file CheckAccessDeleted.h.

◆ size()

size_type zypp::CheckAccessDeleted::size ( ) const
inline

Definition at line 86 of file CheckAccessDeleted.h.

◆ begin()

const_iterator zypp::CheckAccessDeleted::begin ( ) const
inline

Definition at line 87 of file CheckAccessDeleted.h.

◆ end()

const_iterator zypp::CheckAccessDeleted::end ( ) const
inline

Definition at line 88 of file CheckAccessDeleted.h.

◆ findService()

std::string zypp::CheckAccessDeleted::findService ( pid_t  pid_r)
static

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.

Definition at line 297 of file CheckAccessDeleted.cc.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  str,
const CheckAccessDeleted obj 
)
related

Stream output

Definition at line 334 of file CheckAccessDeleted.cc.

Member Data Documentation

◆ _data

std::vector<ProcInfo> zypp::CheckAccessDeleted::_data
private

Definition at line 98 of file CheckAccessDeleted.h.


The documentation for this class was generated from the following files: