Dec 192006
 

久々にSolarisパッチのバックアウトをする羽目になりました。

CSWパッケージのTomcat5を入れようと思ったら、useraddでエラーが。

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <CSWtomcat5> [y,n,?] y

Installing tomcat5 - Apache Jakarta Tomcat 5.5 Servlet/JSP Container as <CSWtomcat5>

## Executing preinstall script.
ld.so.1: useradd: fatal: libc.so.1: version `SUNW_1.22.2' not found (required by file /usr/sbin/useradd)
ld.so.1: useradd: fatal: libc.so.1: open failed: No such file or directory
Killed
user tomcat has been added
ERROR: Failed to add user tomcat
pkgadd: ERROR: preinstall script did not complete successfully

Installation of <CSWtomcat5> failed.
ERROR: could not add CSWtomcat5.
#

sunsolveをあたってみるとこちらのバグがもろヒット。

120050-03か120050-04が適用済みの環境で発生するとのこと。うちは120050-04が適用済みでした。

# showrev -p|grep 120050
Patch: 120050-02 Obsoletes:  Requires:  Incompatibles:  Packages: SUNWcsu
Patch: 120050-04 Obsoletes:  Requires:  Incompatibles:  Packages: SUNWcsu

ということでpatchrmします。

# patchrm 120050-04
Validating patches...

Loading patches installed on the system...

Done!

Checking patches that you specified for removal.

Done!

Approved patches will be removed in this order:

120050-04

Checking installed patches...

Backing out patch 120050-04...

Patch 120050-04 has been backed out.

#

最近ディスク領域が厳しくなりつつあったので、そろそろバックアウトディレクトリ(/var/sadm/pkg/*/save)を掃除しようかと思ってたのですが、やらなくてよかったです。

Dec 132006
 

SolarisのNICをDuplex Fullにしたり、100M固定化するには大抵nddコマンドを使います(ドライバによって異なるのでドライバのmanページを見るのが確実)。

実際の動作状態をみるにはdladmコマンドを使います。

# dladm show-dev
hme0            link: unknown   speed: 100   Mbps       duplex: full
qfe0            link: unknown   speed: 0     Mbps       duplex: unknown
qfe1            link: unknown   speed: 0     Mbps       duplex: unknown
qfe2            link: unknown   speed: 0     Mbps       duplex: unknown
qfe3            link: unknown   speed: 0     Mbps       duplex: unknown
# dladm show-link
hme0            type: legacy    mtu: 1500       device: hme0
qfe0            type: legacy    mtu: 1500       device: qfe0
qfe1            type: legacy    mtu: 1500       device: qfe1
qfe2            type: legacy    mtu: 1500       device: qfe2
qfe3            type: legacy    mtu: 1500       device: qfe3

上のhme0にはndd等で何か設定したわけではないので、実際の動作状態が表示されていることになります。

# ndd /dev/hme \?
?                             (read only)
transceiver_inuse             (read only)
link_status                   (read only)
link_speed                    (read only)
link_mode                     (read only)
ipg1                          (read and write)
ipg2                          (read and write)
use_int_xcvr                  (read and write)
pace_size                     (read and write)
adv_autoneg_cap               (read and write)
adv_100T4_cap                 (read and write)
adv_100fdx_cap                (read and write)
adv_100hdx_cap                (read and write)
adv_10fdx_cap                 (read and write)
adv_10hdx_cap                 (read and write)
autoneg_cap                   (read only)
100T4_cap                     (read only)
100fdx_cap                    (read only)
100hdx_cap                    (read only)
10fdx_cap                     (read only)
10hdx_cap                     (read only)
lp_autoneg_cap                (read only)
lp_100T4_cap                  (read only)
lp_100fdx_cap                 (read only)
lp_100hdx_cap                 (read only)
lp_10fdx_cap                  (read only)
lp_10hdx_cap                  (read only)
instance                      (read and write)
lance_mode                    (read and write)
ipg0                          (read and write)

Solaris のシステム管理 (IP サービス)

でも、Solaris 10からはmanページがなくなってます 😕

May 242006
 

Solarisでパッチ適用後のリブートを忘れて、気がついたときにはsshできない状態になっていました。

/usr/lib/ssh/sshdプロセスが立ち上がっておらず、svcadm enable sshで立ち上げようとしても/var/adm/messagesにこんなエラーが記録されます。

libpkcs11: Unable to contact kcfd: Bad file number
libpkcs11: /usr/lib/security/pkcs11_softtoken.so unexpected failure in ELF signature verification. System may have been tampered with. Cannot continue parsing /etc/crypto/pkcs11.conf

どうも、先日当てた「118918-17:Solaris Crypto Framework patch」の影響のようです。

パッチのREADME(/var/sadm/patch/118918-17/README.118918-17)をあらためて確認すると、Reboot immediatelyとありますが、確かリブートはおこなったような…

よく覚えていないのでリブートしたら何もなかったようにsshdは立ち上がりました。ログにもエラーは出力されません。
やはり、単にリブートを忘れてしまっていただけのようです orz

May 222006
 

SolarisでSoftware RAIDで設定したRAID1構成を解除する方法です(RAID構成前と同じ状態にする)。
RAID1を構成しているディスクの障害時に、一時的に切り離す方法(metadetach)はいろいろ見つかるのですが、ここに書くのは完全に解除してしまう方法です。

  1. /etc/vfstabの記述をmdデバイスからスライス直接指定に変更
    /dev/md/dsk/d10のようにmdデバイスの指定を/dev/dsk/c0t0d0s0のようなディスクのスライスを直接指定するように書き換えます。
  2. /etc/systemのrootdev指定書き換え
    /etc/systemがmetarootコマンドで書き換えられていますので、そちらも戻します。具体的にはrootdev指定が追加されているのでそちらをコメントアウトします。

    * Begin MDD root info (do not edit)
    * rootdev:/pseudo/md@0:0,10,blk ← 行頭に*を追加
    * End MDD root info (do not edit)
    
  3. リブートし、mdデバイスを使用しない状態に切り替え
  4. サブミラーd12をmdデバイスから切り離し、ストライピングを解除
    # metadetach d10 d12
    # metaclear d12
    
  5. metaclearでmdデバイスをクリア
    d11はd10の唯一のサブミラーとなるのでmetadetachできませんが、d10をmetaclear後にd11もmetaclearできるようになります。先のmetadetachをおこなわずにd10、d11、d12のmetaclearだけでよかったのかもしれません。

    # metaclear d10
    # metaclear d11
    
  6. metadbコマンドでmetaデバイス状態データベースを削除
    # metadb -f -d c0t0d0s1
    

と順におこなえば完了。記憶を頼りに書いているので微妙に違ってるかもしれません。

May 172006
 

Solaris 10にBig Sisterをインストールしてみました。
RRDToolはCSWパッケージで導入済です。
他にもPerlモジュールがいくつか必要になりますが、足りないものはCSWパッケージでインストールしておきます。

前提Perlモジュールのインストール

GD

pkg-get -i pm_gdでインストールできます。

SNMP

これはucd-snmpを要求しているのですが、残念ながらCSWパッケージにはありません。
SNMP機器の監視が必要な場合はCPAN等を使ってインストールする必要があります。

net-snmpはCSWパッケージがあるので、pkg-get- -i pm_netsnmpでインストールしておきました。意味ありませんが 😛

LWP::UserAgent

libwww-perlのことなのでpkg-get -i pm_libwwwでインストールできます。

Crypt:SSLeay

pkg-get -i pm_cryptssleayでインストールできます。

URI

pkg-get -i pm_uriでインストールできます。

Net::SMTP

CSW版Perlには最初から入ってます(/opt/csw/share/perl/5.8.x/Net/SMTP.pm)。

Big Sisterのインストール

bsユーザ追加

# useradd bs

configure, make

configureオプションではperlのパスを指定できないため、PATH環境変数を設定してconfigureを実行し、/opt/csw/bin/perlが最初に見つかるようにします。

# env PATH=/opt/csw/bin:$PATH ./configure
# make install

以上で/usr/local/lib/bs配下(default prefix)にインストールされます。
INSTALLドキュメントにも記載されていますが、agentのみ(install-agent)、serverのみ(install-server)といったターゲットを指定することもできます。

uxmon-net準備

/usr/local/lib/bs/adm/uxmon-netにDESCRで対象ホストの

DESCR           features=unix,sysv,solaris              localhost

それからuxmonがroot権限で動作するようにuxmon-asrootファイルを用意します。中身は空でOK。

# touch /usr/local/lib/bs/adm/uxmon-asroot

最初は無用なトラブルを避けるためにroot権限で動かしてしまいますが、最終的にrootで動かすかどうか、セキュリティ的な課題も含めて、カストマイズを進めてから決めるつもりです。

初期動作確認

とりあえずこの状態で起動してみますと

# /etc/init.d/bigsister start
Starting Big Sister ...
  Monitor bsmon                                     OK
  Server bbd                                        OK
  Agent uxmon for runxmon-net

となりuxmonのところでだいぶ待たされた挙句、結局立ち上がってくれません。
x86のDebianに入れたやつはあっけなく動いたんですけどね…。

May 142006
 

Solaris 10の/etc/servicesにはpop3sのエントリがなかったんですね。CSW版fetchmailパッケージをアップデートしたあとエラーになっていました。

fetchmail[4332]: [ID 210912 mail.error] getaddrinfo("pop.gmail.com","pop3s") error: service name not available for the specified socket type
fetchmail[4332]: [ID 103071 mail.error] Try adding the --service option (see also FAQ item R12).
fetchmail[4332]: [ID 702911 mail.error] POP3 connection to pop.gmail.com failed: Error 0

FAQにもあるように、/opt/csw/etc/fetchmailrcにserviceでポート番号を指定して解決。

poll pop.gmail.com with proto POP3:
        service 995
Apr 162006
 

Big BrotherクローンであるBig Sisterを試そうと思い、まずは前提ソフトウェアであるRRDtoolを入れようとしました。
CSWでパッケージが提供されているので簡単に済むと思ったのですが、pkg-getでエラーになってしまいます。

# pkg-get -i rrdtool
No existing install of CSWrrd found. Installing...
Trying http://ibiblio.org/pub/packages/solaris/csw/unstable/sparc/5.10/rrdtool-1.0.49,REV=2004.09.10-SunOS5.8-sparc-CSW.pkg.gz
--20:10:41--  http://ibiblio.org/pub/packages/solaris/csw/unstable/sparc/5.10/rrdtool-1.0.49,REV=2004.09.10-SunOS5.8-sparc-CSW.pkg.gz
           => `rrdtool-1.0.49,REV=2004.09.10-SunOS5.8-sparc-CSW.pkg.gz'
Resolving ibiblio.org... 152.2.210.80
Connecting to ibiblio.org[152.2.210.80]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,293,274 [text/plain]

100%[====================================>] 1,293,274     49.61K/s    ETA 00:00

20:11:16 (36.32 KB/s) - `rrdtool-1.0.49,REV=2004.09.10-SunOS5.8-sparc-CSW.pkg.gz' saved [1293274/1293274]

Analysing special files...
8409 blocks
ERROR: no info for SUNWcslx. Cannot install dependancy.
ERROR: could not install required dependancies for CSWrrd

本家のBTSを見にいったら「rrdtool can not be installed on Solaris 10」というバグ報告があげられてました。別バージョンのSolarisでコンパイルしてしまったようですので、そちらに記載されているURLからパッケージをダウンロードしてインストールします。

# wget -N http://www.blastwave.org/testing/rrdtool-1.2.11,REV=2005.12.02-SunOS5.8-sparc-CSW.pkg.gz
# gunzip rrdtool-1.2.11\,REV\=2005.12.02-SunOS5.8-sparc-CSW.pkg.gz
# pkgadd -d rrdtool-1.2.11\,REV\=2005.12.02-SunOS5.8-sparc-CSW.pkg

The following packages are available:
  1  CSWrrd     rrdtool - Round Robin Database graphing tool
                (sparc) 1.2.11,REV=2005.12.02

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 1

:

Installation of <cswrrd> was successful.
Apr 072006
 

smpatch updateしたら

122856-01 SunOS 5.10: sendmail patch

が含まれてました。2006-04-06に出たパッチのようです。
以前「Solarisのsendmailパッチ」で書いたときのISRとは番号が違うのですが、
Security Vulnerability in sendmail(1M) Versions Prior to 8.13.6
を見ると正式版のようです(以前のIDRの記述は消えてます)。

早速適用してみたのですが

Failed to install patch 122856-01.

patchadd utility failed. Reason code :0
Checking installed patches...Verifying sufficient filesystem capacity (dry run method)...Patch 122856-01 failed to install due to a failure produced by pkgadd.See /var/sadm/patch/122856-01/log for detailsPatchadd is terminating. Transition old-style patching.
ALERT: Failed to install patch 122856-01.

となり適用できません。ログには

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

PaTcH_MsG 23 Patch number 122856-01 cannot be applied until all restricted patch
es are backed out.
Dryrun complete.
No changes were made to the system.

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

PaTcH_MsG 23 Patch number 122856-01 cannot be applied until all restricted patch
es are backed out.
Dryrun complete.
No changes were made to the system.

へぇ、こんな風になるんだ、と思いつつ、以前のIDR122825-02をpatchrmしてから再びsmpatch updateしたところ無事適用されました 😀

# /etc/init.d/cswfetchamail stop
# svcadm disable -t sendmail
# patchrm IDR122825-02
# smpatch update
Apr 052006
 

Gentoo Alphaは~alpha化に向けてまだまだemerge中です。残パッケージは280ぐらい。

ついでといっては何ですがSolaris 10上で個別にビルドしているプログラムもアップデートしました。

Bogofilter 1.0.2

$ /usr/sfw/bin/gtar xjvf bogofilter-1.0.2.tar.bz2; cd bogofilter-1.0.2
$ CC=/opt/csw/gcc3/bin/gcc ./configure --with-libdb-prefix=/opt/csw/bdb4
$ /usr/ccs/bin/make
$ su -
# /usr/ccs/bin/make install

nkf 2.0.6a

$ /usr/sfw/bin/gtar xzvf nkf206a.tar.gz; cd nkf206
$ vi Makefile
~ CC=/opt/csw/gcc3/bin/gccに変更 ~
$ /usr/ccs/bin/make
$ su -
# cp -p nkf /usr/local/bin
# cp -p nkf.1 /usr/local/man/man1

ついでにZABBIXも1.1beta8がリリースされていましたので更新しています。

Apr 022006
 

Security Vulnerability in sendmail(1M) Versions Prior to 8.13.6
のRelief/Workaround記載のとおり、正式リリース前のパッチであるISRが提供されていたようです。

smpatchでチェックしてただけなので全然パッチは出ていないと思ってました。
まさかこんな形でリリースされることがあるとは。

MTAはEximに移行したとはいえ、適用してみたいのでやってみました。
とはいってもsendmailバイナリの一部は、既にEximによって置き換えられてますので、そちらを戻す必要があります。

Exim削除

まずはメール関連のデーモン止めてEximを削除します。

# /etc/init.d/cswfetchmail stop
# /etc/init.d/cswexim stop
# cp -p /opt/csw/etc/exim/exim.conf .
# pkgrm CSWexim

sendmailパッチ適用

# unzip IDR122825-02.zip
# patchadd IDR122825-02

sendmailバージョン確認

# /usr/sbin/sendmail -d0.1 -bv
Version 8.13.6+Sun
 Compiled with: DNSMAP LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8
                MIME8TO7 NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS
                NISPLUS PIPELINING SCANF STARTTLS TCPWRAPPERS USERDB
                USE_LDAP_INIT XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = mail
  (canonical domain name) $j = mail.example.jp
         (subdomain name) $m = example.jp
              (node name) $k = mail.example.jp
========================================================

Recipient names must be specified

晴れてバージョンが8.13.6+Sunになりました。