十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
#!/usr/bin/env python
#coding:utf-8
import os
import sys
def start():
os.system('/usr/local/MongoDB/bin/mongod -f /usr/local/mongodb/conf/mongodb.conf')
def stop():
os.system('/usr/local/mongodb/bin/mongod --shutdown --dbpath /data/mongodb/db')
def status():
os.system('ps aux | grep mongod | grep -v grep')
def callable(input_key):
service_option = {'start': start, 'stop': stop, 'status': status}
return service_option[input_key]()
input_key=sys.argv[1]
callable(input_key)