メランジ雑記帳

2010年6月21日

JBL4348スピーカーの前のナナオの液晶モニターを夏モードのためO君のモニタに

カテゴリー: オーディオ — admin @ 7:33 PM

このNANAOの液晶モニタは回転することができ、縦型にもできる。(先日場所を移動するときに思い出した!)
1280x1024という今ではクラシックな解像度であるが、面白い。

縦にすると、A4縦のドキュメントが楽にみれるし、むかし、SonyのNEWSやMacintoshの文書処理マシーンをこのようにして使っていた(20年前?)
その隣には、2560 x 1600 というモニター(DELLのキャンペーン価格のときのもので3年程度利用)があり、これはこれで強力。

ところで、これは(1280x1024の縦型)、別の液晶でタッチパネル代わりになるモニターで組むシステムのプログラミングに使うモニターである。
C言語の委員をしていた人間がこういうことを行ってはいけないかもしれないが、マイクロソフトのいろいろな部品を作成するのにC言語を使ってきた経験があるが、
アルゴリズムっぽいところがあまりなくていろいろなAPIを組み合わせているだけの場合は、残念ながらVBが楽である。

であるから、あまり慣れてなくても、VBで遊べるようにならないといけない。

まあ、これはIEとの組み合わせ(Active X, COM , DCOM, .NET, OLEなど3年ごとに名前が変わったあれ)で簡単に利用できるようにとの仕掛けであってその理念自体には問題はない。(しかし、WEB SERVICEのような形を.NETが志向しているので、よい方向にいっている)。

突然話題がかわるのであるが、液晶をO君のM社製の古いモニターと交換したのであるが、本日「Duke Ellinton meets Coleman Hwakins」をCDでかけてみたら、音がいいのでびっくりした。スピーカーは秋葉原で7年前に購入したJBL4348。

部屋の音響の環境がよくなったのであろう。仕事のほうもすこし順調である。

WEBArenaの設定などをしてみた

カテゴリー: クラウド, 仮想化 — admin @ 7:04 PM

EC2のお客さんとは別にWEBARENAという日本のサービスを利用してみた。
感想は、CPUはそれなりに速い。回線も。ただし、メモリーが思いがけずにいっぱいになる。
(これはサービスをアップグレードしてもらえばOK)。このサービスではswap add やswap onが利用できないので残念。
でもこのサービスでこのレスポンスであればいいのではと思う。特にここはお客さんが以前から利用していた環境の移行であるので楽だった。

Y社のルータをVPNルータとして設定する

カテゴリー: 未分類 — admin @ 6:55 PM

Y社のルータをVPNルータとして設定するということを社内で実験した。大体OKであった。
先日はN社の無線LANの接続–>B社への切り替え–>新しいN社の無線ルータへの接続(802.11n)を実施したばかりである。
以前はA社のルータを内部LAN側に入れて他社との一部サービス提供エリアへの接続にVPNを利用していた。

2010年6月9日

tracerouteの見方

カテゴリー: ネットワーク — admin @ 8:33 AM

man tracerouteで調べると、面白い。
traceroute 相手のIPアドレス
というような使い方をするのだが、最初はTTL(Time to Live)を1にしたUPDパケットでかつありえないポート(33434-33500)を指定したものを送る。
すると、最初のルータはTTLが1なのでICMPパケットでTime Exceeded(時間を超過)というコードを返す。そのルータのIPアドレスが返る。時間を測定することもできる。1つだけではばらつきに左右されるので、3回送って結果を見る。
同様にTTLを2にしたいい加減なUDPを送ると、2番めのルータがやはりTime Exceededを返す。
TTLを3にすれば3番めのルータがTime Exceedを返す。
そして最後の終着点までHOPが達すると、Port Unreachableが返るはずである。
ただし、この過程で問題が起きると、以下のようなビックリマーク(Exclamation Mark)がついた文字が表示される。

After the trip time, some additional annotation can be printed: !H, !N,
or !P (host, network or protocol unreachable), !S (source route
failed), !F (fragmentation needed), !X (communication administratively
prohibited), !V (host precedence violation), !C (precedence cutoff in
effect), or ! (ICMP unreachable code ). If almost all the
probes result in some kind of unreachable, traceroute will give up and
exit.

たとえば、

$ traceroute 192.168.100.250
traceroute to 192.168.100.250 (192.168.100.250), 30 hops max, 60 byte packets
1 rtx1000.domain.jp (192.168.0.1) 1.015 ms 1.364 ms 1.933 ms
2 rtx1200.domain.jp (192.168.0.180) 4.112 ms 5.609 ms 7.243 ms
3 rtx1200.domain.jp (192.168.0.180) 4984.919 ms !H 4984.902 ms !H 4984.691 ms !H

となっているのは、3番目のところで、Host Unreachableということを検出したことを示す。
msが1行に3つ出力されているのは、3回のトライのTime Exceededが返るまでの時間を示す。
普通は5秒でタイムアウトする。その場合はmsの部分はアスタリスク(*)になる。
そういう場合にはそのルータのアドレスさえも分からない。つまり、最初の番号はTTLを意味している。
最後の行はルータがUDPを投げたが、5秒の間にICMPが返ってこなかったので、Host UnreachableというICMPを返したということだと思われる。存在しないIPに対してもこのようなことが起きる。

しかしながら、manによると、最近ではFirewallがありえないポートにたいしてフィルターで無視するようになっていることもあるのであまり使えないということ。
そこで、-M tcpとし、普通はOKの80晩ポートを使うという方法が選択できる。(-Mはメソッドを意味する)


# traceroute -M tcp www.microsoft.com
traceroute to www.microsoft.com (207.46.170.10), 30 hops max, 60 byte packets
1 buffalo.setup (192.168.1.1) 1.169 ms 1.267 ms 1.535 ms
2 116-65-198-1.rev.home.ne.jp (116.65.198.1) 8.646 ms 12.726 ms 13.698 ms
3 10.202.97.3 (10.202.97.3) 13.678 ms 13.947 ms 13.936 ms
4 172.25.106.157 (172.25.106.157) 47.464 ms 48.474 ms 48.461 ms
5 172.25.108.1 (172.25.108.1) 15.546 ms 16.512 ms 16.500 ms
6 124.211.14.13 (124.211.14.13) 26.474 ms 20.327 ms 20.284 ms
7 otejbb203.kddnet.ad.jp (118.155.197.1) 11.514 ms otejbb204.kddnet.ad.jp (118.155.197.2) 11.090 ms otejbb203.kddnet.ad.jp (118.155.197.1) 15.392 ms
8 pacbb001.kddnet.ad.jp (203.181.100.62) 119.852 ms pacbb001.kddnet.ad.jp (203.181.100.186) 119.112 ms pacbb001.kddnet.ad.jp (203.181.100.62) 120.143 ms
9 ix-pa8.kddnet.ad.jp (124.211.34.134) 136.536 ms ix-pa8.kddnet.ad.jp (124.211.34.126) 131.309 ms 130.383 ms
10 203.181.104.206 (203.181.104.206) 134.208 ms 134.188 ms 121.053 ms
11 209.240.198.195 (209.240.198.195) 134.340 ms 134.320 ms 132.929 ms
12 207.46.40.62 (207.46.40.62) 137.654 ms 138.236 ms 130.004 ms
13 207.46.40.135 (207.46.40.135) 137.627 ms 147.294 ms 136.478 ms
14 ten2-1.tuk-76c-1b.ntwk.msn.net (207.46.46.13) 137.826 ms 142.419 ms 138.701 ms
15 po16.tuk-65ns-mcs-1b.ntwk.msn.net (207.46.35.142) 151.409 ms 140.033 ms 140.208 ms
16 wwwtuk2vip.microsoft.com (207.46.170.10) 139.979 ms 139.656 ms 152.326 ms

2010年6月7日

fedora 13とpostgres 8.4.4.1

カテゴリー: DB, postgres — admin @ 4:00 PM

(2010-06-08 タイトルの誤りを訂正 8.4.1.1 ==> 8.4.4.1)

fedora 13にしたマシーンではpostgresが動作しなくなっていた。selinuxがらみで、コンテクストが変わったのか?
そこで、

yum remove postgresql-server
yum install postgresql-server

とし、どこかのホームページで見た情報では、initdbは自動的に行われる,とのことなので、
すぐさま/etc/postgresql startでスタートした。
createuser -U postgres ユーザ名でxxxというユーザを作成する。
適当なところで、postgresユーザのパスワードも修正しておくこと。

createdb db名でdbを作成し、pg_restore dumpファイル名でバックアップから回復すること。

2010年6月5日

clamav + spamassassin + sendmailの設定

カテゴリー: 未分類 — admin @ 8:08 AM

以下の記録を作成するにあたって、

http://centossrv.com/sendmail-clamav-spamassassin.shtmlおよびhttp://www.opensource.apple.com/source/SpamAssassin/SpamAssassin-124.5.1/clamav/clamav-0.88.2/clamav-milter/INSTALLを参考にしました。

以下のようにclamavをインストールする。先頭のアイコンから見ると、硬い貝殻でばい菌マンのようなウイルスから貝を守っている絵になっている。clamはハマグリのことで、AVはanti-virusの意味だろう。
UNIX系で発達したオープンソースのウイルス撃退ソフトウエアで、MACユーザのあいだでは有名なのだそうだ。一応Windows版もあるが、UNIX版と比べると?かな。
とくにWindows 2003では利用できなかった。(2010-06-07確認)

  1. yum install clamav   <— クライアント部分+単体
  2. yum install clamav-scanner <– clamd のための設定ファイルなど。
    これで、clamav-serverも依存関係で入る。
    clamav-serverでは、clamdが入る。
  3. yum install clamav-milter <— メールプログラムから呼ばれるmail filter
    これはさらにclamdというデーモンと通信によってメールのスキャンを行う。

    つまり
    clamd <—-> clamav-milter <—-> sendmail
    というつながりになる。これは、clamavの0.95あたりからそうなったらしい。

  4. yum install clamav-update <– ウイルスデータベースの自動更新
    なにも設定しなければ、3時間おきに行われる。またログのローテートも行う。

普通に使うには、
$ clamscan
とする。
するとユーザのホームディレクトリ以下を走査する。

LibClamAV Warning: ***********************************************************
LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***
LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
LibClamAV Warning: ***********************************************************
/home/bob/.bash_profile: OK
/home/bob/.bashrc: OK
/home/bob/.bash_history: OK
/home/bob/.emacs: OK
/home/bob/.bash_logout: OK

———– SCAN SUMMARY ———–
Known viruses: 798833
Engine version: 0.95.3
Scanned directories: 1
Scanned files: 5
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 2.235 sec (0 m 2 s)

ディレクトリやファイルを指定することもできる。

$ clamscan jars
LibClamAV Warning: ***********************************************************
LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***
LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
LibClamAV Warning: ***********************************************************
jars/jvx.jar: OK
jars/javaview.jar: OK

———– SCAN SUMMARY ———–
Known viruses: 798833
Engine version: 0.95.3
Scanned directories: 1
Scanned files: 2
Infected files: 0
Data scanned: 3.37 MB
Data read: 1.32 MB (ratio 2.55:1)
Time: 3.544 sec (0 m 3 s)

今回はこのclamavとメールプログラムを組み合わせて使用してみた。このclamscanのプログラムだけでもいいようではあるが、ウイルス定義のファイルが大きいため、毎回このプログラムをメール1つに対して起動すると、かなり非効率になってしまうとのことである。そこで、初期化のときにだけウイルス定義を読み(あとは必要なときにも)、ウイルスのスキャンをするサーバプログラムを用意し、これをクライアントから利用するという設計にしたものが用意されている。それが、サーバ部分はclamdというデーモンプログラムで、クライアント部分はsendmail系特有のメールフィルターインタフェースを備えた、clamav-milterという仲介プログラム(milterインターフェースとclamavインタフェースの仲介)である。

ところで、マニュアルを読まないでいきなり使用しているので、いろいろなホームページで参照されている/etc/clamd.confがない。
そこで、
yum provides */clamd.conf
で探すと、

読み込んだプラグイン:dellsysidplugin2, refresh-packagekit
clamav-server-0.95.2-5.fc12.i686 : Clam Antivirus scanner server
リポジトリー : fedora
Matched from:
ファイル名 : /usr/share/doc/clamav-server-0.95.2/clamd.conf


clamav-server-0.95.3-1200.fc12.i686 : Clam Antivirus scanner server
リポジトリー : installed
Matched from:
ファイル名 : /usr/share/doc/clamav-server-0.95.3/clamd.conf

これは、インストールされているものであるので、これをコピーすればいいようだ。

cp -p /usr/share/doc/clamav-server-0.95.3/clamd.conf /etc/

また、/etc/mail/clamav-milter.confが導入されるのだが、これをデフォルトの位置に移す。/etc/clamav-milter.confがそれである。

今回は、デバッグが楽なように、unix domain socketではなく、普通のソケットにした。

/etc/clamav-milter.conf
以下のようにMilterSocketのコメントをはずす。

# Default: no default
# MilterSocket /var/run/clamav-milter/clamav-milter.socket
MilterSocket inet:7357
ClamdSocket tcp:localhost:3310

/etc/clamd.confでは

TCPSocket 3310
User clamav

とする。また両方のファイルにあるExampleという行はコメントにしておくこと。(そのほかの設定ファイルも同じ流儀になっていた)。

さて、sendmail側の設定であるが、sendmail.mc(macro configurationの意味)に以下のような行を入れる。
ここではspamassasin(メールがスパムである場合は、ヘッダーのsubjectに[SPAM]を挿入するフィルター)と共存させたいので両方の定義を書いている。

dnl # melange 2010-06-04 CLAMAVでウイルスチェック
INPUT_MAIL_FILTER(`clmilter',`S=inet:7357@localhost, F=, T=S:4m;R:4m')dnl
INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter/spamass-milter.sock,, F=, T=C:15m;S:4m;R:4m;E:10m')dnl
FEATURE(`blacklist_recipients')dnl
define(`confINPUT_MAIL_FILTERS', `spamassassin,clmilter')dnl

のようにした。最後のdefineでspamassassinとclmilterの両方のフィルターを使うことを指示している。
ところで、このdnlであるが、m4はマクロの定義などを空行で置き換えてしまうというので、それをこのdnl(delete through new line)というm4コマンドで空行の挿入をやめさせますdnlからnew lineまでが削除されますので、コメントとしても使えます。コメントとしての文章を挿入する場合には、

dnl # これはコメントの例

を使い、
コマンドをコメント化する場合は

dnl コマンド

とするようです。

あとは自動でウイルスDBを更新する部分であるが、

/etc/freshclam.confを以下のように編集する。
以下のExampleの行をコメントにする。

# Comment or remove the line below.
# Example <-- コメントにした

また、/etc/sysconfig/freshclamも編集しておくこと。

### REMOVE ME: network access without prior activation
#FRESHCLAM_DELAY=disabled-warn # REMOVE ME <-- コメントにした。

ウイルスデータベースの更新(freshclam)の定例化(cron)や、そのログのローテーションは勝手にインストーラがcronテーブルに設定をしているのでそのままでよさそうである。

# clamd
# clamav-milter

でメール関係のウイルスキャンサービス側を起動する。

#/etc/init.d/sendmail restart
でこれを利用する体制が整う。

sendmail.mcに
define(`confLOG_LEVEL’, `15′)dnl
入れて詳細なログを出力させると、一連の流れが/var/log/maillogに出力される。

Jun 5 07:01:10 aMachine sendmail[10876]: NOQUEUE: connect from [99.99.99.99]
Jun 5 07:01:10 aMachine sendmail[10876]: AUTH: available mech=CRAM-MD5 ANONYMOUS DIGEST-MD5 LOGIN, allowed mech=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: Milter (spamassassin): init success to negotiate
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: Milter (clmilter): init success to negotiate
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: Milter: connect to filters
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=connect, continue
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: milter=clmilter, action=connect, continue
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: --- 220 aMachine.aDomain.jp ESMTP Sendmail 8.14.3/8.14.3; Sat, 5 Jun 2010 07:01:10 +0900
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: <-- HELO familia.itambenet.local
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=helo, continue
Jun 5 07:01:10 aMachine sendmail[10876]: o54M1AIj010876: --- 250 aMachine.aDomain.jp Hello [99.99.99.99], pleased to meet you
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: <-- MAIL FROM:
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: Milter: sender:
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=mail, continue
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: milter=clmilter, action=mail, continue
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: --- 250 2.1.0 ... Sender ok
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: <-- RCPT TO:
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: Milter: rcpts:
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=rcpt, continue
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: milter=clmilter, action=rcpt, continue
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: --- 250 2.1.5 ... Recipient ok
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: <-- DATA
Jun 5 07:01:11 aMachine sendmail[10876]: o54M1AIj010876: --- 354 Enter mail, end with "." on a line by itself
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: from=, size=5551, class=0, nrcpts=1, msgid=<001c01cb0418$8e3204c0$aa960e40$@org>, proto=S\
MTP, daemon=MTA, relay=[99.99.99.99]
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=header, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=eoh, continue
Jun 5 07:01:12 aMachine sendmail[10876]: o54M1AIj010876: milter=spamassassin, action=body, continue

…中略

un 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: Milter add: header: X-Spam-Level: *********************
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: Milter add: header: X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on\n\taMachine.aDomain.jp
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: Milter change: header Subject: from The free XXXX trial everybody is taking about to [SPAM] The free XXXX trial everybod\
y \
is taking about
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: Milter message: body replaced
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: milter=clmilter, action=header, continue
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: milter=clmilter, action=header, continue
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: milter=clmilter, action=header, continue
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj0

Jun 5 07:01:13 aMachine spamd[8888]: prefork: child states: II
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: Milter accept: message
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIj010876: — 250 2.0.0 o54M1AIj010876 Message accepted for delivery
Jun 5 07:01:13 aMachine sendmail[10882]: o54M1AIj010876: to=, delay=00:00:02, xdelay=00:00:00, mailer=local, pri=37795, dsn=2.0.0, stat=Sent
Jun 5 07:01:13 aMachine sendmail[10882]: o54M1AIj010876: done; delay=00:00:02, ntries=1
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIk010876: <– QUIT
Jun 5 07:01:13 aMachine sendmail[10876]: o54M1AIk010876: — 221 2.0.0 aMachine.aDomain.jp closing connection
…中略

以下がウイルスを見つけた場合のログの行である!!その前の行には誰からとかの情報が記載されている。

Jun 4 23:16:44 redhat sendmail[2663]: o54EFqYH002663: milter=clmilter, quarantine=quarantined by clamav-milter

そして、ウイルスが見つかると、/var/log/clamd.server.log(<–ここにclamdのログを出力するようにした)

Fri Jun 4 21:23:47 2010 -> stream(127.0.0.1@1867): Email.Trojan-114 FOUND

のように見つけてくれる。

その実体は、
mailq -qQ
でわかる。(-qでQueueの種類をQUARANTINEに指定している)

#  mailq -qQ

/var/spool/mqueue (11 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
o54B8AUq031924    31483 Fri Jun  4 20:08 <charlie@brown.com>
     QUARANTINE: quarantined by clamav-milter
                                         <alice@domain.org>

これは、からに送られたメールにウイルスが潜在していることを示す。
その内容は/var/spool/mqueue/o54B8AUq031924にあり、Microsoftのメールプログラムを修正するパッチを当てるべしという内容で、善意を装っているが、引っかかってはいけない。隔離されたので、パソコンなどでpop3で受信できない(リストにない)ので安心である。

英文マニュアルにあるように、
useradd -s /sbin/nologin clamav -m -d /home/clamav -k /dev/null
でclamavユーザを作成するとあったのだが、最近は自動的に作成するようである

-sはshellでこの場合はloginできないようにする。
-m -d /home/clamavはホームディレクトリを作成することを指示
-kはskeltonファイルのありか(/etc/skelなど)を指示するのだが、今回はなにもコピーしない。

2010年6月3日

/etc/aliasesのselinux contextが変更されていたので…

カテゴリー: selinux — admin @ 12:22 PM

# ls -lZ aliases
-rw-r–r–. root root unconfined_u:object_r:etc_t:s0 aliases

であった。

これだと、

SELinux is preventing /usr/sbin/sendmail.sendmail "write" access to
/etc/aliases.

SELinux denied access requested by newaliases. /etc/aliases may be a mislabeled.
/etc/aliases default SELinux type is etc_aliases_t, but its current type is
etc_t. Changing this file back to the default type, may fix your problem.

File contexts can be assigned to a file in the following ways.

* Files created in a directory receive the file context of the parent
directory by default.
* The SELinux policy might override the default label inherited from the
parent directory by specifying a process running in context A which creates
a file in a directory labeled B will instead create the file with label C.
An example of this would be the dhcp client running with the dhclient_t type
and creating a file in the directory /etc. This file would normally receive
the etc_t type due to parental inheritance but instead the file is labeled
with the net_conf_t type because the SELinux policy specifies this.
* Users can change the file context on a file using tools such as chcon, or
restorecon.

This file could have been mislabeled either by user error, or if an normally
confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not
have been labeled with this type.

If you believe this is a bug, please file a bug report against this package.

You can restore the default system context to this file by executing the
restorecon command. restorecon '/etc/aliases', if this file is a directory, you
can recursively restore using restorecon -R '/etc/aliases'.

/sbin/restorecon '/etc/aliases'

node=redhat.ocn2.melange.co.jp type=AVC msg=audit(1275532056.576:1251096): avc: denied { write } for pid=26507 comm="newaliases" name="aliases" dev=dm-2 ino=22750792 scontext=unconfined_u:system_r:sendmail_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file

node=redhat.ocn2.melange.co.jp type=SYSCALL msg=audit(1275532056.576:1251096): arch=40000003 syscall=5 success=yes exit=3 a0=111bbe8 a1=2 a2=0 a3=0 items=0 ppid=26502 pid=26507 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=51 sgid=51 fsgid=51 tty=pts12 ses=2390 comm="newaliases" exe="/usr/sbin/sendmail.sendmail" subj=unconfined_u:system_r:sendmail_t:s0 key=(null)

のようなエラーになってしまう。
そこで

# chcon -t etc_aliases_t /etc/aliases

# ls -lZ /etc/aliases
-rw-r–r–. root root unconfined_u:object_r:etc_aliases_t:s0 aliases

で修正したが、これはバージョンアップ(11ー>12)した時に、コンテキスト属性を保存しないでバックアップしたのか?

restoreconでもよかったかもしれない。

spamassassinの設定がバージョンアップで変に?

カテゴリー: mail — admin @ 6:19 AM

sendmail.mcの

INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass-milter/spamass-milter.sock,, F=, T=C:15m;S:4m;R:4m;E:10m')

とあるべきところが、

INPUT_MAIL_FILTER(`spamassassin', `S=local:/var/run/spamass.sock,, F=, T=C:15m;S:4m;R:4m;E:10m')

になっていて、

sendmail を起動中: WARNING: Xspamassassin: local socket name /var/run/spamass.sock missing

というエラーを発生させていた。

2010年6月2日

EC2へvnc-serverをインストール

カテゴリー: EC2, vnc — admin @ 12:09 PM

yum install vnc-server

yum install xorg-x11*

yum install gnome*

yum install fonts-japanese*

として、

vncserver :1

でサーバを起動しておく。

~/.vnc/xstartupには、


#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
kinput2 &
exec gnome-session &

のような修正を施しておく。

以下がvinagre(vncのクライアント)の画面

ただし、セキュリティグループでのファイアウォールの設定でvncserverのポートをいくつか開けておくこと。
(これをすぐに反映するにはshorewallというコマンドを使うという人もいたが、パッケージにはなかったので、
リブートで反映させた)。

ゲームはオセロに登場するイアーゴ(Iago)をもじったゲーム(iagno)。オセロとルールはおなじである。

EC2へpostgresqlをインストール

カテゴリー: 未分類 — admin @ 12:01 PM

8.4というバージョンが弊社で利用しているものであるようなのだが、CentOS5.4(fedora8相当)のレポジトリでもそうであるのかを一応確認してみる。

# yum search postgres
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: centos.aol.com
* base: mirror.trouble-free.net
* extras: mirror.rackspace.com
* updates: hpc.arc.georgetown.edu
============================================== Matched: postgres ===============================================
qt-PostgreSQL.i386 : Qt の SQL クラス用 PostgreSQL ドライバ
bind-sdb.i386 : The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server with database backends.
freeradius-postgresql.i386 : freeradius 用の postgresql バインド
freeradius2-postgresql.i386 : Postgresql support for freeradius
libdbi-dbd-pgsql.i386 : libdbiのPostgreSQLプラグイン
mod_auth_pgsql.i386 : Basic authentication for the Apache web server using a PostgreSQL database.
mono-data-postgresql.i386 : Postgresql database connectivity for Mono
pdns-backend-postgresql.i386 : PostgreSQL backend for pdns
perl-DBD-Pg.i386 : A PostgresSQL interface for perl
php-pdo.i386 : A database access abstraction module for PHP applications
php-pgsql.i386 : PHP 用の PostgreSQL データベースモジュール
postgresql.i386 : PostgreSQL のクライアントプログラムとライブラリ
postgresql-contrib.i386 : Contributed source and binaries distributed with PostgreSQL
postgresql-devel.i386 : PostgreSQL 開発ヘッダーファイルとライブラリ
postgresql-docs.i386 : Extra documentation for PostgreSQL
postgresql-jdbc.i386 : JDBC driver for PostgreSQL
postgresql-libs.i386 : Kerberos 5 が使用する共有ライブラリ
postgresql-odbc.i386 : PostgreSQL ODBC driver.
postgresql-pl.i386 : PostgreSQL 用の PL 手続き型言語です。
postgresql-python.i386 : Python コードが Postgre SQL DB にアクセスするための開発モジュール
postgresql-server.i386 : PostgreSQL サーバーの作成/実行に必要なプログラム
postgresql-tcl.i386 : A Tcl client library for PostgreSQL.
postgresql-test.i386 : PostgreSQL と共に配布されるテストセット
postgresql84.i386 : PostgreSQL client programs
postgresql84-contrib.i386 : Contributed modules distributed with PostgreSQL
postgresql84-devel.i386 : PostgreSQL development header files and libraries
postgresql84-docs.i386 : Extra documentation for PostgreSQL
postgresql84-libs.i386 : The shared libraries required for any PostgreSQL clients
postgresql84-plperl.i386 : The Perl procedural language for PostgreSQL
postgresql84-plpython.i386 : The Python procedural language for PostgreSQL
postgresql84-pltcl.i386 : The Tcl procedural language for PostgreSQL
postgresql84-python.i386 : Development module for Python code to access a PostgreSQL DB
postgresql84-server.i386 : The programs needed to create and run a PostgreSQL server
postgresql84-tcl.i386 : A Tcl client library for PostgreSQL
postgresql84-test.i386 : The test suite distributed with PostgreSQL
qt4-postgresql.i386 : PostgreSQL drivers for Qt's SQL classes
rhdb-utils.i386 : PostgreSQL - CentOS Edition 用のその他のユーティリティです。
rsyslog-pgsql.i386 : PostgresSQL support for rsyslog
unixODBC.i386 : Linux 用の完全な ODBC ドライバマネージャ

そこで、84がついたものをすべてインストールするため

yum install 'postgresql84*'

で一応はインストールできる。

Installed:
postgresql84.i386 0:8.4.4-1.el5_5.1 postgresql84-contrib.i386 0:8.4.4-1.el5_5.1
postgresql84-devel.i386 0:8.4.4-1.el5_5.1 postgresql84-docs.i386 0:8.4.4-1.el5_5.1
postgresql84-libs.i386 0:8.4.4-1.el5_5.1 postgresql84-plperl.i386 0:8.4.4-1.el5_5.1
postgresql84-plpython.i386 0:8.4.4-1.el5_5.1 postgresql84-pltcl.i386 0:8.4.4-1.el5_5.1
postgresql84-python.i386 0:8.4.4-1.el5_5.1 postgresql84-server.i386 0:8.4.4-1.el5_5.1
postgresql84-tcl.i386 0:8.4.4-1.el5_5.1 postgresql84-test.i386 0:8.4.4-1.el5_5.1

となった。

古い投稿 »

Powered by WordPress