diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index a7aef986e..019bf5748 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -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) diff --git a/entrypoint.sh b/entrypoint.sh index d48d83cb1..a9beb2ef5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 diff --git a/jms b/jms index a5d105c75..a72849124 100755 --- a/jms +++ b/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)