diff --git a/class/core/config_api.py b/class/core/config_api.py index 6bc6e7584..ec9c61e6e 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -19,6 +19,7 @@ class config_api: # openresty 自启动 done # php 自启动 done # mysql 自启动 done + # memcached 自启动 done __version = '0.5.2' def __init__(self): diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py index 6179a3eb6..1b85a770a 100755 --- a/class/core/plugins_api.py +++ b/class/core/plugins_api.py @@ -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, '已将卸载成功!') diff --git a/plugins/memcached/index.py b/plugins/memcached/index.py index 4e8c857ba..1b0a527d6 100755 --- a/plugins/memcached/index.py +++ b/plugins/memcached/index.py @@ -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' diff --git a/plugins/memcached/install.sh b/plugins/memcached/install.sh index 1b91191b5..b750fc735 100755 --- a/plugins/memcached/install.sh +++ b/plugins/memcached/install.sh @@ -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 }