Merge branch 'dev' of github.com:jumpserver/jumpserver into dev

pull/2357/head
ibuler 2019-01-21 12:27:28 +08:00
commit eee6dd1436
3 changed files with 11 additions and 5 deletions

View File

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

View File

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

4
jms
View File

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