장고 306 페이지 active:failed(Result: exit-code)
systemctl start하고 status를 실행하면 다음과 같이 Active:fialed 오류가 발생합니다. 어디가 잘못된 것일까요?
아래 HaltServer 관련 오류인거 같은데 어떻게 해결해야 하나요?
(mysite) ubuntu@ip-172-26-11-149:/etc/systemd/system$ sudo systemctl start mysite.service
(mysite) ubuntu@ip-172-26-11-149:/etc/systemd/system$ sudo systmectl status mysite.service
sudo: systmectl: command not found
(mysite) ubuntu@ip-172-26-11-149:/etc/systemd/system$ sudo systemctl status mysite.service
● mysite.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/mysite.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2022-12-26 23:37:20 KST; 57s ago
Process: 103229 ExecStart=/home/ubuntu/venvs/mysite/bin/gunicorn --workers 2 --bind unix:/tmp/gunicorn.sock config.wsgi:application (code=exited, status=>
Main PID: 103229 (code=exited, status=1/FAILURE)
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: self.stop()
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/gunicorn/arbiter.py", line 393, in stop
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: time.sleep(0.1)
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_ch>
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: self.reap_workers()
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_work>
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
Dec 26 23:37:20 ip-172-26-11-149 gunicorn[103229]: gunicorn.errors.HaltServer:
Dec 26 23:37:20 ip-172-26-11-149 systemd[1]: mysite.service: Main process exited, code=exited, status=1/FAILURE
Dec 26 23:37:20 ip-172-26-11-149 systemd[1]: mysite.service: Failed with result 'exit-code'.
lines 1-16/16 (END)
/var/log/syslog에서도 아래쪽에 다음과 같은 오류가 뜹니다.
Dec 27 00:16:52 ip-172-26-11-149 gunicorn[103345]: gunicorn.errors.HaltServer:
Dec 27 00:16:52 ip-172-26-11-149 systemd[1]: mysite.service: Main process exited, code=exited, status=1/FAILURE
Dec 27 00:16:52 ip-172-26-11-149 systemd[1]: mysite.service: Failed with result 'exit-code'.
cezips 님 804
2022년 12월 27일 12:28 오전
1개의 답변이 있습니다. 1 / 1 Page
서비스 화일을 다음과 같이 작성했습니다.
"""
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu/projects/mysite
EnvironmentFile=/home/ubuntu/venvs/mysite.env
ExecStart=/home/ubuntu/venvs/mysite/bin/gunicorn \
--workers 2 \
--bind unix:/tmp/gunicorn.sock \
config.wsgi:application
[Install]
WantedBy=multi-user.target
"""
cezips 님
2022년 12월 28일 10:45 오후