This commit is contained in:
midoks
2022-07-11 13:49:25 +08:00
parent d7e0251d1f
commit 9aa2d5f090
13 changed files with 19 additions and 12 deletions
+7
View File
@@ -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
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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':
+1 -1
View File
@@ -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'
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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):
+1 -1
View File
@@ -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'
+1 -1
View File
@@ -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):