Discourse Docker 컨테이너 안에서 nginx를 다시 시작하는 올바른 방법은 무엇인가요?
Docker 컨테이너에는 Debian 10이 설치되어 있는 것으로 보이지만, nginx를 다시 시작하는 일반적인 systemd 방식이 실패합니다.
[root@osestaging1 discourse]# ./launcher enter discourse_ose
root@osestaging1-discourse-ose:/var/www/discourse# cat /etc/issue
Debian GNU/Linux 10 \n \l
root@osestaging1-discourse-ose:/var/www/discourse# systemctl restart nginx
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
root@osestaging1-discourse-ose:/var/www/discourse#
init.d 스크립트가 있는 것으로 보이지만, 이를 실행해도 실패합니다. 로그에는 이미 사용 중인 주소에 바인드할 수 없어서라고 나와 있습니다.
root@osestaging1-discourse-ose:/etc/nginx/conf.d# /etc/init.d/nginx restart
[FAIL] Restarting nginx: nginx failed!
root@osestaging1-discourse-ose:/etc/nginx/conf.d# tail /var/log/nginx/error.log
2019/11/12 10:32:45 [emerg] 1123#1123: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:45 [emerg] 1123#1123: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:45 [emerg] 1123#1123: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:45 [emerg] 1123#1123: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:45 [emerg] 1123#1123: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:45 [emerg] 1123#1123: still could not bind()
2019/11/12 10:32:47 [emerg] 1127#1127: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:47 [emerg] 1127#1127: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:47 [emerg] 1127#1127: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
2019/11/12 10:32:47 [emerg] 1127#1127: bind() to unix:/shared/nginx.http.sock failed (98: Address already in use)
실제로 nginx는 이미 실행 중입니다.
root@osestaging1-discourse-ose:/etc/nginx/conf.d# ps -ef | grep -i nginx
root 46 40 0 10:19 ? 00:00:00 runsv nginx
root 1174 46 1 10:33 ? 00:00:00 /usr/sbin/nginx
root 1177 108 0 10:33 pts/1 00:00:00 grep -i nginx
root@osestaging1-discourse-ose:/etc/nginx/conf.d#
위 nginx 프로세스를 종료하고 다시 시작하는 올바른 방법은 무엇인가요?