libzypp: zypp::CheckAccessDeleted Class Reference

libzypp 17.38.6

zypp::CheckAccessDeleted Class Reference

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

`#include <zypp/misc/CheckAccessDeleted.h>`

## Classes
struct | ProcInfo
| Data about one running process accessing deleted files. More...
class | Impl

## Public Types
using | size_type = size_t
using | value_type = ProcInfo
using | const_iterator = std::vector<ProcInfo>::const_iterator

## Public Member Functions
| CheckAccessDeleted (bool doCheck_r=true)
| Default ctor performs check immediately.
size_type | check (bool verbose_r=false)
| Check for running processes which access deleted executables or libraries.
size_type | check (const Pathname &lsofOutput_r, bool verbose_r=false)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Performs the same checks but instead of investigating the current system it uses information from lsofOutput_r to support debugging.
bool | empty () const
size_type | size () const
const_iterator | begin () const
const_iterator | end () const
void | setDebugOutputFile (const Pathname &filename_r)
| Writes all filtered process entries that make it into the final set into a file specified by filename_r.

## Static Public Member Functions
static std::string | findService (pid_t pid_r)
| Guess if pid was started by a systemd service script.

## Private Attributes
RWCOW_pointer< Impl > | _pimpl

## 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.

Provides support for reproducing check results from a foreign system by creating a debug output file containing all required information, enabled by setDebugOutputFile.
This data file can be used as datasource when passed to check(const Pathname &, bool).

Definition at line 42 of file CheckAccessDeleted.h.

## Member Typedef Documentation

## ◆ size_type

using zypp::CheckAccessDeleted::size_type = size_t

Definition at line 66 of file CheckAccessDeleted.h.

## ◆ value_type

using zypp::CheckAccessDeleted::value_type = ProcInfo

Definition at line 67 of file CheckAccessDeleted.h.

## ◆ const_iterator

using zypp::CheckAccessDeleted::const_iterator = std::vector<ProcInfo>::const_iterator

Definition at line 68 of file CheckAccessDeleted.h.

## Constructor & Destructor Documentation

## ◆ CheckAccessDeleted()

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

Default ctor performs check immediately.

Pass `false` and the initial check is omitted.

Exceptions

  Exception | if check throws.

See also
  check.

Definition at line 371 of file CheckAccessDeleted.cc.

## Member Function Documentation

## ◆ check() [1/2]

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

  Exception | On error collecting the data (e.g. no lsof installed)

Definition at line 433 of file CheckAccessDeleted.cc.

## ◆ check() [2/2]

CheckAccessDeleted::size_type zypp::CheckAccessDeleted::check | ( | const Pathname & | lsofOutput_r,
|  | bool | verbose_r = false )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Performs the same checks but instead of investigating the current system it uses information from lsofOutput_r to support debugging.

See also
  setDebugOutputFile

Definition at line 377 of file CheckAccessDeleted.cc.

## ◆ empty()

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

Definition at line 504 of file CheckAccessDeleted.cc.

## ◆ size()

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

Definition at line 509 of file CheckAccessDeleted.cc.

## ◆ begin()

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

Definition at line 514 of file CheckAccessDeleted.cc.

## ◆ end()

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

Definition at line 519 of file CheckAccessDeleted.cc.

## ◆ setDebugOutputFile()

void zypp::CheckAccessDeleted::setDebugOutputFile | ( | const Pathname & | filename_r | ) |

Writes all filtered process entries that make it into the final set into a file specified by filename_r.

Definition at line 524 of file CheckAccessDeleted.cc.

## ◆ 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 529 of file CheckAccessDeleted.cc.

## Member Data Documentation

## ◆ _pimpl

RWCOW_pointer<Impl> zypp::CheckAccessDeleted::_pimpl
| private

Definition at line 120 of file CheckAccessDeleted.h.

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

- zypp/misc/CheckAccessDeleted.h
- zypp/misc/CheckAccessDeleted.cc