[그누6실서비스] 4/8 - 시스템 유닛 파일 작성 정보
[그누6실서비스] 4/8 - 시스템 유닛 파일 작성
본문
시스템 서비스 유닛 파일 작성하기
ubuntu@sirsoft-235928:~/g6$ sudo su
root@sirsoft-235928:/home/ubuntu/g6# vi /etc/systemd/system/uvicorn.service
root@sirsoft-235928:/home/ubuntu/g6# systemctl daemon-reload
root@sirsoft-235928:/home/ubuntu/g6# systemctl restart uvicorn.service
root@sirsoft-235928:/home/ubuntu/g6# systemctl status uvicorn.service
● uvicorn.service - Uvicorn server with virtual environment
Loaded: loaded (/etc/systemd/system/uvicorn.service; disabled; vendor preset: enabled)
Active: active (running) since Thu 2024-01-18 12:20:14 KST; 8s ago
...
# Active: active (running) 이 나와야 정상 작동 하는 것입니다.
# 시스템 부팅시 자동으로 시작하도록 설정하는 데 사용합니다.
root@sirsoft-235928:/home/ubuntu/g6# systemctl enable uvicorn.service
Created symlink /etc/systemd/system/multi-user.target.wants/uvicorn.service → /etc/systemd/system/uvicorn.service.
/etc/systemd/system/uvicorn.service
[Unit]
Description=Uvicorn server with virtual environment
After=network.target
[Service]
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu/g6
Environment="PATH=/home/ubuntu/g6/venv/bin"
ExecStart=/home/ubuntu/g6/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000 --log-config log_config.ini
[Install]
WantedBy=multi-user.target
다음글에 이어집니다.
!-->!-->
추천
0
0
댓글 0개