memcached 自启动 done

pull/109/head
Mr Chen 6 years ago
parent 61cd0cdfb1
commit 0a85208fce
  1. 1
      class/core/config_api.py
  2. 3
      class/core/plugins_api.py
  3. 4
      plugins/memcached/index.py
  4. 19
      plugins/memcached/install.sh

@ -19,6 +19,7 @@ class config_api:
# openresty 自启动 done
# php 自启动 done
# mysql 自启动 done
# memcached 自启动 done
__version = '0.5.2'
def __init__(self):

@ -165,6 +165,9 @@ class plugins_api:
+ " uninstall " + version
data = public.execShell(execstr)
if public.isAppleSystem():
print execstr
print data[0],data[1]
return public.returnJson(True, '卸载执行成功!')
# if data[1] == '':
# return public.returnJson(True, '已将卸载成功!')

@ -194,10 +194,12 @@ def initdInstall():
if public.isAppleSystem():
return "Apple Computer does not support"
mem_bin = initDreplace()
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@ -205,6 +207,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'

@ -1,4 +1,5 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
@ -7,35 +8,31 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
Install_mem()
{
Install_mem(){
mkdir -p $serverPath/source
echo '正在安装脚本文件...' > $install_tmp
if [ ! -f $serverPath/source/memcached.tar.gz ];then
wget -O $serverPath/source/memcached.tar.gz http://www.memcached.org/files/memcached-1.5.12.tar.gz
if
fi
cd $serverPath/source && tar -zxvf memcached.tar.gz
mkdir -p $serverPath/memcached
cd memcached* && ./configure --prefix=$serverPath/memcached && make && make install
cd $serverPath/source/memcached*
./configure --prefix=$serverPath/memcached && make && make install
echo '1.5' > $serverPath/memcached/version.pl
echo '安装完成' > $install_tmp
echo 'install ok' > $install_tmp
}
Uninstall_mem()
{
$serverPath/memcached/init.d/memcached stop
rm -rf mkdir -p $serverPath/memcached
${serverPath}/memcached/init.d/memcached stop
rm -rf $serverPath/memcached
}

Loading…
Cancel
Save