Debian 8 openSIPS は、MySQL エラーによりブートが終了したときに MySQL が終了する前に起動します。

Debian 8 openSIPS は、MySQL エラーによりブートが終了したときに MySQL が終了する前に起動します。

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?.dopensipsの前に起動する必要がありますが、そうでない場合や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を待つように強制する方法は?

ベストアンサー1

おすすめ記事