Compare commits

..

4 Commits

Author SHA1 Message Date
Alexey Barabanov
9fc05e08fa Добавленны команды для установки и проверки логов 2025-11-13 13:44:29 +03:00
Alexey Barabanov
65b0b63cca Изменена работа с окружением 2025-11-13 13:38:42 +03:00
Alexey Barabanov
6aa58afd71 Изменён SyslogIdentifier на AFS 2025-11-13 13:37:33 +03:00
Alexey Barabanov
f0132475f2 Убранна "Защита сервиса" 2025-11-13 13:26:40 +03:00
3 changed files with 20 additions and 11 deletions

View File

@@ -40,8 +40,7 @@ if PLACEHOLDER:
else:
return fake_resp("error")
pprint(f"Загрузка файла окружения = {load_dotenv(dotenv_path="/mnt/aescript/.env",verbose=True)}",)
load_dotenv(dotenv_path="/mnt/aescript/.env")
pprint(f"Локальный файл окружения ={load_dotenv(verbose=True)}")
NAS_USER = os.getenv("NAS_USER")
NAS_PASS = os.getenv("NAS_PASS")
NAS_IP = os.getenv("NAS_IP")

View File

@@ -11,12 +11,6 @@ Group=eng
WorkingDirectory=/home/eng/
EnvironmentFile=/mnt/aescript/.env
# Защита сервиса
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/home/eng/ /mnt/aescript/
# Лимиты ресурсов
MemoryMax=1G
CPUQuota=80%
@@ -24,7 +18,7 @@ CPUQuota=80%
ExecStart=/home/eng/.venv/bin/python AF_script_test_4.py
StandardOutput=journal
StandardError=journal
SyslogIdentifier=AF
SyslogIdentifier=AFS
# Поведение при перезапуске
Restart=always

View File

@@ -1,2 +1,18 @@
# AF_script
## AF_script
# Установка
Копируем сервис из репозитория.
```shell
sudo cp ~/main/Auto_Anons_Generator.service /etc/systemd/system/Auto_Anons_Generator.service
```
Обновляем список сервисов
```shell
systemctl daemon-reload
```
Запускаем сервис
```shell
systemctl start Auto_Anons_Generator.service
```
# Проверка логов
```shell
sudo journalctl -t AFS
```