Solarisでパッチを適用する




Solarisで提供されているパッチを適用する

まず始めに、SunSolveからパッチをダウンロードする
(手順)
「Sun support customers:」にログインする(登録がない場合は新規登録する(無料))
「パッチやアップデート」→「推奨 & セキュリティパッチ」
ここから、自分のOSに合ったパッチをダウンロードする。
ちなみに、ページがうまく表示されない場合は、エンコードを「Unicode(UTF-8)」に変更してみる

他にも「推奨パッチクラスタ」などがあるが、
「推奨 & セキュリティパッチ」は「推奨パッチクラスタ」にセキュリティパッチがプラスされたものです。
もしも、セキュリティパッチが出ていない場合はこれらは同等の内容になります。
したがって、運用としては最新の「推奨 & セキュリティパッチ」を適用しておけば良いということになります。

○適用方法
0.本作業前のパッチ適用状況を確認しておく
# showrev -p > /tmp/patch-before.log

1.ダウンロードしてきたファイルを解凍して適当な作業フォルダに置く
# cd /var/tmp
# gzip -d 8_Recommended.zip

2.シングルユーザモードで起動
OBPにて
ok boot -s

解凍してできたフォルダ内で、
3.インストールシェルを実行
# cd 8_Recommended
# ./install_cluster
2時間程度見積もっておいた方が良い。
適用の順番は、同ディレクトリ内の「patch_order」に従っている。

4.パッチの適用状況を確認する
# showrev -p > /var/tmp/patch-after.log
# diff /var/tmp/patch-before.log /var/tmp/patch-after.log | more

5.ログを確認する
ログファイルは、「/var/sadm/install_data/Solaris_8_Recommended_Patch_Cluster_log」
標準出力を見ていると、次のようなメッセージが出力される
Installation of 116455-01 failed. Return code 2.
Installation of 117000-05 failed. Return code 8.
気になるのでログを確認してみると
Installing 116455-01...

Checking installed patches...
Patch 116455-01 has already been applied.
See patchadd(1M) for instructions.

Patchadd is terminating.
あるいは、
Installing 117000-05...

Checking installed patches...
Re-installing patch 117000-05...
One or more patch packages included in
117000-05 are not installed on this system.

Patchadd is terminating.
と、なっているので無視して良い

もしも、他の「Return code」が出力された場合は、
「/usr/sbin/patchadd」スクリプトの中身を参照する。
# Exit Codes:
#               0       No error
#               1       Usage error
#               2       Attempt to apply a patch that's already been applied
#               3       Effective UID is not root
#               4       Attempt to save original files failed
#               5       pkgadd failed
#               6       Patch is obsoleted
#               7       Invalid package directory
#               8       Attempting to patch a package that is not installed
#               9       Cannot access /usr/sbin/pkgadd (client problem)
#               10      Package validation errors
#               11      Error adding patch to root template
#               12      Patch script terminated due to signal
#               13      Symbolic link included in patch
#               14      NOT USED
#               15      The prepatch script had a return code other than 0.
#               16      The postpatch script had a return code other than 0.
#               17      Mismatch of the -d option between a previous patch
#                       install and the current one.
#               18      Not enough space in the file systems that are targets
#                       of the patch.
#               19      $SOFTINFO/INST_RELEASE file not found
#               20      A direct instance patch was required but not found
#               21      The required patches have not been installed on the manager
#               22      A progressive instance patch was required but not found
#               23      A restricted patch is already applied to the package
#               24      An incompatible patch is applied
#               25      A required patch is not applied
#               26      The user specified backout data can't be found
#               27      The relative directory supplied can't be found
#               28      A pkginfo file is corrupt or missing
#               29      Bad patch ID format
#               30      Dryrun failure(s)
#               31      Path given for -C option is invalid
#               32      Must be running Solaris 2.6 or greater
#               33      Bad formatted patch file or patch file not found
#               34      Incorrect patch spool directory
#               35      Later revision already installed
#               36      Cannot create safe temporary directory
#               37      Illegal backout directory specified
#               38      A prepatch, prePatch or a postpatch script could not be
#                       executed
#