diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index ea6bfd534..e0f9bdca1 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -130,6 +130,24 @@ def stop(): def reload(): + if os.path.exists("/tmp/mongodb-27017.sock"): + mw.execShell('rm -rf ' + "/tmp/mongodb-27017.sock") + if mw.isAppleSystem(): + file = initDreplace() + data = mw.execShell(file + ' reload') + if data[1] == '': + return 'ok' + return 'fail' + + data = mw.execShell('systemctl reload mongod') + if data[1] == '': + return 'ok' + return 'fail' + + +def restart(): + if os.path.exists("/tmp/mongodb-27017.sock"): + mw.execShell('rm -rf ' + "/tmp/mongodb-27017.sock") if mw.isAppleSystem(): file = initDreplace() data = mw.execShell(file + ' reload')