From ec91aa461ac4bace98cfba5fabd0b96c25fdd334 Mon Sep 17 00:00:00 2001 From: changwng Date: Thu, 10 Jul 2025 16:26:44 +0900 Subject: [PATCH] =?UTF-8?q?[all]=20cs=20=EB=B0=8F=20features=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/features/start_13000.sh | 25 +++++++++++++++++++++++++ apps/cs/start_cs.sh | 26 +++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 apps/common/features/start_13000.sh mode change 100644 => 100755 apps/cs/start_cs.sh diff --git a/apps/common/features/start_13000.sh b/apps/common/features/start_13000.sh new file mode 100755 index 000000000..e1ba84bbf --- /dev/null +++ b/apps/common/features/start_13000.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +PORT=13000 +LOG_FILE="start_13000.log" + +# 1. 기존 포트 사용 프로세스 종료 +PID=$(lsof -t -i :$PORT) +if [ -n "$PID" ]; then + echo "Killing process on port $PORT (PID: $PID)" + kill -9 $PID +fi + +# 2. 백그라운드로 앱 시작 (로그 파일로 리디렉션) +echo "Starting app on port $PORT..." +nohup pnpm start > $LOG_FILE 2>&1 & + +# 3. PID 확인 +sleep 1 +NEW_PID=$(lsof -t -i :$PORT) +if [ -n "$NEW_PID" ]; then + echo "App started successfully (PID: $NEW_PID)" + echo "Logs: tail -f $LOG_FILE" +else + echo "Failed to start app. Check logs: $LOG_FILE" +fi \ No newline at end of file diff --git a/apps/cs/start_cs.sh b/apps/cs/start_cs.sh old mode 100644 new mode 100755 index 1cd43e699..7fa2c18a7 --- a/apps/cs/start_cs.sh +++ b/apps/cs/start_cs.sh @@ -1 +1,25 @@ -nohup pnpm start > start.log 2>&1 & \ No newline at end of file +#!/bin/bash + +PORT=3000 +LOG_FILE="start_cs.log" + +# 1. 기존 포트 사용 프로세스 종료 +PID=$(lsof -t -i :$PORT) +if [ -n "$PID" ]; then + echo "Killing process on port $PORT (PID: $PID)" + kill -9 $PID +fi + +# 2. 백그라운드로 앱 시작 (로그 파일로 리디렉션) +echo "Starting app on port $PORT..." +nohup pnpm start > $LOG_FILE 2>&1 & + +# 3. PID 확인 +sleep 1 +NEW_PID=$(lsof -t -i :$PORT) +if [ -n "$NEW_PID" ]; then + echo "App started successfully (PID: $NEW_PID)" + echo "Logs: tail -f $LOG_FILE" +else + echo "Failed to start app. Check logs: $LOG_FILE" +fi \ No newline at end of file