nullvuild

Bloger @nullvuild

Created Date '2025/08/23 오후 11:30

Modified Date '2025/08/23 오후 11:30

#Django 배포 #Gunicorn 설정 #서버 관리 #리눅스 명령어 #systemctl

Django 프로젝트를 운영하다 보면 Gunicorn 프로세스를 완전히 종료한 뒤 다시 시작해야 할 때가 있습니다. 단순히 restart만으로는 남아 있는 프로세스가 영향을 줄 수 있기 때문에, 안전하게 kill → reload → restart 순서를 지켜주는 것이 좋습니다.


아래 명령어를 순서대로 실행하면 됩니다.


pkill -9 -f gunicorn
sudo systemctl daemon-reload
sudo systemctl restart gunicorn
sudo systemctl start gunicorn
sudo systemctl enable gunicorn


순서 설명

  • pkill -9 -f gunicorn : 실행 중인 모든 Gunicorn 프로세스를 강제로 종료합니다.
  • sudo systemctl daemon-reload : systemd 설정을 다시 읽어옵니다.
  • sudo systemctl restart gunicorn : Gunicorn 서비스를 재시작합니다.
  • sudo systemctl start gunicorn : 서비스가 꺼져 있다면 시작합니다.
  • sudo systemctl enable gunicorn : 서버 부팅 시 자동 실행되도록 설정합니다.
Nullvuild

Nullvuild

@nullvuild

프로필