Skip to content

Commit

Permalink
#837 Поправил вызов remount для offload
Browse files Browse the repository at this point in the history
  • Loading branch information
boffart committed Nov 19, 2024
1 parent 2f9927c commit ee9db15
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Core/System/RootFS/etc/profile
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ _remountOffload()
mountPoint="$(mount | grep /offload | cut -d ' ' -f 1)";
if [ "${nowMode}" == 'rw' ]; then
newMode='ro';
mount -o remount,ro "$mountPoint";
/bin/busybox mount -o remount,ro "$mountPoint";
else
newMode='rw';
mount -o remount,rw "$mountPoint";
/bin/busybox mount -o remount,rw "$mountPoint";
fi;
echo "Mode for /offload ${newMode} disk:${mountPoint}";
}
Expand Down
12 changes: 6 additions & 6 deletions src/Core/System/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,8 @@ private function updateEnvironmentAfterChangeMountPoint(): void
private function createWorkDirs(): void
{
$path = '';
$mountPath = Util::which('mount');
Processes::mwExec("$mountPath -o remount,rw /offload 2> /dev/null");
$busyBoxPath = Util::which('busybox');
Processes::mwExec("$busyBoxPath mount -o remount,rw /offload 2> /dev/null");

$isLiveCd = file_exists('/offload/livecd');

Expand Down Expand Up @@ -816,7 +816,7 @@ private function createWorkDirs(): void
$this->clearCacheFiles();
$this->clearTmpFiles();
$this->applyFolderRights();
Processes::mwExec("$mountPath -o remount,ro /offload 2> /dev/null");
Processes::mwExec("$busyBoxPath mount -o remount,ro /offload 2> /dev/null");
}

/**
Expand Down Expand Up @@ -1088,8 +1088,8 @@ private function getLsBlkDiskInfo(): array
public function createWorkDirsAfterDBUpgrade(): void
{
// Remount /offload directory as read-write
$mountPath = Util::which('mount');
Processes::mwExec("$mountPath -o remount,rw /offload 2> /dev/null");
$busyBoxPath = Util::which('busybox');
Processes::mwExec("$busyBoxPath mount -o remount,rw /offload 2> /dev/null");

// Create symlinks for module caches
$this->createModulesCacheSymlinks();
Expand All @@ -1098,7 +1098,7 @@ public function createWorkDirsAfterDBUpgrade(): void
$this->applyFolderRights();

// Remount /offload directory as read-only
Processes::mwExec("$mountPath -o remount,ro /offload 2> /dev/null");
Processes::mwExec("$busyBoxPath mount -o remount,ro /offload 2> /dev/null");
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Core/System/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ public static function timezoneConfigure(): void
*/
public static function setupLocales(): void
{
$mountPath = Util::which('mount');
shell_exec("$mountPath -o remount,rw /offload 2> /dev/null");
$busyBoxPath = Util::which('busybox');
Processes::mwExec("$busyBoxPath mount -o remount,rw /offload 2> /dev/null");
$locales = ['en_US', 'en_GB', 'ru_RU'];
$localeDefPath = Util::which('localedef');
$localePath = Util::which('locale');
Expand All @@ -204,7 +204,7 @@ public static function setupLocales(): void
}
shell_exec("$localeDefPath -i $locale -f UTF-8 $locale.UTF-8");
}
shell_exec("$mountPath -o remount,ro /offload 2> /dev/null");
Processes::mwExec("$busyBoxPath mount -o remount,ro /offload 2> /dev/null");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Calls/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function echo_info() {

echo_header 'Init asterisk...';
dirName="$(realpath "$(dirname "$0")")";
/bin/mount -o remount,rw /offload/
/bin/busybox mount -o remount,rw /offload/
############################################################
##### Setup configs
# Убиваем старый процесс.
Expand Down

0 comments on commit ee9db15

Please sign in to comment.