Initial commit
This commit is contained in:
10
bin/nohup.out
Normal file
10
bin/nohup.out
Normal file
@@ -0,0 +1,10 @@
|
||||
2025/10/26 01:40:52 Ошибка загрузки конфига: open config.yaml: no such file or directory
|
||||
2025/10/26 01:41:33 Ошибка загрузки конфига: open config.yaml: no such file or directory
|
||||
2025/10/26 01:42:54 Запуск приложения
|
||||
2025/10/26 01:42:54 Ошибка загрузки конфига: open config.yaml: no such file or directory
|
||||
2025/10/26 01:43:36 Запуск приложения
|
||||
2025/10/26 01:43:36 Слушаю 127.0.0.1:7001 ...
|
||||
2025/10/26 01:43:50 Запуск приложения
|
||||
2025/10/26 01:43:50 Слушаю 127.0.0.1:7001 ...
|
||||
2025/10/26 01:43:54 Запуск приложения
|
||||
2025/10/26 01:43:54 Слушаю 127.0.0.1:7001 ...
|
||||
8
bin/restart.sh
Executable file
8
bin/restart.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
dir=$(dirname "$0")
|
||||
|
||||
cd $dir
|
||||
|
||||
./stop.sh
|
||||
./start.sh
|
||||
16
bin/start.sh
Executable file
16
bin/start.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
dir=$(dirname "$0")
|
||||
|
||||
cd $dir
|
||||
|
||||
APP="http_logger"
|
||||
|
||||
PID=$(ps -o pid= -C $APP | sed 's/^[ \t]*//')
|
||||
if [ -z "$PID" ]; then
|
||||
nohup ./$APP &
|
||||
PID=$(ps -o pid= -C $APP | sed 's/^[ \t]*//')
|
||||
echo "Процесс $APP был запущен ($PID)."
|
||||
else
|
||||
echo "Процесс $APP уже запущен ($PID)."
|
||||
fi
|
||||
31
bin/stop.sh
Executable file
31
bin/stop.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
APP_NAME="http_logger"
|
||||
|
||||
if [ -z "$APP_NAME" ]; then
|
||||
echo "Usage: $0 <app_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Найти PID по имени процесса
|
||||
PIDS=$(pgrep -f "$APP_NAME")
|
||||
|
||||
if [ -z "$PIDS" ]; then
|
||||
echo "Процесс с именем '$APP_NAME' не найден."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Найден PID: $PIDS"
|
||||
|
||||
for PID in $PIDS; do
|
||||
echo "Отправка SIGTERM процессу $PID..."
|
||||
kill "$PID"
|
||||
|
||||
printf "Ожидание завершения процесса %s" "$PID"
|
||||
while kill -0 "$PID" 2>/dev/null; do
|
||||
printf "."
|
||||
sleep 1
|
||||
done
|
||||
echo ""
|
||||
echo "Процесс $PID завершён."
|
||||
done
|
||||
Reference in New Issue
Block a user