[Update] 启动脚本

pull/2357/head
ibuler 6 years ago
parent c8d007f9d7
commit 384cdfbc19

@ -25,9 +25,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PROJECT_DIR = os.path.dirname(BASE_DIR)
CONFIG = load_user_config()
LOG_DIR = os.path.join(PROJECT_DIR, 'logs')
HOSTNAME = socket.gethostname()
JUMPSERVER_LOG_FILE = os.path.join(LOG_DIR, 'jumpserver-{}.log'.format(HOSTNAME))
ANSIBLE_LOG_FILE = os.path.join(LOG_DIR, 'ansible-{}.log'.format(HOSTNAME))
JUMPSERVER_LOG_FILE = os.path.join(LOG_DIR, 'jumpserver.log')
ANSIBLE_LOG_FILE = os.path.join(LOG_DIR, 'ansible.log')
if not os.path.isdir(LOG_DIR):
os.makedirs(LOG_DIR)

@ -7,5 +7,10 @@ function cleanup()
fi
}
service="all"
if [ "$1" != "" ];then
service=$1
fi
trap cleanup EXIT
python jms start all
python jms start $service

4
jms

@ -120,6 +120,8 @@ def is_running(s, unlink=True):
def parse_service(s):
if s == 'all':
return all_services
elif "," in s:
return [i.strip() for i in s.split(',')]
else:
return [s]
@ -316,7 +318,7 @@ if __name__ == '__main__':
)
parser.add_argument(
"service", type=str, default="all", nargs="?",
choices=("all", "gunicorn", "celery", "beat"),
choices=("all", "gunicorn", "celery", "beat", "celery,beat"),
help="The service to start",
)
parser.add_argument('-d', '--daemon', nargs="?", const=1)

Loading…
Cancel
Save