Skip to content

Commit

Permalink
Show lsof, if verify fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Mar 29, 2023
1 parent c0b5b50 commit c4cebb8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/include/ABHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,12 @@ public static function backupContainer($container, $destination) {
/**
* Special debug: The creation was ok but verification failed: Something is accessing docker files! List docker info for this container
*/
$output = null; // Reset exec lines
exec("ps aux | grep docker", $output);
self::backupLog("ps aux docker:" . PHP_EOL . print_r($output, true), self::LOGLEVEL_DEBUG);
foreach ($volumes as $volume) {
$output = null; // Reset exec lines
exec("lsof -nl +D " . escapeshellarg($dockerAppdataPath) . "/" . escapeshellarg($volume), $output);
self::backupLog("lsof($volume)" . PHP_EOL . print_r($output, true), self::LOGLEVEL_DEBUG);
}

$nowRunning = $dockerClient->getDockerContainers();
foreach ($nowRunning as $nowRunningContainer) {
if ($nowRunningContainer["Name"] == $container['Name']) {
Expand Down Expand Up @@ -400,7 +403,7 @@ public static function getDockerAppdataPath() {
} else {
self::backupLog("dockerCfg is there but no Appdata path iset set??", self::LOGLEVEL_ERR);
}
return $dockerAppdataPath;
return rtrim($dockerAppdataPath, '/');
}

public static function examineContainerVolumes($container) {
Expand Down

0 comments on commit c4cebb8

Please sign in to comment.