systemctl의 .service 구성파일인
/etc/systemd/system폴더의 {{앱이름}}.service 파일을 열어서
# {실행할 서비스명}.service 파일
[Unit]
Description=Unity Project server daemon
[Service]
#보통 장기적으로 수행해야 하는 경우 simple이 가장 적합하다.
Type=simple
#dotnet의 경우 dotnet 경로를 앞에 붙이고
#뒤에 실행할 파일의 경로 및 파일이름을 기재해야 한다.
ExecStart=/usr/bin/dotnet /{실행할 파일 경로 포함.dll}
# ensure the service restarts after crashing
Restart=always
# amount of time to wait before restarting the service
RestartSec=5
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
이 안에
WorkingDirectory=/wwwroot/프로젝트디렉토리
를 추가 해주면 됩니다.
'Software > .Net Core' 카테고리의 다른 글
nuget 패키지 제작 시 js파일 등 asset 파일 포함하기 (0) | 2023.03.28 |
---|---|
EntityFrameWork에서 .Max() 값의 Null 체크 방법 (0) | 2023.02.08 |
Linux에 Nginx를 통한 .net core 웹앱 배포 (0) | 2023.02.07 |