mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-23 03:59:38 +00:00
DaemonManager: remove systemd check
This commit is contained in:
parent
bdd91b053d
commit
8a910ad4c7
3 changed files with 1 additions and 36 deletions
|
@ -298,16 +298,10 @@ Rectangle {
|
||||||
if (persistentSettings.allowRemoteNodeMining || (args.includes("--zmq-pub tcp://127.0.0.1:18083") || args.includes("--zmq-pub=tcp://127.0.0.1:18083")) && !args.includes("--no-zmq")) {
|
if (persistentSettings.allowRemoteNodeMining || (args.includes("--zmq-pub tcp://127.0.0.1:18083") || args.includes("--zmq-pub=tcp://127.0.0.1:18083")) && !args.includes("--no-zmq")) {
|
||||||
startP2Pool()
|
startP2Pool()
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
var underSystemd = daemonManager.checkUnderSystemd();
|
|
||||||
if (underSystemd) {
|
|
||||||
miningError(qsTr("Monerod is managed by Systemd. Manually add --zmq-pub tcp://127.0.0.1:18083 to the unit file <br>") + translationManager.emptyString)
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
daemonManager.stopAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, startP2PoolLocal)
|
daemonManager.stopAsync(persistentSettings.nettype, persistentSettings.blockchainDataDir, startP2PoolLocal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
confirmationDialog.title = qsTr("P2Pool installation") + translationManager.emptyString;
|
confirmationDialog.title = qsTr("P2Pool installation") + translationManager.emptyString;
|
||||||
confirmationDialog.text = qsTr("P2Pool will be installed at %1. Proceed?").arg(applicationDirectory) + translationManager.emptyString;
|
confirmationDialog.text = qsTr("P2Pool will be installed at %1. Proceed?").arg(applicationDirectory) + translationManager.emptyString;
|
||||||
|
|
|
@ -342,34 +342,6 @@ bool DaemonManager::checkLmdbExists(QString datadir) {
|
||||||
return validateDataDir(datadir).value("lmdbExists").value<bool>();
|
return validateDataDir(datadir).value("lmdbExists").value<bool>();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DaemonManager::checkUnderSystemd() {
|
|
||||||
#ifdef Q_OS_LINUX
|
|
||||||
QProcess p;
|
|
||||||
QStringList args;
|
|
||||||
args << "monerod";
|
|
||||||
p.setProgram("pgrep");
|
|
||||||
p.setArguments(args);
|
|
||||||
p.start();
|
|
||||||
p.waitForFinished();
|
|
||||||
QString pid = p.readAllStandardOutput().trimmed();
|
|
||||||
if (pid.isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
args.clear();
|
|
||||||
|
|
||||||
args << "-c";
|
|
||||||
args << "ps -eo pid,cgroup | grep " + pid + " | grep -q .service$";
|
|
||||||
p.setProgram("sh");
|
|
||||||
p.setArguments(args);
|
|
||||||
p.start();
|
|
||||||
p.waitForFinished();
|
|
||||||
if (p.exitCode() == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString DaemonManager::getArgs(const QString &dataDir) {
|
QString DaemonManager::getArgs(const QString &dataDir) {
|
||||||
if (!running(NetworkType::MAINNET, dataDir)) {
|
if (!running(NetworkType::MAINNET, dataDir)) {
|
||||||
return args;
|
return args;
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
Q_INVOKABLE QVariantMap validateDataDir(const QString &dataDir) const;
|
Q_INVOKABLE QVariantMap validateDataDir(const QString &dataDir) const;
|
||||||
Q_INVOKABLE bool checkLmdbExists(QString datadir);
|
Q_INVOKABLE bool checkLmdbExists(QString datadir);
|
||||||
Q_INVOKABLE QString getArgs(const QString &dataDir);
|
Q_INVOKABLE QString getArgs(const QString &dataDir);
|
||||||
Q_INVOKABLE bool checkUnderSystemd();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue