mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:59:25 +08:00
up
This commit is contained in:
@@ -91,6 +91,13 @@ def triggerTask():
|
||||
writeFile(isTask, 'True')
|
||||
|
||||
|
||||
def systemdCfgDir():
|
||||
cfg_dir = '/usr/lib/systemd/user'
|
||||
if os.path.exists(cfg_dir):
|
||||
return cfg_dir
|
||||
return "/usr/lib/systemd/system"
|
||||
|
||||
|
||||
def getOs():
|
||||
return sys.platform
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ def initDreplace():
|
||||
# mw.writeFile(conf_bin, content)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/gogs.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/gogs.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
@@ -104,7 +104,7 @@ def initDreplace():
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/memcached.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/memcached.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
@@ -63,7 +63,7 @@ if [ -f /usr/lib/systemd/system/mongod.service ];then
|
||||
fi
|
||||
|
||||
wget -qO - https://www.mongodb.org/static/pgp/server-${VERSION}.asc | sudo apt-key add -
|
||||
sudo apt install gnupg
|
||||
apt install -y gnupg
|
||||
touch /etc/apt/sources.list.d/mongodb-org-${VERSION}.list
|
||||
lsb_release -dc
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ def initDreplace(version=''):
|
||||
mw.writeFile(mysql_conf, content)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/mysql.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/mysql.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
@@ -174,7 +174,7 @@ def initDreplace():
|
||||
confReplace()
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/openresty.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/openresty.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
@@ -253,7 +253,7 @@ def initReplace(version):
|
||||
mw.execShell('chown -R www:www ' + upload_path)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/php' + version + '.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/php.service.tpl'
|
||||
if version == '52':
|
||||
|
||||
@@ -117,7 +117,7 @@ def initDreplace():
|
||||
mw.writeFile(pureFtpdConfig, content)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/pureftp.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/pureftp.service.tpl'
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ def initDreplace():
|
||||
mw.writeFile(dst_conf_init, 'ok')
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/redis.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/redis.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
@@ -126,7 +126,7 @@ def initDreplace():
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/rsyncd.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/rsyncd.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
@@ -147,7 +147,7 @@ def initDreplace():
|
||||
mw.writeFile(getServerDir() + '/sphinx.conf', conf_content)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/sphinx.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/sphinx.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
@@ -81,7 +81,7 @@ def initDreplace():
|
||||
|
||||
confD = getServerDir() + "/conf.d"
|
||||
conf = getServerDir() + "/supervisor.conf"
|
||||
systemDir = '/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/supervisor.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/supervisor.service'
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ def initDreplace():
|
||||
mw.execShell('chmod +x ' + file_bin)
|
||||
|
||||
# systemd
|
||||
systemDir = '/usr/lib/systemd/system'
|
||||
systemDir = mw.systemdCfgDir()
|
||||
systemService = systemDir + '/swap.service'
|
||||
systemServiceTpl = getPluginDir() + '/init.d/swap.service.tpl'
|
||||
if os.path.exists(systemDir) and not os.path.exists(systemService):
|
||||
|
||||
Reference in New Issue
Block a user