![Debian 8 openSIPS는 MySQL 오류로 인해 부팅이 끝날 때 MySQL이 종료되기 전에 시작됩니다.](https://linux55.com/image/128502/Debian%208%20openSIPS%EB%8A%94%20MySQL%20%EC%98%A4%EB%A5%98%EB%A1%9C%20%EC%9D%B8%ED%95%B4%20%EB%B6%80%ED%8C%85%EC%9D%B4%20%EB%81%9D%EB%82%A0%20%EB%95%8C%20MySQL%EC%9D%B4%20%EC%A2%85%EB%A3%8C%EB%90%98%EA%B8%B0%20%EC%A0%84%EC%97%90%20%EC%8B%9C%EC%9E%91%EB%90%A9%EB%8B%88%EB%8B%A4..png)
Debian 8.10에서 MySQL과 함께 openSIPS 2.3을 설치하고 구성했지만 시작 시 openSIPS가 MySQL보다 먼저 시작되고 데이터베이스에 연결할 수 없기 때문에 시작되지 않습니다. 시스템이 시작된 후 opensips를 정상적으로 시작할 수 있습니다.
openSIPS 메일링 리스트에서 해결책처럼 보이는 해결책을 찾았지만 여전히 동일한 오류가 발생합니다.
지금까지 내가 한 일은 /etc/init.d/opensisp
초기화 정보를 편집하여 다음과 같이 변경하는 것이었습니다.
### BEGIN INIT INFO
# Provides: opensips
# Required-Start: $syslog $network $local_fs $time
# Required-Stop: $syslog $network $local_fs
# Should-Start: mysql #added this
# Should-Stop: mysql #and this
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the OpenSIPS SIP server
# Description: Start the OpenSIPS SIP server
### END INIT INFO
실행 insserv -v opensips
하고 다시 시작한 것과 동일하지만 데이터베이스 오류에 연결할 수 없어 opensisp가 실패합니다.
ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ERROR:db_mysql:db_mysql_new_connection: initial connect failed
mysql 에 따르면 /ętc/rc?.d
opensips보다 먼저 시작해야 하지만 그렇지 않거나 opensips가 시작될 때 mysql이 완전히 시작되지 않습니다.
rc
다음은 mysql과 opensips의 덤프입니다.
lrwxrwxrwx 1 root root 15 febr 23 21:56 /etc/rc0.d/K02mysql -> ../init.d/mysql
lrwxrwxrwx 1 root root 15 febr 23 21:56 /etc/rc1.d/K02mysql -> ../init.d/mysql
lrwxrwxrwx 1 root root 15 febr 23 21:56 /etc/rc2.d/S03mysql -> ../init.d/mysql
lrwxrwxrwx 1 root root 15 febr 23 21:56 /etc/rc3.d/S03mysql -> ../init.d/mysql
lrwxrwxrwx 1 root root 15 febr 23 21:56 /etc/rc4.d/S03mysql -> ../init.d/mysql
lrwxrwxrwx 1 root root 15 febr 23 21:56 /etc/rc5.d/S03mysql -> ../init.d/mysql
lrwxrwxrwx 1 root root 15 febr 23 21:56 /etc/rc6.d/K02mysql -> ../init.d/mysql
############
lrwxrwxrwx 1 root root 18 febr 25 01:17 /etc/rc0.d/K01opensips -> ../init.d/opensips
lrwxrwxrwx 1 root root 18 febr 25 01:17 /etc/rc1.d/K01opensips -> ../init.d/opensips
lrwxrwxrwx 1 root root 18 febr 27 10:40 /etc/rc2.d/S04opensips -> ../init.d/opensips
lrwxrwxrwx 1 root root 18 febr 27 10:40 /etc/rc3.d/S04opensips -> ../init.d/opensips
lrwxrwxrwx 1 root root 18 febr 27 10:40 /etc/rc4.d/S04opensips -> ../init.d/opensips
lrwxrwxrwx 1 root root 18 febr 27 10:40 /etc/rc5.d/S04opensips -> ../init.d/opensips
lrwxrwxrwx 1 root root 18 febr 25 01:17 /etc/rc6.d/K01opensips -> ../init.d/opensips
openSIPS가 mysql을 기다리도록 강제하는 방법은 무엇입니까?