Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
vladimir.kuznetsov
0e32b5df06 Merge branch 'dev' of github.com:amnezia-vpn/desktop-client into bugfix/dpkg-busy-checking-stuck 2023-03-26 11:16:06 +03:00
vladimir.kuznetsov
02881c4409 changed using fuser to lsof to determine if dpkg is busy 2023-03-26 11:15:22 +03:00
vladimir.kuznetsov
298e1e2e72 test 2023-03-26 05:42:39 +03:00
3 changed files with 8 additions and 7 deletions

View file

@ -539,7 +539,7 @@ ErrorCode ServerController::installDockerWorker(const ServerCredentials &credent
QFutureWatcher<ErrorCode> watcher; QFutureWatcher<ErrorCode> watcher;
QFuture<ErrorCode> future = QtConcurrent::run([this, &stdOut, &cbReadStdOut, &cbReadStdErr, &credentials]() { QFuture<ErrorCode> future = QtConcurrent::run([this, &stdOut, &cbReadStdOut, &cbReadStdErr, &credentials]() {
do { while (true) {
if (m_cancelInstallation) { if (m_cancelInstallation) {
return ErrorCode::ServerCancelInstallation; return ErrorCode::ServerCancelInstallation;
} }
@ -547,12 +547,13 @@ ErrorCode ServerController::installDockerWorker(const ServerCredentials &credent
runScript(credentials, runScript(credentials,
replaceVars(amnezia::scriptData(SharedScriptType::check_server_is_busy), replaceVars(amnezia::scriptData(SharedScriptType::check_server_is_busy),
genVarsForScript(credentials)), cbReadStdOut, cbReadStdErr); genVarsForScript(credentials)), cbReadStdOut, cbReadStdErr);
if (!stdOut.isEmpty() || stdOut.contains("Unable to acquire the dpkg frontend lock")) { if (stdOut.contains("/var/lib/dpkg/lock-frontend")) {
emit serverIsBusy(true); emit serverIsBusy(true);
QThread::msleep(1000); QThread::msleep(1000);
} else {
return ErrorCode::NoError;
} }
} while (!stdOut.isEmpty()); }
return ErrorCode::NoError;
}); });
QEventLoop wait; QEventLoop wait;

View file

@ -4,7 +4,7 @@
#define APPLICATION_NAME "AmneziaVPN" #define APPLICATION_NAME "AmneziaVPN"
#define SERVICE_NAME "AmneziaVPN-service" #define SERVICE_NAME "AmneziaVPN-service"
#define ORGANIZATION_NAME "AmneziaVPN.ORG" #define ORGANIZATION_NAME "AmneziaVPN.ORG"
#define APP_MAJOR_VERSION "2.1.2" #define APP_MAJOR_VERSION "2.1.3"
#define APP_VERSION "2.1.2.0" #define APP_VERSION "2.1.3.0"
#endif // DEFINES_H #endif // DEFINES_H

View file

@ -1,4 +1,4 @@
pm_apt="/usr/bin/apt-get";\ pm_apt="/usr/bin/apt-get";\
if [[ -f "$pm_apt" ]]; then pm=$pm_apt; else exit; fi;\ if [[ -f "$pm_apt" ]]; then pm=$pm_apt; else exit; fi;\
if [[ ! -f "/usr/bin/sudo" ]]; then $pm update -y -q; $pm install -y -q sudo; fi;\ if [[ ! -f "/usr/bin/sudo" ]]; then $pm update -y -q; $pm install -y -q sudo; fi;\
sudo fuser /var/lib/dpkg/lock-frontend sudo lsof /var/lib/dpkg/lock-frontend