@@ -245,15 +245,18 @@ function st2start(){
245245 screen -ls | grep mistral | cut -d. -f1 | awk ' {print $1}' | xargs kill
246246 fi
247247
248+ # NOTE: We can't rely on latest version of screen with "-Logfile path"
249+ # option so we need to use screen config file per screen window
250+
248251 # Run the st2 API server
249252 echo ' Starting screen session st2-api...'
250253 if [ " ${use_gunicorn} " = true ]; then
251254 echo ' using gunicorn to run st2-api...'
252255 export ST2_CONFIG_PATH=${ST2_CONF}
253- screen -d -m -S st2-api ${VIRTUALENV} /bin/gunicorn \
256+ screen -L -c tools/screen-configs/st2api.conf - d -m -S st2-api ${VIRTUALENV} /bin/gunicorn \
254257 st2api.wsgi:application -k eventlet -b " $BINDING_ADDRESS :9101" --workers 1
255258 else
256- screen -d -m -S st2-api ${VIRTUALENV} /bin/python \
259+ screen -L -c tools/screen-configs/st2api.conf - d -m -S st2-api ${VIRTUALENV} /bin/python \
257260 ./st2api/bin/st2api \
258261 --config-file $ST2_CONF
259262 fi
@@ -262,10 +265,10 @@ function st2start(){
262265 if [ " ${use_gunicorn} " = true ]; then
263266 echo ' using gunicorn to run st2-stream'
264267 export ST2_CONFIG_PATH=${ST2_CONF}
265- screen -d -m -S st2-stream ${VIRTUALENV} /bin/gunicorn \
268+ screen -L -c tools/screen-configs/st2stream.conf - d -m -S st2-stream ${VIRTUALENV} /bin/gunicorn \
266269 st2stream.wsgi:application -k eventlet -b " $BINDING_ADDRESS :9102" --workers 1
267270 else
268- screen -d -m -S st2-stream ${VIRTUALENV} /bin/python \
271+ screen -L -c tools/screen-configs/st2stream.conf - d -m -S st2-stream ${VIRTUALENV} /bin/python \
269272 ./st2stream/bin/st2stream \
270273 --config-file $ST2_CONF
271274 fi
@@ -278,7 +281,7 @@ function st2start(){
278281 WORKFLOW_ENGINE_NAME=st2-workflow-$i
279282 WORKFLOW_ENGINE_SCREENS+=($WORKFLOW_ENGINE_NAME )
280283 echo ' starting ' $WORKFLOW_ENGINE_NAME ' ...'
281- screen -d -m -S $WORKFLOW_ENGINE_NAME ${VIRTUALENV} /bin/python \
284+ screen -L -c tools/screen-configs/st2workflowengine.conf - d -m -S $WORKFLOW_ENGINE_NAME ${VIRTUALENV} /bin/python \
282285 ./st2actions/bin/st2workflowengine \
283286 --config-file $ST2_CONF
284287 done
@@ -291,14 +294,14 @@ function st2start(){
291294 RUNNER_NAME=st2-actionrunner-$i
292295 RUNNER_SCREENS+=($RUNNER_NAME )
293296 echo ' starting ' $RUNNER_NAME ' ...'
294- screen -d -m -S $RUNNER_NAME ${VIRTUALENV} /bin/python \
297+ screen -L -c tools/screen-configs/st2actionrunner.conf - d -m -S $RUNNER_NAME ${VIRTUALENV} /bin/python \
295298 ./st2actions/bin/st2actionrunner \
296299 --config-file $ST2_CONF
297300 done
298301
299302 # Run the garbage collector service
300303 echo ' Starting screen session st2-garbagecollector'
301- screen -d -m -S st2-garbagecollector ${VIRTUALENV} /bin/python \
304+ screen -L -c tools/screen-configs/st2garbagecollector.conf - d -m -S st2-garbagecollector ${VIRTUALENV} /bin/python \
302305 ./st2reactor/bin/st2garbagecollector \
303306 --config-file $ST2_CONF
304307
@@ -310,38 +313,38 @@ function st2start(){
310313 SCHEDULER_NAME=st2-scheduler-$i
311314 SCHEDULER_SCREENS+=($SCHEDULER_NAME )
312315 echo ' starting ' $SCHEDULER_NAME ' ...'
313- screen -d -m -S $SCHEDULER_NAME ${VIRTUALENV} /bin/python \
316+ screen -L -c tools/screen-configs/st2scheduler.conf - d -m -S $SCHEDULER_NAME ${VIRTUALENV} /bin/python \
314317 ./st2actions/bin/st2scheduler \
315318 --config-file $ST2_CONF
316319 done
317320
318321 # Run the sensor container server
319322 echo ' Starting screen session st2-sensorcontainer'
320- screen -d -m -S st2-sensorcontainer ${VIRTUALENV} /bin/python \
323+ screen -L -c tools/screen-configs/st2sensorcontainer.conf - d -m -S st2-sensorcontainer ${VIRTUALENV} /bin/python \
321324 ./st2reactor/bin/st2sensorcontainer \
322325 --config-file $ST2_CONF
323326
324327 # Run the rules engine server
325328 echo ' Starting screen session st2-rulesengine...'
326- screen -d -m -S st2-rulesengine ${VIRTUALENV} /bin/python \
329+ screen -L -c tools/screen-configs/st2rulesengine.conf - d -m -S st2-rulesengine ${VIRTUALENV} /bin/python \
327330 ./st2reactor/bin/st2rulesengine \
328331 --config-file $ST2_CONF
329332
330333 # Run the timer engine server
331334 echo ' Starting screen session st2-timersengine...'
332- screen -d -m -S st2-timersengine ${VIRTUALENV} /bin/python \
335+ screen -L -c tools/screen-configs/st2timersengine.conf - d -m -S st2-timersengine ${VIRTUALENV} /bin/python \
333336 ./st2reactor/bin/st2timersengine \
334337 --config-file $ST2_CONF
335338
336339 # Run the results tracker
337340 echo ' Starting screen session st2-resultstracker...'
338- screen -d -m -S st2-resultstracker ${VIRTUALENV} /bin/python \
341+ screen -L -c tools/screen-configs/st2resultstracker.conf - d -m -S st2-resultstracker ${VIRTUALENV} /bin/python \
339342 ./st2actions/bin/st2resultstracker \
340343 --config-file $ST2_CONF
341344
342345 # Run the actions notifier
343346 echo ' Starting screen session st2-notifier...'
344- screen -d -m -S st2-notifier ${VIRTUALENV} /bin/python \
347+ screen -L -c tools/screen-configs/st2notifier.conf - d -m -S st2-notifier ${VIRTUALENV} /bin/python \
345348 ./st2actions/bin/st2notifier \
346349 --config-file $ST2_CONF
347350
@@ -350,10 +353,10 @@ function st2start(){
350353 if [ " ${use_gunicorn} " = true ]; then
351354 echo ' using gunicorn to run st2-auth...'
352355 export ST2_CONFIG_PATH=${ST2_CONF}
353- screen -d -m -S st2-auth ${VIRTUALENV} /bin/gunicorn \
356+ screen -L -c tools/screen-configs/st2auth.conf - d -m -S st2-auth ${VIRTUALENV} /bin/gunicorn \
354357 st2auth.wsgi:application -k eventlet -b " $BINDING_ADDRESS :9100" --workers 1
355358 else
356- screen -d -m -S st2-auth ${VIRTUALENV} /bin/python \
359+ screen -L -c tools/screen-configs/st2auth.conf - d -m -S st2-auth ${VIRTUALENV} /bin/python \
357360 ./st2auth/bin/st2auth \
358361 --config-file $ST2_CONF
359362 fi
@@ -364,26 +367,25 @@ function st2start(){
364367 sudo mkdir -p $EXPORTS_DIR
365368 sudo chown -R ${CURRENT_USER} :${CURRENT_USER_GROUP} $EXPORTS_DIR
366369 echo ' Starting screen session st2-exporter...'
367- screen -d -m -S st2-exporter ${VIRTUALENV} /bin/python \
370+ screen -L - d -m -S st2-exporter ${VIRTUALENV} /bin/python \
368371 ./st2exporter/bin/st2exporter \
369372 --config-file $ST2_CONF
370373 fi
371374
372375 if [ " ${include_mistral} " = true ]; then
373-
374376 LOGDIR=${ST2_REPO} /logs
375377
376378 # Run mistral-server
377379 echo ' Starting screen session mistral-server...'
378- screen -d -m -S mistral-server ${MISTRAL_REPO} /.venv/bin/python \
380+ screen -L -Logfile logs/screen-mistral-server.log - d -m -S mistral-server ${MISTRAL_REPO} /.venv/bin/python \
379381 ${MISTRAL_REPO} /.venv/bin/mistral-server \
380382 --server engine,executor \
381383 --config-file $MISTRAL_CONF \
382384 --log-file " $LOGDIR /mistral-server.log"
383385
384386 # Run mistral-api
385387 echo ' Starting screen session mistral-api...'
386- screen -d -m -S mistral-api ${MISTRAL_REPO} /.venv/bin/python \
388+ screen -L -Logfile logs/screen-mistral-server.log - d -m -S mistral-api ${MISTRAL_REPO} /.venv/bin/python \
387389 ${MISTRAL_REPO} /.venv/bin/mistral-server \
388390 --server api \
389391 --config-file $MISTRAL_CONF \
0 commit comments