ラベル debian の投稿を表示しています。 すべての投稿を表示
ラベル debian の投稿を表示しています。 すべての投稿を表示

2016年4月8日金曜日

postfixで送信メールを転送する

みなさん、こんにちは。


受信メールを転送する方法はよくみかけますが、送信メールを転送する設定はあまりポピュラーでないようです。

まぁ、自分の送ったメールが送信先メールアドレス以外にも送信されるのは、あまり好ましい状態とはいえませんから当然といえば当然でしょうね。

しかし、会社の代表メールアドレスにきたメールの自社担当者の返信内容を確認したいという要望も少なからずあるようです。
自社担当者が普通にCcすれば済むことだとは思うのですが・・・・・。


こういった処理をメールサーバ側で自動で行う場合はpostfixではsender_bcc_mapsを使用します。


main.cfに以下1行を追加

debian:/etc/postfix# vi main.cf
・・・・・・省略・・・・・・
sender_bcc_maps = hash:/etc/postfix/sender_bcc


続いてsender_bccを記述します。

debian:/etc/postfix# vi sender_bcc
info@hoge.jp hoge@hoge.jp


これは、info@hoge.jpのメールアドレスより発信されたメールをhoge@hoge.jpにBccでメールを転送します。


続いて、sender_bccをdb化して環境を再読み込みいたします。

debian:/etc/postfix# postmap /etc/postfix/sender_bcc
debian:/etc/postfix# /etc/init.d/postfix reload


これで、info@hoge.jpアドレスより発信されたメールは、自動的にhoge@hoge.jpアドレスにBccされるようになりました。


ここで問題が発生。
Bcc先のメールアドレスが外部ドメインの場合は問題ないのですが、ローカルアドレスの場合2通配送されてしまう現象が発生しました。

postfixのcontent_filterにてメールのウィルスチェックをしているのが原因でした。
postfix→amavis-new→postfixとなるため、Bccへの配送が2回行われてしまうようです。


debian:/etc/postfix# vi main.cf
・・・・・・省略・・・・・・
#amavis-new
content_filter = smtp-amavis:[127.0.0.1]:10024
receive_override_options=no_address_mappings

とmain.cfに、receive_override_options=no_address_mappingsを追加します。


master.cfにも記述が必要です。

debian:/etc/postfix# vi master.cf
・・・・・・省略・・・・・・
127.0.0.1:10025 inet n  -       y     -       -  smtpd
・・・・・・省略・・・・・・
 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks

と、-o receive_override_options=no_header_body_checks,no_unknown_recipient_checksを追加します。


なお、master.cfのパラメータは複数行に記述できまずが、頭に空白(もしくはタブ)を入れないと続きと認識してくれないので要注意。


送信テストをしてみて、送信先メールアドレスならびにBcc先アドレスで同じメールが受信できていれば成功です。



ではでは~☆ミ

2016年2月23日火曜日

ext3ファイルシステムをWindows10で読み書き

みなさん、こんにちは。


Linuxのext3ファイルシステムで作成したUSBメモリを、Windowsでも参照できたら便利だと思いませんか?
きっと便利なハズ。

ということでWindowsでも読み書きできるようにします。

Ext2Fsdというフリーウェアを使用すれば、Windowsのエクスプローラーから普通のドライブを読み書きする感覚でext3を読み書きできるようになります。


http://www.ext2fsd.com/よりDownloadsのリンクをクリック。
http://sourceforge.net/projects/ext2fsd/files/というリンクがあるのでクリック。
Looking for the latest version? Download Ext2Fsd-0.62.exe (2.8 MB)というリンクが表示されますのでクリック。



現在のVersionは、0.62のようです。


ダウンロードしたファイルを実行するとインストーラが起動します。



Nextボタンで処理を進めていくと


自動起動するか、ext3への書き込みを行うか、の確認画面が表示されるので、すべてにチェックを入れます。
これらはExt2 Volume Managerで後から変更が可能です。


Ext2 Volume Managerが自動起動したら対象のパーティションをダブルクリックする。


私の環境ではドライブレターはHが割り振られ、以降Hドライブでアクセスが可能となりました。
当然ドライブレターは任意に変更が可能です。


Hドライブの中身は先日コピーしたhomeとetcのディレクトリが存在します。


これでWindows10でもext3のファイルシステムが読み書きできるようになりました。


ファイルの読み書きを行う際は、utf-8等のエンコードに対応した秀丸などのエディタを使用しましょう。


ではでは~☆ミ

2016年2月21日日曜日

linuxでUSBメモリをマウントして使う

みなさん、こんにちは。


Linuxサーバから設定ファイルをコピーしたい時、みなさんはどうされてますか?
ネットワーク経由で取り出したりといろいろ考えられますが、今回は手軽なUSBメモリに取り出したいと思います。


まずは、USBメモリをLinuxサーバに差し込みます。
最近のLinuxはUSBのPnPに対応しているので自動で認識してくれます。


どのように認識されたが、dmesgコマンドで確認します。

root@dns:/# dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
・・・・・・省略・・・・・・
[337720.780112] usb 1-1: new full-speed USB device number 2 using uhci_hcd
[337721.124071] usb 1-1: New USB device found, idVendor=04bb, idProduct=0c80
[337721.125094] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[337721.126403] usb 1-1: Product: USB Flash Disk
[337721.127164] usb 1-1: Manufacturer: I-O DATA
[337721.127903] usb 1-1: SerialNumber: A020C000009110800488
[337721.464843] Initializing USB Mass Storage driver...
[337721.465819] scsi2 : usb-storage 1-1:1.0
[337721.466540] usbcore: registered new interface driver usb-storage
[337721.467418] USB Mass Storage support registered.
[337722.469071] scsi 2:0:0:0: Direct-Access     I-O DATA USB Flash Disk   D53  PQ: 0 ANSI: 2
[337722.475373] sd 2:0:0:0: Attached scsi generic sg2 type 0
[337722.485674] sd 2:0:0:0: [sdb] 15941632 512-byte logical blocks: (8.16 GB/7.60 GiB)
[337722.489077] sd 2:0:0:0: [sdb] Write Protect is off
[337722.489106] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[337722.492092] sd 2:0:0:0: [sdb] No Caching mode page found
[337722.492960] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[337722.515985] sd 2:0:0:0: [sdb] No Caching mode page found
[337722.518267] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[337722.671096]  sdb: sdb1 ← ここを確認する
[337722.689994] sd 2:0:0:0: [sdb] No Caching mode page found
[337722.690036] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[337722.690070] sd 2:0:0:0: [sdb] Attached SCSI removable disk

sdb1として認識されました。


では、fdiskコマンドを使用してパーティション情報を確認します。

root@dns:/# fdisk -l

255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006dcd1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   232382463   116190208   83  Linux
/dev/sda2       232384510   234440703     1028097    5  Extended
/dev/sda5       232384512   234440703     1028096   82  Linux swap / Solaris

Disk /dev/sdb: 8162 MB, 8162115584 bytes
82 heads, 49 sectors/track, 3967 cylinders, total 15941632 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8be02e43

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              63    15941631     7970784+   b  W95 FAT32 ← この行がUSBメモリの情報

/dev/sdb1が今回使用しているUSBメモリなのですが、ファイルシステムがFAT32とWindows用のファイルシステムになっています。


このUSBメモリはLinuxメインでの運用を考えているので、ファイルシステムはこの際ext3に変更をしておきます。

root@dns:/# fdisk /dev/sdb

Command (m for help): d ← 領域を削除します。
Selected partition 1

Command (m for help): w ← 変更をディスクに書込み終了します。
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Windows用のファイルシステムを削除しました。


次はパーティションを確保しなおします。

root@dns:/# fdisk /dev/sdb

Command (m for help): p ← 領域を表示します。

Disk /dev/sdb: 8162 MB, 8162115584 bytes
252 heads, 62 sectors/track, 1020 cylinders, total 15941632 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8be02e43

Device Boot      Start         End      Blocks   Id  System ← 削除したので何も表示されない。

Command (m for help): n ← 新規領域作成
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p ← primaryを選択
Partition number (1-4, default 1): 1 ← 1つの領域しか作らないので1を入力
First sector (2048-15941631, default 2048): 2048 ← 先頭領域に何か入っているようなので2048から指定
Last sector, +sectors or +size{K,M,G} (2048-15941631, default 15941631):
Using default value 15941631 ← エンターでLast Sectorを15941631とする

Command (m for help): p ← 領域を表示します。

Disk /dev/sdb: 8162 MB, 8162115584 bytes
252 heads, 62 sectors/track, 1020 cylinders, total 15941632 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8be02e43

Device Boot      Start         End      Blocks   Id  System ← 次行にUSBメモリの領域が表示
/dev/sdb1            2048    15941631     7969792   83  Linux

Command (m for help): w ← 変更をディスクに書込み終了します。
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


念のためfdiskコマンドで内容を確認してみます。

root@dns:/# fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006dcd1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   232382463   116190208   83  Linux
/dev/sda2       232384510   234440703     1028097    5  Extended
/dev/sda5       232384512   234440703     1028096   82  Linux swap / Solaris

Disk /dev/sdb: 8162 MB, 8162115584 bytes
84 heads, 6 sectors/track, 31630 cylinders, total 15941632 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8be02e43

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    15941631     7969792   83  Linux ← USBメモリの領域が表示

USBメモリの領域が確保できました。


作成したsdb1をext3でフォーマットします。
fdiskだけでは領域を確保しただけなのでフォーマットは別途行う必要があります。

root@dns:/# mkfs.ext3 /dev/sdb1
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
498736 inodes, 1992448 blocks
99622 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2042626048
61 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables:  0/61 1/61 2/61 3/61 4/61 5/61 6/61 7/61 8/61 9/6110/6111/6112/6113/6114/6115/6116/6117/6118/6119/6120/6121/6122/6123/6124/6125/6126/6127/6128/6129/6130/6131/6132/6133/6134/6135/6136/6137/6138/6139/6140/6141/6142/6143/6144/6145/6146/6147/6148/6149/6150/6151/6152/6153/6154/6155/6156/6157/6158/6159/6160/61     done
Writing inode tables:  0/61 1/61 2/61 3/61 4/61 5/61 6/61 7/61 8/61 9/6110/6111/6112/6113/6114/6115/6116/6117/6118/6119/6120/6121/6122/6123/6124/6125/6126/6127/6128/6129/6130/6131/6132/6133/6134/6135/6136/6137/6138/6139/6140/6141/6142/6143/6144/6145/6146/6147/6148/6149/6150/6151/6152/6153/6154/6155/6156/6157/6158/6159/6160/61     done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:  0/61 1/61 2/61 3/61 4/61 5/61 6/61 7/61 8/61 9/6110/6111/6112/6113/6114/6115/6116/6117/6118/6119/6120/6121/6122/6123/6124/6125/6126/6127/6128/6129/6130/6131/6132/6133/6134/6135/6136/6137/6138/6139/6140/6141/6142/6143/6144/6145/6146/6147/6148/6149/6150/6151/6152/6153/6154/6155/6156/6157/6158/6159/6160/61

ようやく使えるようになりました。


マウントしてファイルをコピーしてみます。

root@dns:/# mkdir /mnt/usb
root@dns:/# mount -t ext3 -w /dev/sdb1 /mnt/usb
root@dns:/# ls -la /mnt/usb
drwxr-xr-x 3 root root  4096  2 21 19:57 .
drwxr-xr-x 3 root root  4096  2 21 20:07 ..
drwx------ 2 root root 16384  2 21 19:57 lost+found
root@dns:/# rsync -av home etc /mnt/usb

コピーにはrsyncコマンドを使用します。

バックアップ用コマンドは色々ありますが、rsyncが個人的に好きなだけです。
rsyncがない方は、apt-get install rsync として是非インストールしておきましょう。


ところで、rsyncの書式は、rsync [オプション] コピー元 コピー先 となりコピー元は複数指定可能です。
今回は、homeとetcディレクトリをコピーしています。

rsync -av home/ etc/ /mnt/usb とすると、コピーされる場所が変わるのでご注意ください。


次回は、このUSBメモリをWindows10で表示できるようにしたいと思います。


ではでは~☆ミ

2016年2月7日日曜日

linuxで文字コードを変換して表示する

みなさん、こんにちは。


俺のところの自宅メールサーバーは、Linuxで運営しています。
普段メンテナンスはTeratermで接続して行っているのですが、全角文字はUTF-8で処理されています。

今回、メールの中身を確認する必要がでてきたのでTeratermで内容の確認を行うのですが、メールの場合、送信者の環境次第で、どの文字コードが使用さえるかわかりません。
UTF-8で送信してくれるなら問題なく表示できますが、それ以外だと文字化けしてしまいます。


そこで、nkfコマンドを使用して文字コード判別、変換を行って表示します。

debian:/home/hoge/Maildir/cur# cat 1454851827.V301I307c2M657451.debian:2,S | nkf -g
ISO-2022-JP

1454851827.V301I307c2M657451.debian:2,Sが、メールのファイルになります。
catコマンドの出力をnkfコマンドにわたして文字コードの判別を行います。

今回のメールはISO-2022-JPと判明しました。
TeratermではUTF-8を使用しているので、そのままでは文字化けしてしまいます。


UTF-8に文字コードを変換して表示します。

debian:/home/hoge/Maildir/cur# cat 1454851827.V301I307c2M657451.debian:2,S | nkf -w
・・・・・・省略・・・・・・
Subject: 送信テスト
Date: Sun, 7 Feb 2016 22:30:32 +0900
MIME-Version: 1.0
Content-Type: text/plain;
        format=flowed;
        charset="iso-2022-jp";
        reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 15.4.3555.308
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308
送信テスト

文字化けすることなく表示されました。


文字コードを変換しないでISO-2022-JPのまま表示すると以下のように文字化けします。

debian:/home/hoge/Maildir/cur# cat 1454851827.V301I307c2M657451.debian:2,S
・・・・・・省略・・・・・・
Subject: =?iso-2022-jp?B?GyRCQXc/LiVGJTklSBsoQg==?=
Date: Sun, 7 Feb 2016 22:30:32 +0900
MIME-Version: 1.0
Content-Type: text/plain;
        format=flowed;
        charset="iso-2022-jp";
        reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 15.4.3555.308
X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308
Aw?.%F%9%H

文字化けして内容が確認できません。


nkfコマンドの主なオプションは以下となります。

-j ISO-2022-JPに出力
-s Shift-JISに出力
-e EUC-JPに出力
-w UTF-8に出力

-g 文字コード判定

-Lu 改行コードをLFに変換
-Lw 改行コードをCR+LFに変換
-Lm 改行コードをCRに変換


使い方は

cat ファイル名 | nkf (-option)
または
nkf (-option) ファイル名

なので、

debian:/home/hoge/Maildir/cur# nkf -w 1454851827.V301I307c2M657451.debian:2,S

としても同じです。


ではでは~☆ミ

2016年1月17日日曜日

postgrey の ホワイトリストに DiXiM のメールサーバを登録する

みなさん、こんにちは。


DiXiM Play というスマホ用のアプリをインストールしようと思い、ユーザー登録画面で何気にPC用のメールアドレスを登録してしまいました。
ログイン用確認コードというのが、この登録メールアドレスに送られてくるのですが、


確認コードの有効期限が「2016/01/17 00:15」、メールの受信時刻が「2016/01/17 00:17」。
有効期限が切れてからメールが届いています。

これでは確認コードが期限切れで使えません。


そういえば、PC用のメールサーバにはSPAM対策として postgrey を導入していたのでした。
postgrey の遅配が原因なので、DiXiMのメールサーバをホワイトリストに登録して遅配しないように設定いたします。

Debian系の postgrey の whitelist は、

/etc/postgrey/whitelist_clients

です。

whitelist_clients.local というファイルを作って追加分はそちらに記述するのが作法のようですが、今回は面倒だったので直接追加いたしました。


debian:/etc/postgrey# cat whitelist_clients
# postgrey whitelist for mail client hostnames
# --------------------------------------------
# put this file in /etc/postgrey or specify its path
# with --whitelist-clients=xxx

# Debian-specific additions
# I *know* they run real mail queues, so greylisting only creates
# bigger load for them.
debconf.org
debian.org
spi-inc.org
# greylisting.org: Southwest Airlines (unique sender, no retry)
southwest.com
# greylisting.org: isp.belgacom.be (wierd retry pattern)
isp.belgacom.be
# greylisting.org: Ameritrade (no retry)
ameritradeinfo.com
# greylisting.org: Amazon.com (unique sender with letters)
amazon.com

・・・・・・中略・・・・・・

# 2008-07-22: yahoo.com (big pool, reported by Juan Alonso)
yahoo.com
# 2014-09-17: google.com
google.com
# 2014-09-21
twitter.com
# 2016-01-17
54.240.27


今回は mail.log を参照してIPアドレス「54.240.27」を直接記述しましたが、正規表現が使えるので、

/smtp-out\.us-west-2\.amazonses\.com$/

と記述しても多分OKです。


後は

debian:/etc/postgrey# /etc/init.d/postgrey reload
Reloading postfix greylisting daemon configuration...done.

として完了です。


これで無事、DiXiM Play の登録が済みました。


ではでは~☆ミ

2016年1月3日日曜日

「この APT が対応している以上の数の説明が要求されました」のエラーも修正する

みなさん、こんにちは。


「この APT が対応している以上の数の説明が要求されました。」のエラーも今回直しておきます。




debian:/etc/apt# apt-get update
パッケージリストを読み込んでいます... エラー!
E: この APT が対応している以上の数の説明が要求されました。
E: Problem with MergeList /var/lib/apt/lists/ftp2.jp.debian.org_debian_dists_stable_main_binary-i386_Packages
E: パッケージリストまたはステータスファイルを解釈またはオープンすることができません


調べてみると、どうやら日本語の対応が上手く動いていないようです。
以下3通りの対策がありました。


・コマンドラインでLANG=C を追加する

debian:/etc/apt# LANG=C apt-get update


・コマンドラインで APT::Acquire::Translation=none を追加する

debian:/etc/apt# apt-get update -o APT::Acquire::Translation=none


・/etc/apt/apt.con.d/90org などのファイルを作成して、APT::Acquire::Translation=none を記述する

debian:/etc/apt/apt.conf.d# cat 90org
APT::Acquire::Translation "none";


conf.d に、APT::Acquire::Translation=none を記述する方が恒常的で対策としては良いと思います。


さて、いい加減エラー対策にも飽きてきたので、apt-spy で sources.list を新しくしてエラーが出ないようにしておきます。

debian:/etc/apt# cp sources.list sources.list_20160102
debian:/etc/apt# apt-spy update
Updating...
Grabbing file http://http.us.debian.org/debian/README.mirrors.txt...
Update complete. Exiting.
debian:/etc/apt# apt-spy -s JP -d stable -o /etc/apt/sources.list

SERVER: ftp.jp.debian.org
Benchmarking FTP...
                Downloaded 11713229 bytes in 4.12 seconds
                Download speed: 2779.60 kB/sec
Writing new sources.list file: /etc/apt/sources.list

apt-spy を使えば、sources.list の作成も簡単です。

debian:/etc/apt# cat sources.list
# sources.list generated by apt-spy v3.1
#
# Generated using:
#
# apt-spy \
#       -s JP \
#       -d stable \
#       -o /etc/apt/sources.list
#
deb ftp://ftp.jp.debian.org/debian/ stable main #contrib non-free
deb-src ftp://ftp.jp.debian.org/debian/ stable main #contrib non-free
deb http://security.debian.org/ stable/updates main

随分シンプルな sources.list になりました。


ところで、/etc/apt/sources.list.d なるディレクトリがあるんですね。
sources.list もココに複数ファイルにして置いておけば読み込んでくれそうです。(未検証)
ここら辺はもう少し調査が必要です。

apt関連のエラーも、これでほぼなくなりました。
実はもう1件あるのですが、それはまたの機会にします。


ではでは~☆ミ

2016年1月2日土曜日

「公開鍵を利用できないため、以下の署名は検証できませんでした」を修正

みなさん、こんにちは。


apt-get update した際に、「公開鍵を利用できないため、以下の署名は検証できませんでした」というエラーが発生していました。
これも結構前から出ていましたが、今回あわせて修正することにいたします。


sources.list に記述しているサーバの公開鍵の有効期限が切れていると、「公開鍵を利用できないため、以下の署名は検証できませんでした」というエラーが発生します。
まずは有効期限がどうなっているか確認してみます。


debian:~# apt-key list
/etc/apt/trusted.gpg
--------------------
pub   1024D/F42584E6 2008-04-06 [満了: 2012-05-15]
uid                  Lenny Stable Release Key <debian-release@lists.debian.org>

pub   4096R/55BE302B 2009-01-27 [満了: 2012-12-31]
uid                  Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>

pub   2048R/6D849617 2009-01-24 [満了: 2013-01-23]
uid                  Debian-Volatile Archive Automatic Signing Key (5.0/lenny)

pub   4096R/B98321F9 2010-08-07 [満了: 2017-08-05]
uid                  Squeeze Stable Release Key <debian-release@lists.debian.org>

pub   4096R/473041FA 2010-08-27 [満了: 2018-03-05]
uid                  Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>

pub   4096R/C857C906 2014-11-21 [満了: 2022-11-19]
uid                  Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>

pub   4096R/46925553 2012-04-27 [満了: 2020-04-25]
uid                  Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>

満了の日付が今現在より以前だと公開鍵の有効期限切れです。
やはり、期限切れの公開鍵が結構あります。


エラーの内容を確認してみます。

debian:~# apt-get update
・・・・・
31.2MB を 33s で取得しました (940kB/s)
W: GPG error: http://security.debian.org stable/updates Release: 公開鍵を利用で きないため、以下の署名は検証できませんでした: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY 8B48AD6246925553
W: GPG error: ftp://ftp2.jp.debian.org stable Release: 公開鍵を利用できないため 、以下の署名は検証できませんでした: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010 NO_PUBKEY CBF8D6FD518E17E1

表示された NO_PUBKEY となっているのが有効期限切れの公開鍵となります。
全部で4つ、9D6D8F6BC857C906、8B48AD6246925553、7638D0442B90D010、CBF8D6FD518E17E1 がダメになってます。


最近は、apt-key コマンドで更新できるようになりました。
コマンドの一番最後に、9D6D8F6BC857C906 とエラーに出ているものをパラメータに加えます。

debian:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9D6D8F6BC857906
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys 9D6D8F6BC857C906
gpg: 鍵C857C906をhkpからサーバーkeyserver.ubuntu.comに要求
gpg: 鍵C857C906: 公開鍵“Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>”を読み込みました
gpg: 絶対的に信用する鍵が見つかりません
gpg:     処理数の合計: 1
gpg:           読込み: 1  (RSA: 1)


全部で4つあるのでこれを4回繰り返します。
昔と比べ随分と便利になりましたね。


もう一度 apt-get update 実行してエラーがでないか確認します。

debian:/etc/apt# apt-get update
・・・・・
18.7MB を 15s で取得しました (1213kB/s)


無事終了いたしました。


ではでは~☆ミ

2015年12月30日水曜日

php5-suhosinパッケージの読み込みエラーを修正

みなさん、こんにちは。


PHPモジュール、suhosinパッケージの読み込みエラーを修正しました。


PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/suhosin.so' - /usr/lib/php5/20100525+lfs/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0

こんなエラーメールが毎時09分と39分に自宅のwebサーバーから送られてきます。
実はかなり前から送られてるのですが、面倒なのでそのままにしていました。
さすがに、そろそろ対応しようと思います。




読み込もうとしている、/usr/lib/php5/20100525+lfs/suhosin.so が、本当にあるか確認してみます。

debian:~# ls -la /usr/lib/php5/20100525+lfs/
合計 468
drwxr-xr-x 2 root root   4096 2014-05-24 22:44 .
drwxr-xr-x 4 root root   4096 2014-05-24 22:44 ..
-rw-r--r-- 1 root root  91564 2014-04-19 07:07 gd.so
-rw-r--r-- 1 root root  38336 2014-04-19 07:07 mcrypt.so
-rw-r--r-- 1 root root  46512 2014-04-19 07:07 mysql.so
-rw-r--r-- 1 root root 128460 2014-04-19 07:07 mysqli.so
-rw-r--r-- 1 root root 108084 2014-04-19 07:07 pdo.so
-rw-r--r-- 1 root root  30276 2014-04-19 07:07 pdo_mysql.so

suhosin.soというファイルは存在していないのでエラーがでるのは当たり前ですね。


そもそもPHPのsuhosintモジュールて何者なのでしょう。


Suhosin は PHP 導入環境向けの高度な防御システムです。
PHP アプリケーションや PHP の中核部分にある既知や未知の欠陥からサーバやユーザを守るために設計されました。
Suhosin は二つの独立した部分から成り、それぞれ別々に利用したり組み合わせて使えます。
一つ目は PHP の中核部分に対する小さなパッチで、これはバッ ファオーバーフローや書式指定文字列の脆弱性に対する低レベルの防御をいくつか実装しています。
二つ目は他のすべての防御を実装する強力な PHP 拡張です。


PHPの脆弱性をカバーするセキュリティーパッチのようです。

Debianではwheezyから削除された模様で、アップグレードの際に設定のファイルのみが残ってしまったため、前述のエラーが発生しているのでしょう。


まずは、現在のパッケージの状況を確認してみます。

debian:~# dpkg -l php5-suhosin
||/ 名前         バージョ アーキテ 説明
+++-==============-============-============-=================================
rc  php5-suhosin   0.9.32.1-1   i386         advanced protection module for ph

rcとなっていて現在は未設定となっています。


パッケージを完全削除します。

debian:~# dpkg --purge php5-suhosin
(データベースを読み込んでいます ... 現在 24562 個のファイルとディレクトリがイン ストールされています。)
php5-suhosin を削除しています ...
php5-suhosin の設定ファイルを削除しています ...
libapache2-mod-php5 のトリガを処理しています ...
Reloading web server config: apache2.


もう一度パッケージの状態を確認してみます。

debian:~# dpkg -l php5-suhosin
||/ 名前         バージョ アーキテ 説明
+++-==============-============-============-=================================
un  php5-suhosin   <なし>                  (説明 (description) があり

unとなって、未インストール状態となりました。


これでエラーは発生しなくなったハズです。


apt-get よりは、dpkg を使ったほうが今回のようにパッケージ関係が変になった時は有効です。


ではでは~☆ミ

2015年6月16日火曜日

mailmanでリスト登録者以外からの投稿も配信する

みなさん、こんにちは


メーリングリスト管理プログラムにmailmanを使用しています。
細かな設定が出来るので利用されている方も多いのではないでしょうか。


最近のユーザーはメールアドレスを複数所有している人も多く、転送設定などしてメールを各アドレスでチェック出来るようにしています。

そこで発生するのが、メーリングリストに登録しているアドレス以外からの投稿です。

転送されたアドレスでメールをチェックして、そのまま返信してしまうんですね。

それも急ぎの案件ほどその傾向が多いのです。


自分の持っているアドレスのうち、どのアドレスがメーリングリストに登録されているのか無自覚の場合も多いんですけど・・・・。


管理者に承認メールが流れてくるのも面倒なので、登録メールアドレス以外からも投稿を可能に設定しなおします。
※この設定に変更した場合、スパムが流れると悲惨になります、自己責任でお願いします。


「プライバシー・オプション」→「送信者フィルタ」と進んでいき


「動作が定義されていない非会員からの投稿に対する動作」を承認に変更します。


これでリストに登録していないメールアドレスからもメーリングリストに投稿出来るようになりました。


ではでは~☆ミ

2015年5月24日日曜日

sshが繋がらない!! DenyHostsに登録されたIPを解除する

みなさん、こんにちは


SSHへの攻撃を防ぐ為に、DenyHostsを導入されている方も多いと思います。
公開しているサーバーの状況を確認しようと、会社から別サーバー(自宅)経由でアクセスしたところ、DenyHostsに登録されてしまいました(^^;


こんなドジするの私くらいでしょうか?


思いつく対策は以下の3通り

1 hosts.allow に自宅のIPを登録する
2 自宅のIPを変更する
3 DenyHostsのリストから削除する

自宅のIPアドレスはプロバイダからのDHCP取得なので、1or2でも実効性はありそうですが、今回は3で対策したいと思います。


/etc/hosts.deny自体にIPが記載されていなくても、DenyHosts自体にIPが登録されていると接続したタイミングで、hosts.denyに登録され接続が出来ないので、DenyHostsのファイルからも削除する必要があります。


まずは、DenyHostsを停止します。

debian:/# /etc/init.d/denyhosts stop
Stopping DenyHosts: denyhosts.


続いてhosts.denyに登録されているIPアドレスを削除します。
記載がない場合もありますが、DenyHostsに登録があると接続できません。

debian:/etc# cat hosts.deny | grep xxx.xxx.xxx.xxx
debian:/etc# ←今回はhosts.denyには既に載ってないようです。


DenyHostsのconfigファイルを確認してみます。

debian:/etc# cat denyhosts.conf | grep WORK_DIR
WORK_DIR = /var/lib/denyhosts

WORK_DIR は、/var/lib/denyhostsでした。
/var/lib/denyhostsに移動します。


debian:/var/lib/denyhosts# ls -la
合計 1076
drwxr-xr-x  2 root root   4096 2010-01-04 23:47 .
drwxr-xr-x 29 root root   4096 2010-03-27 21:06 ..
-rw-r--r--  1 root root 171322 2015-05-24 17:17 hosts
-rw-r--r--  1 root root 171200 2015-05-24 17:17 hosts-restricted
-rw-r--r--  1 root root 171200 2015-05-24 17:17 hosts-root
-rw-r--r--  1 root root 171200 2015-05-24 17:17 hosts-valid
-rw-r--r--  1 root root     95 2015-05-24 17:17 offset
-rw-rw-rw-  1 root root 165381 2015-05-24 10:25 purge-history
-rw-r--r--  1 root root      0 2015-05-24 17:17 suspicious-logins
-rw-r--r--  1 root root      0 2015-05-24 17:17 users-hosts
-rw-r--r--  1 root root 208296 2015-05-24 17:17 users-invalid
-rw-r--r--  1 root root      0 2015-05-24 17:17 users-valid


hosts、hosts-restricted、hosts-root、hosts-valid、user-hostsより、該当IPを削除します。


最後にDenyHostsを再起動しておしまいです。

debian:/var/lib/denyhosts# /etc/init.d/denyhosts start
Starting DenyHosts: denyhosts.


ではでは~☆ミ 

2015年1月2日金曜日

ソフトウェアRAIDのMDADMでRAID1を復旧する

みなさん、明けましておめでとうございます。


先月、会社で使用しているメールサーバーが突然ダウンしてしまいました。
電源ユニットの異常によるものです。
スペアの電源ユニットに交換して無事に起動はできたのですが、RAID構成しているHDDがその際に故障してしまったらしく、同期が出来ていない状態です。
幸いにも故障したのは、sdb側(ミラー側)なので当面片肺起動で凌ぐこととし、暇ができたら年末年始の休暇中にRAIDの復旧を試みることとしました。


で、年末のとある休日

まずは故障したHDDを外した状態の同期状況を確認。

net:/proc# cat mdstat
Personalities : [raid1]
md1 : active (auto-read-only) raid1 sda5[0]
      2634560 blocks [2/1] [U_]
md0 : active raid1 sda1[0]
      153613376 blocks [2/1] [U_]
unused devices: <none>

sdbがない片肺状態なので、この状態で何かトラブルがあったらお終いです(^^;
まずは、作業前にsdaのバックアップを取っておきたいので、ネットでツールを探してみます。
 EaseUS Todo Backup Free か AOMEI Backupper Standard がディスクイメージごと抜けて良さそうです。
今回は AOMEI Backupper Standard でバックアップをとりました。


いよいよ作業の開始です。
sdaがどういう構成になっているか確認をします。

net:/proc# fdisk -l /dev/sda
Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000778ba
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sda2           19125       19452     2634660    5  Extended
/dev/sda5           19125       19452     2634628+  fd  Linux raid autodetect


sda2の拡張パーティション上にsda5が構築されてます。

同様に今回追加するディスクの状況も確認します。

net:/proc# fdisk -l /dev/sdb
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       19458   156288000    7  HPFS/NTFS


sdbはWindowsServerからぶっこ抜いたHDDなので、ファイルシステムがHPFS/NTFSになっちゃってますね(^^;
sdbをsdaと同じ構成にしなければならないのですが、まずはNTFSのパーティションを削除しなければなりません。

net:/proc# fdisk /dev/sdb
The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): d ← 削除します
Selected partition 1 ← パーティションを選択、sdb1を選ぶので1を入力
Command (m for help): w ← 書き込みします
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.


さて、上手く削除できたか確認してみます。

net:/proc# fdisk -l
Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000778ba
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sda2           19125       19452     2634660    5  Extended
/dev/sda5           19125       19452     2634628+  fd  Linux raid autodetect
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System


sdb1のパーティションがなくなっていますので削除できました。

ではいよいよsdbのパーティションをsdaと同じ様に作成していきます。

net:/proc# fdisk /dev/sdb
The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n ← パーティションの新規作成
Command action
   e   extended
   p   primary partition (1-4)
p ← primary partitionを選択
Partition number (1-4): 1 ← sdb1にするので1を入力
First cylinder (1-19457, default 1): 1 ← sda1のStartのシリンダ数と一緒にする
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457): 19124 ← sda1のEndのシリンダ数と一緒にする
Command (m for help): t ← 領域のシステム ID を変更する
Selected partition 1
Hex code (type L to list codes): fd ← sda1のSystemと同じfdを入力する
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): a ← boot可能フラグをつける
Partition number (1-4): 1 
Command (m for help): p ← 作成した領域テーブルを表示して確認する
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       19124   153613498+  fd  Linux raid autodetect


sdb1は上手く作成できそうです。
続いてsdb2を作成します。

Command (m for help): n ← パーティションの新規作成
Command action
   e   extended
   p   primary partition (1-4)
e ← 拡張領域として確保します。
Partition number (1-4): 2 ← sdb2にするので2を入力
First cylinder (19125-19457, default 19125):
Using default value 19125 ← 19125がデフォルトで選択されます。
Last cylinder or +size or +sizeM or +sizeK (19125-19457, default 19457): 19452 ← sda2のEndのシリンダ数と一緒にする(ミラー側なので19457でも問題はないけど、安心の為同じにしておく)
Command (m for help): t ← 領域のシステム ID を変更する
Partition number (1-5): 2
Hex code (type L to list codes): 5 ← Extendedは5です。
 
Command (m for help): p ← 作成した領域テーブルを表示して確認する
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sdb2           19125       19452     2634660    5  Extended


続いてsdb5をsdb2上に作成します。

Command (m for help): n ← パーティションの新規作成
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l ← logicalを選択します。
First cylinder (19125-19452, default 19125): 19125 ← 論理領域なのでsdb2と同じに
Last cylinder or +size or +sizeM or +sizeK (19125-19452, default 19452): 19452 ← 論理領域なのでsdb2と同じに
Command (m for help): t ← 領域のシステム ID を変更する
Partition number (1-5): 5
Hex code (type L to list codes): 83 ← swap領域なので83を選択、でもこれ間違い
Command (m for help): p ← 作成した領域テーブルを表示して確認する
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sdb2           19125       19452     2634660    5  Extended
/dev/sdb5           19125       19452     2634628+  83  Linux
Command (m for help): w ← 今までの作業を書き込み
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.


さてここまでの作業内容を確認

net:/proc# fdisk -l
Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000778ba
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sda2           19125       19452     2634660    5  Extended
/dev/sda5           19125       19452     2634628+  fd  Linux raid autodetect
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sdb2           19125       19452     2634660    5  Extended
/dev/sdb5           19125       19452     2634628+  83  Linux


ありゃ、sdb5のファイルシステムが間違ってしまったようでsda5と同じになってません。
修正します。

net:/proc# fdisk /dev/sdb
The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): t ← 領域のシステム ID を変更する
Partition number (1-5): 5 ← sdb5を選択
 
Hex code (type L to list codes): fd ← sda5のSystemと同じfdを入力する
 
Changed system type of partition 5 to fd (Linux raid autodetect)
Command (m for help): p ← 作成した領域テーブルを表示して確認する
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sdb2           19125       19452     2634660    5  Extended
/dev/sdb5           19125       19452     2634628+  fd  Linux raid autodetect
Command (m for help): w ← 今までの作業を書き込み
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.


もう一度確認してみましょう。

net:/proc# fdisk -l
Disk /dev/sda: 160.0 GB, 160000000000 bytes
255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000778ba
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sda2           19125       19452     2634660    5  Extended
/dev/sda5           19125       19452     2634628+  fd  Linux raid autodetect
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xed61aa6f
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       19124   153613498+  fd  Linux raid autodetect
/dev/sdb2           19125       19452     2634660    5  Extended
/dev/sdb5           19125       19452     2634628+  fd  Linux raid autodetect


これでsdbはsdaと同じ構成になりました。
mdadmでraidに追加します。

net:/proc# mdadm --manage /dev/md0 --add /dev/sdb1
mdadm: added /dev/sdb1
net:/proc# mdadm --manage /dev/md1 --add /dev/sdb5
mdadm: added /dev/sdb5


同期状況を確認してみます。

net:/proc# cat mdstat
Personalities : [raid1]
md1 : active raid1 sdb5[2] sda5[0]
      2634560 blocks [2/1] [U_]
        resync=DELAYED
md0 : active raid1 sdb1[2] sda1[0]
      153613376 blocks [2/1] [U_]
      [>....................]  recovery =  1.6% (2509888/153613376) finish=42.3min speed=59406K/sec
unused devices: <none>


md0は同期が始まりましたが、md1はresync=DELAYEDの状態。
md0が終わってからmd1は同期が始まります。

同期が終わるのをひたすら待ちますが、実はこの状態ではsdbからのブートが出来ません。
ブートローダーのGRUBをsdbにインストールしなければなりません。

net:/proc# cat mdstat
Personalities : [raid1]
md1 : active raid1 sdb5[1] sda5[0]
      2634560 blocks [2/2] [UU]
md0 : active raid1 sdb1[1] sda1[0]
      153613376 blocks [2/2] [UU]
unused devices: <none>


同期が終わりました。
sdbからもbootが出来るようにします。

net:/proc# grub ← GRUBシェルモード起動
    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub> root (hd1,0) ← sdbをrootにする
Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd1) ← sdbへGRUBインストール
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd1)"...  15 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd1) (hd1)1+15 p (hd1,0)/grub/stage2
/grub/grub.conf"... succeeded
Done.
grub> quit ← GRUBシェルモード終了


これでsdbにもブートローダーがインストールされました。

sdaが故障してもsdbをsdaの場所に繋ぎなおせばシステムは起動できます。

GRUBのメニューリストを修正してリストから起動ドライブを選択出きる様にするのも可能ですが、今回はこの手法はとりません。


ではでは~☆ミ

2014年11月17日月曜日

Debian 7.0 wheezy で BEEP音が鳴り続く、何故?

みなさん、こんにちは

BEEP音が鳴り止みません!!


前回の「FMV-BIBLO MG10AC に、Debian 7.0 wheezy をインストール その3 」で、なんとか Login 画面まで辿り着いたと思ったのも束の間、BEEP音が鳴り続けています。

”ピッピ”と断続的になる時と”ピピピピピ・・・”と連続的になる時とあります。

とりあえずエンターキーで音は止まるのですが、喧しくてかないません。


/var/log を一通りチェックしますがBEEP音の鳴るタイミングで何かしらのエラーは出ていないようです。(BIOSのlogはこの機種取れたかなぁ?)


とりあえず

1 BIOSでスピーカーを無効にする
2 「fn」+「F3」でミュートする(FMV-BIBLO MG10AC の場合)

あたりを咄嗟に考えたのですが、念のため

cat /var/log/dmesg | more

としてみて、もう一度見直ししてみると

Driver 'pcspkr' is already registered, aborting...

のエラーが!!

Driver 'pcspkr' は既にレジスト済み、中止する

とかってことでしょうか・・・・。


中止してるんだから悪さはしていないと思うのですが、念のため読み込まないように /etc/modprobe.d/fbdev-blacklist.conf  の最終行に

blacklist pcspkr

を付け足して reboot 。


あらら・・・・、何故かBEEP音が鳴らなくなりました。
とりあえず訳が分らないけど解決。


でも、BEEP音自体が無効になっていたら困るので

echo $'\a'

として音が鳴るかをチェックしておく


(FMV-BIBLO MG10AC は新品の時からかなり熱くなりましたので、熱が篭ったのか、それともバッテリーが磨耗してて警告が出ていたのか?)


しばし経過観察ということで、本日はお終いです。


ようやく次回は本題の bind で内向けDNS構築 にかかれそうです。


ではでは~☆ミ

2014年11月16日日曜日

FMV-BIBLO MG10AC に、Debian 7.0 wheezy をインストール その3

みなさん、こんにちは



前述のように画面がホワイトアウト状態でニッチもサッチもいかないので、Debian 7.0 wheezy を再インストールします。


再インストールの方針は、

1 インストール時に自動設定になってしまったネットワーク設定をこの際手動で設定する
2 カーネルを変更してみて状況が改善するか確認する
3 カーネルに読込するドライバを変更してみる
4 別端末から設定ファイルを変更できるようSSHサーバを立てる(BIBLOでは画面が表示できないので)


前回は何の予備調査もせずインストールしたので今回はキチンと調査を進めます。

まずはチップセットを確認。

FMV-BIBLO MG10AC は、Intel 830MG(133MHz) を使用と判明しましたので検索してみます。

・830MGは完全にIntelから見放された存在
・830MGは酷いことにLinuxのX Window と恐ろしく相性が悪い
・富士通FMVは不治痛FMV・・・・(言い得て妙)
・Intel 830MGの呪縛
・Intel 830MG は Linuxとは相性が悪い

悲しくなる情報ばかりです。orz


さて、気を取り直しして再インストール作業を開始します。


前回は下記画面で「Install」を選択しましたが、
今回は「Advancced options」→「Expert install」選択します。
ちょっと懐かしいインストール画面になりますが、手順は前述とほぼ一緒です。


ネットワークの設定を手動設定にして固定IPを振ります。
これでSSHでIP指定でアクセスが可能になります。


Expert install だと使用するカーネルを選択できるので幾つか試してみます。
またカーネルに組み込みするモジュールも変更できるので試してみます。

上記、全滅でした。


SSHサーバを立てたので、別端末からアクセスしてみます。
(SSH2でアクセスが可能です)


ネットの情報を頼りに /etc/defaul/grub を書き換えます。

GRUB_CMDLINE_LINUX_DEFAULT="quiet"
 ↓
GRUB_CMDLINE_LINUX_DEFAULT="text"

update-grub を実行して、/boot/grub/grub.cfg に反映させて reboot してみますが、改善せず。(最近は、grub.cfg を直接編集しないのが作法のようです)


GRUB_CMDLINE_LINUX_DEFAULT="xforcevesa text"

これならどうでしょう。




無事、起動しました。d(>_・ )グッ!


未検証ですが、

GRUB_CMDLINE_LINUX="vga=792"
or
GRUB_CMDLINE_LINUX="video=800x600"

でも上手くいきそうです。
http://en.wikipedia.org/wiki/VESA_BIOS_Extensions#Linux_video_mode_numbers


最終的には、

RUB_CMDLINE_LINUX_DEFAULT="xforcevesa acpi=off noapic nolapic text"

といたしました。


acpi=off noapic nolapic は、ACPIの実装が微妙なので追加いたしました。


まずは、やれやれです。


と、思いきや別のトラブルが・・・・・!!


こちらの模様は次回にでも。



ではでは~☆ミ