it-swarm-ja.com

initスクリプトの誤動作が原因でパッケージが適切に構成されていない場合の対処方法は?

私が知る限り完全に機能しているmysql5.5のインストールがありますが、実行するたびにaptitude install someProgramインストールを完了しようとし、新しいmysqlパスワードを設定するように求められますが、それでも失敗します。

それが機能するので、私はそれをアンインストールしたくありません、そして私はそれを再インストールしようとしました、しかしこれと同じ問題は毎回起こります。

パッケージをインストール済みとしてマークして、何かをインストールするたびにaptitudeがmysqlの構成を試みる(そして失敗する)のに1分も費やさないようにすることは可能ですか?

[〜#〜] edit [〜#〜]:これが適性の出力ですが、新しいバージョンはさらに下にあります

[email protected]:~# aptitude install fping
The following NEW packages will be installed:
  fping
The following partially installed packages will be configured:
  mysql-server mysql-server-5.5
0 packages upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 35.0 kB of archives. After unpacking 114 kB will be used.
Get: 1 http://http.debian.net/debian/ wheezy/main fping armhf 3.2-1 [35.0 kB]
Fetched 35.0 kB in 0s (86.4 kB/s)
Selecting previously unselected package fping.
(Reading database ... 29917 files and directories currently installed.)
Unpacking fping (from .../archives/fping_3.2-1_armhf.deb) ...
Processing triggers for man-db ...
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
[ ok ] Starting MySQL database server: mysqld . ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Setting up fping (3.2-1) ...
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
130711 11:36:34 [ERROR] An old style --language value with language specific part detected: /usr/share/mysql/english/
130711 11:36:34 [ERROR] Use --lc-messages-dir without language specific part instead.
130711 11:36:34 [Note] Plugin 'FEDERATED' is disabled.
130711 11:36:34 InnoDB: The InnoDB memory heap is disabled
130711 11:36:34 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130711 11:36:34 InnoDB: Compressed tables use zlib 1.2.7
130711 11:36:34 InnoDB: Using Linux native AIO
130711 11:36:34 InnoDB: Initializing buffer pool, size = 128.0M
130711 11:36:35 InnoDB: Completed initialization of buffer pool
130711 11:36:35 InnoDB: highest supported file format is Barracuda.
130711 11:36:36  InnoDB: Waiting for the background threads to start
130711 11:36:37 InnoDB: 5.5.31 started; log sequence number 1595695
130711 11:36:37  InnoDB: Starting shutdown...
130711 11:36:38  InnoDB: Shutdown completed; log sequence number 1595695
[ ok ] Starting MySQL database server: mysqld . ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server

EDIT2:kostixが変更された後の新しい適性出力は次のとおりです。

[email protected]:~# grep -rFw language /etc/mysql/
/etc/mysql/my.cnf:language        = /usr/share/mysql/english
[email protected]:~# nano /etc/mysql/my.cnf
[email protected]:~# aptitude install
The following partially installed packages will be configured:
  mysql-server mysql-server-5.5
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
[ ok ] Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
[ ok ] Stopping MySQL database server: mysqld.
130711 13:10:35 [Note] Plugin 'FEDERATED' is disabled.
130711 13:10:35 InnoDB: The InnoDB memory heap is disabled
130711 13:10:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130711 13:10:35 InnoDB: Compressed tables use zlib 1.2.7
130711 13:10:35 InnoDB: Using Linux native AIO
130711 13:10:35 InnoDB: Initializing buffer pool, size = 128.0M
130711 13:10:35 InnoDB: Completed initialization of buffer pool
130711 13:10:35 InnoDB: highest supported file format is Barracuda.
130711 13:10:35  InnoDB: Waiting for the background threads to start
130711 13:10:36 InnoDB: 5.5.31 started; log sequence number 1595695
130711 13:10:36  InnoDB: Starting shutdown...
130711 13:10:37  InnoDB: Shutdown completed; log sequence number 1595695
[ ok ] Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server

EDIT3:-u -e -xフラグを設定します:

[email protected]:~# aptitude install screen
The following NEW packages will be installed:
  screen 
The following partially installed packages will be configured:
  mysql-server mysql-server-5.5 
0 packages upgraded, 1 newly installed, 0 to remove and 30 not upgraded.
Need to get 633 kB of archives. After unpacking 824 kB will be used.
Get: 1 http://http.debian.net/debian/ wheezy/main screen armhf 4.1.0~20120320gitdb59704-7 [633 kB]
Fetched 633 kB in 1s (443 kB/s) 
Selecting previously unselected package screen.
(Reading database ... 29927 files and directories currently installed.)
Unpacking screen (from .../screen_4.1.0~20120320gitdb59704-7_armhf.deb) ...
Processing triggers for install-info ...
Processing triggers for man-db ...
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Setting up screen (4.1.0~20120320gitdb59704-7) ...
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
Stopping MySQL database server: mysqld.
130711 16:39:19 [Note] Plugin 'FEDERATED' is disabled.
130711 16:39:19 InnoDB: The InnoDB memory heap is disabled
130711 16:39:19 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130711 16:39:19 InnoDB: Compressed tables use zlib 1.2.7
130711 16:39:19 InnoDB: Using Linux native AIO
130711 16:39:19 InnoDB: Initializing buffer pool, size = 128.0M
130711 16:39:19 InnoDB: Completed initialization of buffer pool
130711 16:39:19 InnoDB: highest supported file format is Barracuda.
130711 16:39:19  InnoDB: Waiting for the background threads to start
130711 16:39:20 InnoDB: 5.5.31 started; log sequence number 1595695
130711 16:39:21  InnoDB: Starting shutdown...
130711 16:39:22  InnoDB: Shutdown completed; log sequence number 1595695
Starting MySQL database server: mysqld ..
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-5.5
 mysql-server
2
Filip Haglund

最初の問題(MySQLエラー)

それらの[ERROR]ビットについて…

してください

# grep -rFw language /etc/mysql/

私が思ったように、あなたの設定ファイルはまだ非推奨の設定オプションを参照しています。

たとえば、SqueezeからアップグレードされたWheezyシステムの1つには、次のものがあります。

# grep -rFw language /etc/mysql
/etc/mysql/my.cnf.dpkg-old:language     = /usr/share/mysql/english
# grep -rFw lc-messages-dir /etc/mysql
/etc/mysql/my.cnf:lc-messages-dir       = /usr/share/mysql

古いディレクティブは.dpkg-oldファイル(使用されていません)にあり、lc-messages-dirは「アクティブ」ファイルにあることに注意してください。

アクティブな構成ファイルのlanguageオプションをコメントアウトすると、これが修正されるはずです。 MySQLは、*.cnfディレクトリから/etc/mysql/conf.dパターンに一致するすべてのファイルもロードすることに注意してください。

2番目の問題(MySQLデーモンの起動の失敗)

この問題を回避するための簡単なハック:テキストエディターで/etc/init.d/mysql rcファイルを開き、スクリプト引数でディスパッチするケーススイッチを見つけ、開始引数を処理するブランチの最初のコマンドの前にexit 0を置きます。次に、dpkg --configure --pendingを実行します。 (おそらく)成功した​​ら、編集を元に戻します。

このトリックの背後にある考え方は、rc-scriptの開始ターゲットを正常に完了するようにすることです。同じアプローチは、インストール後のスクリプト(Debian開発者の用語ではpostinstスクリプト)が誤動作する場合にパッケージのアンインストールを処理するのにも役立つ場合があります— exit 0/var/lib/dpkg/info/<packagename>.postinstスクリプトの先頭近くに配置し、通常はdpkg --configure --pendingを実行します役立ちます。

しかし、通常の太字の警告が適用されます:そのようなアドバイスに盲目的に従わないでください:パッケージ構成スクリプトは単にエラーを出すだけではありませんユーザーを不満にさせる—通常、特定の構成やクリーンアップなどを実行するため、説明されているような手段を最後の手段として扱う必要があります。

3
kostix