アットウィキロゴ

2008.07.07 Monday | category:Other
↓のページを参考にさせて頂きやってみました。
http://d.hatena.ne.jp/masahi6/20071013/1192219358

まずは qemu-0.9.0-windows.zip と Kqemu-1.3.0pre11インストーラ が必要なので、
それをインストール。
http://www.h7.dion.ne.jp/~qemu-win/index-ja.html

イメージになる空ファイルを作成する。
fsutil file createnew C:\Program Files\cent5\qemu_cent5_5gb 5368709120
fsutil file createnew C:\Program Files:\cent5\qemu_swap_512mb 536903168

C:\Program Files>fsutil file createnew cent5\qemu_cent5_5gb 53687
ファイル C:\Program Files\cent5\qemu_cent5_5gb が作成されました

C:\Program Files>fsutil file createnew cent5\qemu_swap_512mb 536903168

qemu で CentOS をインストール。
とりあえず必要最低限のものだけでいいので CD-ROM の1枚目だけで。
なぜかよく分からんが自分の環境では \ を \ でエスケープしないとダメみたい。

以下からCentOS5.8をダウンロードする。
http://mirror.fairway.ne.jp/centos/5.8/isos/i386/

cd "c:\Program Files\qemu-0.13.0-windows
qemu.exe -hda "C:\\Program Files\\cent5\\qemu_cent5_5gb" -hdb "C:\\Program Files\\cent5\\qemu_swap_512mb" -cdrom "C:\\Program Files\\cent5\\CentOS-5.8-i386-bin-1of7.iso" -m 256 -boot d -L .

(qemu) eject  ide1-cd0  
(qemu) change ide1-cd0


CDイメージを交換する
(qemu)change ide1-cd0 c:\CentOS-4.3-i386-bin2of4.iso


※インストールに時間がかかりすぎるのでtextインストールを行ったほうがよい。


▼フロッピーとCD-ROMなどのデバイスの状態の確認
(qemu) info block


インストールは「boot: linux text」のテキストインストールでね。
HDDの構成には注意が必要みたい。/ に hda をまるごと。swap に hdb まるごと。
で、インストールが終わったら、qemu をいったん終了。

再度、qemu で起動してインストールを完了。
qemu.exe -hda "C:\\Program Files\\cent5\\qemu_cent5_5gb" -hdb "C:\\Program Files\\cent5\\qemu_swap_512mb" -m 256 -L .

で、こいつを colinux で利用できるように、cobdの作成。
cd /dev
for i in `seq 1 10`; do mknod cobd$i b 117 $i; done

そのあとlinux終了して、cygwin の dd で colinux 用のイメージを作成。
dd if=/cygdrive/d/cent5/qemu_cent5_5gb of=/cygdrive/d/cent5/root.ext3 bs=512 skip=63
dd if=/dev/zero of=/cygdrive/d/cent5/swapfile bs=1024 count=524288

ここまでで、イメージ作成は終わり。
で、↓が colinux の設定ファイル。
--- colinux.conf ---
kernel=vmlinux
cobd0="C:\\Program Files\cent5\root.ext3"
cobd1="C:\\Program Files\cent5\swapfile"
root=/dev/cobd0
rw
initrd=initrd.gz
mem=512
eth0=tuntap,"colinux"
#ttys0=COM1,"BAUD=115200 PARITY=n DATA=8 STOP=1 dtr=on rts=on"
#exec0=C:\Programs\Xming\Xming.exe,":0 -clipboard -multiwindow -ac"
--------------------

あとは、colinux の起動方法やらなにやら。
cd C:\Program Files\coLinux
colinux 起動。
colinux-daemon @colinux.conf
colinux をサービス登録。
colinux-daemon @colinux.conf --install-service
サービスの起動。
net start "Cooperative Linux"
サービスの停止。
net stop "Cooperative Linux"

# んーなんか、colinux で起動すると、
# WARNING!!! Running e2fsck on a mounted filesystem may cause
# SEVERE filesystem damage.
# といわれる。なんでだ?


作成日: 2012年5月17日(木) 14時32分
groupadd [-g gid] group_name


作成日: 2012年2月6日(月) 14時38分▼圧縮コマンド
tar zcvf `date +%Y%m%d%H%M`_nvjob.tar.gz nvjob/


▼解凍コマンド

ファイルを解凍したいディレクトリに移動する
cd /ap/infra/nvjob

tarファイルがあるパスとファイルを指定して・sする
tar zxvf /usr/local/work/infra/nvjob.tar.gzAdvisory: RHBA-2011:1216-1
Type: Bug Fix Advisory
Severity: N/A
Issued on: 2011-08-29
Last updated on: 2011-08-29

net-snmp-5.3.2.2-14.el5_7.1.i386.rpm   
net-snmp-devel-5.3.2.2-14.el5_7.1.i386.rpm   
net-snmp-libs-5.3.2.2-14.el5_7.1.i386.rpm    
net-snmp-perl-5.3.2.2-14.el5_7.1.i386.rpm    
net-snmp-utils-5.3.2.2-14.el5_7.1.i386.rpm


バグを直す最新のネットsnmpパッケージは、今、レッド帽子エンタープライズ・リナックス5に利用可能です。
SNMP(単純ネットワーク管理プロトコル)はネットワーク管理に使用されたプロトコルです。
NET-SNMPプロジェクトは様々なSNMPツールを含んでいます:
拡張可能な代理人、SNMP図書館、SNMP代理人からの要求するかセットする情報用ツール、netstatコマンドの生成し取り扱いSNMPわなおよびバージョンのためのツール、SNMPを使用します。
ネットsnmpのパッケージはsnmpdとsnmptrapdの悪魔、ドキュメンテーションなどを含んでいます。
これらは、次のバグのフィックスを更新します:
* 前のネットsnmpの最新版では、UCD-SNMPMIB::dskTableなテーブルのインプリメンテーションは書き直されました。また、UCD-SNMP-MIB::dskPercentNodeカラムの報告はsnmpd悪魔から偶然に取り除かれました。
この最新版で、UCD-SNMP-MIB::dskPercentNodeのためのオブジェクト確認者は回復されました。また、それは、適切に今、記憶装置上で用いられている内叙情詩のパーセンテージを報告します、それにより、このバグを直します。
(BZ#732943)
ネットsnmpのユーザはみな、これらの最新のパッケージにアップグレードするように助言されます。それはこのバグを直します。


作成日: 2011年11月25日(金) 11時43分指定したサーバだけ通信ができるか?
⇒指定したサーバのみ通信する。

作成日: 2012年1月16日(月) 09時20分
▼新規ユーザパスワード作成または、パスワードを変更する。
sudo passwd <ユーザ名>

▼rootのパスワードを変更する
u_rb_admにログインする
sudo passwd

または、suにログインする
passwd

 

 


作成日: 2012年2月6日(月) 14時32分rpm -qa --queryformat "%{name}-%{version}-%{release}.%{arch}\n" | sort > "`uname -n`_package.log"
rpm -Fvh *.rpm [Enter]

と実行することで、
「アップデート可能なものだけをアップデートし、
カレントディレクトリに新規にインストール可能なパッケージが
混ざっていてもインストールしない。」


作成日: 2011年10月25日(火) 09時46分
$ getenforce
Enforcing
⇒disabledでなかったら以下を行う。

▼SELinuxの完全無効化

vi /etc/sysconfig/selinux
SELINUX=enforcing
   ↓
SELINUX=disabled

※注意
「SELINUXTYPE」を間違えて変えない。間違えると再起動したとき
起動しなくなるため。


▼動作状態の確認

cat /etc/sysconfig/selinux | grep "SELINUX="
⇒disabledであること

$ getenforce

※selinuxの設定ミスして起動しなくなったときGrubの画面で"F3"⇒"e"を押して以下を実行する

kernel /boot/~ ro root=~

kernel /boot/~ ro root=~ enforcing=0

※上記だけでなくrootのバスワードを忘れたとき

kernel /boot/~ ro root=~ enforcing=0 single
passwdコマンドでrootのパスワードを変更する


作成日: 2011年10月19日(水) 11時28分Advisory: RHBA-2011:0079-1
Type: Bug Fix Advisory
Severity: N/A
Issued on: 2011-01-13
Last updated on: 2011-01-13

様々なバグを直す最新のsudoパッケージは、今、レッド帽子エンタープライズ・リナックス5に利用可能です。
sudo(スーパーユーザは行ってください)ユーティリティは、システム管理者が根として実行命令にあるユーザに能力を与えることを可能にします。
この最新版は次のバグを直します:
* 字句解析プログラム規則の正しくない定義により、否定されたユーザー固有の「デフォルト」指令の使用はparseエラーで失敗しました。
この最新版で、そのような指令は今予想通りに解析されます。
(BZ#580438)
* この最新版に先立って、それはLDAP sudoers出所をセット・アップする方法についての重要な情報を含んでおり、他のドキュメントがそれを指すが、sudoers.ldapのためのマニュアルページはインストールされませんでした。
このエラーはもはや生じません。また、マニュアルページは今、パッケージに適切に含まれています。
さらに、それらが構造目的だけに必要なので、様々なPODファイルはパッケージから取り除かれました。
(BZ#583644)
* 「デフォルト」指令の「visiblepw」オプションに関するコメントは、その使用法を明確にするためにデフォルト/etc/sudoersファイルに加えられました。
(BZ#583911)
* sudoersマニュアルページ中のタイプミスは修正されました。
(BZ#602022)
* /etc/sudoersファイルが多数のホストを備えたエントリーを含んでいた時、「sudo -l」の実行、コマンドは、あるユーザがシステム上でsudoを使用する許可を持っていないと不正確に報告しました。
この最新版で、根本的なソース・コードはこの問題をターゲットとするために修正されました。また、今「sudo -l」コマンドを実行することは正確な出力を生産します。
(BZ#603819)
* ユーザとグループ名の中の混合場合の正しくない取り扱いにより、アクティブ・ディレクトリーから情報を取って来ることはキャッシュ・エラーで失敗したかもしれません。
この最新版で、アップストリームのパッチはこの問題をターゲットとするために適用されました。また、sudoは今予想通りに働きます。
(BZ#615179)
sudoのユーザはみな、この最新のパッケージにアップグレードするように助言されます。それはこれらの問題を解決します。

 

作成日: 2011年11月25日(金) 11時26分
ユーザIDが101がかぶっていないことを確認する。

awk -F ":" '{print $3}' /etc/passwd | grep 101

useradd -u <UID> -g <グループ名/GID> <ユーザ名>

パスワードを指定する
※英数字、記号を組み合わせて指定する
passwd <ユーザ名>

ログインできることを確認する

telnet <ユーザ名>


作成日: 2012年2月6日(月) 13時39分
▼ユーザを削除する
userdel -r <ユーザ名>

ユーザ名が表示されないことを確認する
awk -F ":" '{print $1}' /etc/passwd | grep <ユーザ名>

ディレクトリが存在しないことを確認する
ls /home/ | grep <ユーザ名>


作成日: 2012年2月6日(月) 14時19分
既存のユーザーの情報を変更するには usermod コマンドを使用します。
ユーザー名を変更するには、以下のようにします。
usermod -l 新ユーザー名 旧ユーザー名

所属グループを変更するには、以下のようにします。
usermod -G 新グループ名 ユーザー名

ホームディレクトリを変更するには、以下のようにします。
usermod -d 新しいホームディレクトリ -m ユーザー名

( -m オプションをつけると、これまでのホームディレクトリの内容が新しいディレクトリへ移動される )

▼ユーザのシェルの変更

usermod -s <shellのパス> <ユーザ名>

※test02ユーザのシェルをcshに変更する場合
usermod -s /bin/csh test02

作成日: 2012年2月6日(月) 14時33分Advisory: RHBA-2011:0830-2
Type: Bug Fix Advisory
Severity: N/A
Issued on: 2011-07-21
Last updated on: 2011-07-21

様々なバグを直す最新のvsftpdパッケージは今利用可能です。
vsftpdパッケージは非常に安全なFTP(ファイル転送プロトコル)悪魔を含んでいます。
この最新のvsftpdパッケージは、次のバグのフィックスを含んでいます:
* vsftpdの旧バージョンはワイルドカードを正確に解釈しませんでした。
その結果、ワイルドカード機能性に依存する適用は適切に機能しませんでした。
この最新版で、支援されたワイルドカード('*'および「?」)は予想通りに働きます。
(BZ#517292)
* 特定のオプションが設定ファイル中でセットされた時、vsftpdは時期尚早に接続を閉じました。
これは、ポストauthコマンドを扱う原因だった子プロセス、およびその子プロセスの振る舞いに影響を及ぼしたパッチによって引き起こされました。
この最新版で、その親は死ぬので、接続がもはや時期尚早に閉じない場合、終止コドンは子プロセスに送られます。
(BZ#530706)
* ある状況の下では、いくつかのクライアントは掛かっていたか作用するかもしれません、ssl_data_close()機能中のSSL_shutdown()への2倍の不完全な呼び出しにより遅い
この最新版で、呼び出しは固定しました。また、クライアントはもはやゆっくり掛かっていないか、行ないます。
(BZ#556795)
* この最新版に先立って、vsftpdは子どもと親プロセスの間に信号するためにSIGUSR1信号を使用しました。
しかしながら、SIGUSR1信号を送ると、他のアプリケーションは無作法に振る舞う場合があります。
この最新版で、次のパラメーターが/etc/vsftpd.conf設定ファイル中でセットされる場合のみ、SIGUSR1信号は送られます:
「背景YES。」
(BZ#579317)
* 確証することを試みること、ケルベロス認証を備えたvsftpdサーバに対する、空のユーザー名および空のパスワードで、失敗し、次のメッセージを返した:
「500、おっと:
0あるいはvsf_sysutil_mallocの中の大きなサイズ。」
この最新版で、vsftpdは、適切に確証するべき試みを扱います。

 

作成日: 2011年11月25日(金) 11時30分パスワードポリシーの変更方法
☆パスワードポリシーの変更には、system-authの修正を行う

条件:RedHat系のOSであらキと

▼RedHat5.5のインストール直後のデフォルトのsystem-authは、以下
/etc/pam.d/system-auth
-----------------------------------------------------------------------------------------------
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so

account     required      pam_unix.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     required      pam_permit.so

password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
-----------------------------------------------------------------------------------------------

▼修正後のsystem-auth
/etc/pam.d/system-auth
-----------------------------------------------------------------------------------------------
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so

account     required      pam_unix.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     required      pam_permit.so

password    requisite     pam_cracklib.so try_first_pass retry=3 type= minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 difok=1
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=2
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
-----------------------------------------------------------------------------------------------

▼パラメータの意味
retry=N     N回まで失敗が許されます。
type=XXX    プロンプトに使われる文字列。
difok=N     現在のパスワードと N文字以上異なれば許可。
minlen=N    パスワードが N文字以純]と許可。
dcredit=-N  数字が N文字以上含まれていれば許可。
ucredit=-N  大文字が N文字以上含まれていれば許可。
lcredit=-N  小文字が N文字以上含まれていれば許可。
ocredit=-N  その他の文字が N文字以上含まれていれば許可。

▼試してわか・スこと
system-authを修正後、OS再起動をかけないでaEぐに反映される。

作成日: 2012/03/20(Tue) 20:32nkf -g file

作成日: 2012年5月16日(水) 12時31分kernel bug fix
RHBA-2012:0361-1
2012-03-07

kernel-2.6.18-308.1.1.el5.i686.rpm     MD5: 571511b1829455250480417b57a5c059
SHA-256: b8367f33e671645cab54c657166df6d8c94effa056ef491aa3e602f4542cd5a7
kernel-PAE-2.6.18-308.1.1.el5.i686.rpm     MD5: 7fc7776e4f0c923e4123bf9d3f7ca179
SHA-256: ac92e519cf462f4e6efc57e223b3c11b33294908f53a978ad5dc89f86f0c8025
kernel-PAE-devel-2.6.18-308.1.1.el5.i686.rpm     MD5: 4302812eac9b64b37d7885b325e7d23d
SHA-256: 9b25d9c8f437c304bddccb700c201a180f4f3f5dedfe3ecc0b75c40ecd0702e1
kernel-debug-2.6.18-308.1.1.el5.i686.rpm     MD5: 745faa2fca6f192f2a51db5576a84d27
SHA-256: 697d0f9b408fbfb0cb3b82983b40d99c0cd79eb9c9f10c35f509917b7ccc3b3c
kernel-debug-devel-2.6.18-308.1.1.el5.i686.rpm     MD5: 16e3d466ad92dee5bc48ead1dc4d4001
SHA-256: ef9a3e03b9ed7bbab85e5a40d7e19b45bd2b9cd0a4244f9fce6762fed2ba109f
kernel-devel-2.6.18-308.1.1.el5.i686.rpm     MD5: 81f3c6c4ed5673a37f0661c629633f6a
SHA-256: ed47013197200b5d5d42253f6cc1c2f4f1831d2344a2bc33bf8ec16ab41bd4fa
kernel-doc-2.6.18-308.1.1.el5.noarch.rpm     MD5: c42a076660ae8dcb7a16d03e66f415ff
SHA-256: 00b7d28dabc6c49e02c89f0b720e48208abefeeb4536e0507f2d626e45394138
kernel-headers-2.6.18-308.1.1.el5.i386.rpm     MD5: e60dd963bd7418661f6dab14a0332554
SHA-256: 9a16083c13cb1fd0cd4fc2fdf4e0a0e4b13b45a549ddb7d2fd4dde8f382162c9
kernel-xen-2.6.18-308.1.1.el5.i686.rpm     MD5: ed332c2503d1c3f044e1b8aa408df9f3
SHA-256: f337aeaea15a2d8b9263634f9772a90a5ea129ecf61a03b55994fc90b16447e0
kernel-xen-devel-2.6.18-308.1.1.el5.i686.rpm     MD5: cd035a306565ad0f2c1405c84e3a7b35
SHA-256: eb7f45e0290fe4f70532dce0e1d13298789b54fa9483910b892c6a65f1b0897c

 


Updated kernel packages that fix multiple bugs are now available for Red Hat
Enterprise Linux 5.


The kernel packages contain the Linux kernel, the core of any Linux operating
system.

Bug fixes:

* The root user without the CAP_SYS_ADMIN capability was able to reset the
contents of the "/proc/sys/kernel/dmesg_restrict" configuration file to 0.
Consequently, the unprivileged root user could bypass the protection of the
"dmesg_restrict" file and read the kernel ring buffer. This update ensures that
only the root user with the CAP_SYS_ADMIN capability is allowed to write to the
dmesg_restrict file. Any unauthorized attempt on writing to this file now fails
with an EPERM error. (BZ#749246)

* An Ethernet physical transceiver (a PHY chip) was always powered up when a
network interface card (NIC) using the igb driver was brought down. Recent
changes had modified the kernel so that the PHY chip was powered down in such a
scenario. With this PHY power saving feature, the PHY chip could unexpectedly
lose its settings on rare occasions. Consequently, the PHY chip did not recover
after the NIC had been re-attached and the NIC could not be brought up. The igb
driver has been modified so that the PHY chip is now reset when the NIC is
re-attached to the network. NICs using the igb driver are brought up as
expected. (BZ#786168)

* The way how the kernel processes dentries in the dcache when unmounting file
systems allowed the concurrent activity on the list of dentries. If the list was
large enough, the kernel could, under certain circumstances, panic due to NMI
watchdog timeout triggered by the waiting concurrent process. This update
modifies underlying functions to use a private dcache list for certain
operations on the dcache so that concurrent activities are no longer affected in
this scenario. (BZ#789369)

* The Abstract Control Model (ACM) driver uses spinlocks to protect the lists of
USB Request Blocks (URBs) and read buffers maintained by the driver. Previously,
when a USB device used the ACM interface, a race condition between scheduled ACM
tasklets could occur. Consequently, the system could enter a deadlock situation
because tasklets could take spinlocks without disabling interrupt requests
(IRQs). This situation resulted in various types of soft lockups ending up with
a kernel panic. This update fixes the problem so that IRQs are disabled when a
spinlock is taken. Deadlocks no longer occur and the kernel no longer crashes in
this scenario. (BZ#790778)

* A recent change in the QLogic qla2xxx driver introduced a bug which could,
under rare circumstances, cause the system to become unresponsive. This problem
occurred during I/O error recovery on systems using SAN configurations with
QLogic Fibre Channel Hot Bus Adapters (HBAs). This update corrects the qla2xxx
driver so the system no longer hangs in this scenario. (BZ#790907)

* Due to recent changes in the tg3 driver, the driver attempted to use an
already freed pointer to a socket buffer (SKB) when the NIC was recovering from
unsuccessful memory mapping. Consequently, the NIC went offline and the kernel
panicked. With this update, the SKB pointer is newly allocated in this scenario.
The NIC recovers as expected and a kernel panic does not occur. Also, the tg3
driver could, under certain circumstances, attempt to unmap a memory fragment
that had not been mapped. Consequently, the kernel panicked. This update fixes
the bug by correcting the "last" parameter supplied. (BZ#790910)

* When a network interface card (NIC) with a fan experiences a fan failure, the
PHY chip is usually powered down by its firmware. Previously, the bnx2x driver
did not handle fan failures correctly, which could trigger a non-maskable
interrupt (NMI). Consequently, the kernel could crash or panic. This update
modifies the bnx2x driver to handle fan failures properly, the NIC is now shut
down as expected and the kernel does not crash in this scenario. (BZ#790912)

All users are advised to upgrade to these updated packages, which fix these
bugs. The system must be rebooted for this update to take effect.


Updated kernel packages that fix multiple bugs are now available for Red Hat
Enterprise Linux 5.


The kernel packages contain the Linux kernel, the core of any Linux operating
system.

Bug fixes:

* The root user without the CAP_SYS_ADMIN capability was able to reset the
contents of the "/proc/sys/kernel/dmesg_restrict" configuration file to 0.
Consequently, the unprivileged root user could bypass the protection of the
"dmesg_restrict" file and read the kernel ring buffer. This update ensures that
only the root user with the CAP_SYS_ADMIN capability is allowed to write to the
dmesg_restrict file. Any unauthorized attempt on writing to this file now fails
with an EPERM error. (BZ#749246)

* An Ethernet physical transceiver (a PHY chip) was always powered up when a
network interface card (NIC) using the igb driver was brought down. Recent
changes had modified the kernel so that the PHY chip was powered down in such a
scenario. With this PHY power saving feature, the PHY chip could unexpectedly
lose its settings on rare occasions. Consequently, the PHY chip did not recover
after the NIC had been re-attached and the NIC could not be brought up. The igb
driver has been modified so that the PHY chip is now reset when the NIC is
re-attached to the network. NICs using the igb driver are brought up as
expected. (BZ#786168)

* The way how the kernel processes dentries in the dcache when unmounting file
systems allowed the concurrent activity on the list of dentries. If the list was
large enough, the kernel could, under certain circumstances, panic due to NMI
watchdog timeout triggered by the waiting concurrent process. This update
modifies underlying functions to use a private dcache list for certain
operations on the dcache so that concurrent activities are no longer affected in
this scenario. (BZ#789369)

* The Abstract Control Model (ACM) driver uses spinlocks to protect the lists of
USB Request Blocks (URBs) and read buffers maintained by the driver. Previously,
when a USB device used the ACM interface, a race condition between scheduled ACM
tasklets could occur. Consequently, the system could enter a deadlock situation
because tasklets could take spinlocks without disabling interrupt requests
(IRQs). This situation resulted in various types of soft lockups ending up with
a kernel panic. This update fixes the problem so that IRQs are disabled when a
spinlock is taken. Deadlocks no longer occur and the kernel no longer crashes in
this scenario. (BZ#790778)

* A recent change in the QLogic qla2xxx driver introduced a bug which could,
under rare circumstances, cause the system to become unresponsive. This problem
occurred during I/O error recovery on systems using SAN configurations with
QLogic Fibre Channel Hot Bus Adapters (HBAs). This update corrects the qla2xxx
driver so the system no longer hangs in this scenario. (BZ#790907)

* Due to recent changes in the tg3 driver, the driver attempted to use an
already freed pointer to a socket buffer (SKB) when the NIC was recovering from
unsuccessful memory mapping. Consequently, the NIC went offline and the kernel
panicked. With this update, the SKB pointer is newly allocated in this scenario.
The NIC recovers as expected and a kernel panic does not occur. Also, the tg3
driver could, under certain circumstances, attempt to unmap a memory fragment
that had not been mapped. Consequently, the kernel panicked. This update fixes
the bug by correcting the "last" parameter supplied. (BZ#790910)

* When a network interface card (NIC) with a fan experiences a fan failure, the
PHY chip is usually powered down by its firmware. Previously, the bnx2x driver
did not handle fan failures correctly, which could trigger a non-maskable
interrupt (NMI). Consequently, the kernel could crash or panic. This update
modifies the bnx2x driver to handle fan failures properly, the NIC is now shut
down as expected and the kernel does not crash in this scenario. (BZ#790912)

All users are advised to upgrade to these updated packages, which fix these
bugs. The system must be rebooted for this update to take effect.

 

複数のバグを修正したカーネルのアップデートパッケージがRed Hatのために利用可能になりました
Enterprise Linux 5に。


カーネルパッケージは、Linuxカーネルは、あらゆるLinuxオペレーティングシステムのコアが含まれてい
システム。

バグ修正:

* CAP_SYS_ADMIN機能を持たないrootユーザーはリセットすらキとができました
の内容 "を/ proc / sys /カーネル/ dmesg_restrict 0"に設定ファイルを指定します。
その結果、鏑のないrootユーザーが保護をバイパスすらキとができ
ファイルを "dmesg_restrict"とカーネルのリングバッファを読んでください。この更新プログラムは、確・ノ
CAP_SYS_ADMIN機能を持つrootユーザーだけがへの書き込みを許可されている
ファイルをdmesg_restrict。このファイルへの書き込み上の任意の不正な試みが今失敗した
EPERMエラーが発生した。 (BZ#749246)

時*イーサネット物理トランシーバ(PHYチップ)は、常に電源が投入されました
igbドライバを使用して、ネットワークインターフェイスカード(NIC)が倒された。最近の
変更は、PHYチップなどでパワーダウンされたようにカーネルを修正した
シナリオ。このPHY省電力機能を使用すると、PHYチップは、予期しない可能性
まれにその設猪b失われます。その結果、PHYチップは回復しなか・ス
NICが再接続されていたとNICが育つことができませんでした後。 IGB
ドライバは、NICがある場合のPHYチップがリセットされるようになりましたように変更されました
ネットワークに再接続されている。 igbドライバを使用してNICを次のように育・トい
期待される。 (BZ#786168)

ファイルをアンマウント時にカーネルがdcacheのでdentryを処理する方法*方法
システムは、ディレクトリ?エントリのリストの同時活動を可能にした。リストがあ・ス場合
十分な大きさで、カーネルは、迭閧フ状況下で、NMIによるパニックが
ウォッチドッグのタイムアウトが待・トいる・sプロセスによ・ト引き起こされる。この更新
迭閧フプライベートdcacheのリストを使用する基本的な機能を変更する
同時活動が影響を受けれなくな・スように、dcacheの上の操作
このシナリオでは。 (BZ#789369)

*概要制御モデル(ACM)ドライバのリストを保護するためにスピンロックを使用しています
USBリクエストブロック(URBs)とドライバによ・ト維持されるバッファを読み取ります。以前は、
USBデバイスは、ACMインターフェース、スケジュールされたACMの間に競合状態を使用したとき
タスクレットが発生する可能性があります。したが・ト、システムはデッドロックの状況を入力すらキとができます
タスクレットは、割り込み要求を無効にせずにスピンロックを取らキとができるので、
(IRQ)を。このような状況はで終わるソフトロックアップの様々な種類の結果
カーネルパニック。このアップデートは、IRQが無効にな・トいるように問題を修正
スピンロックが誌・ウれます。デッドロックが発生しなくなりましたとでカーネルがクラッシュしなく??なりました
このシナリオでは。 (BZ#790778)

のQLogic qla2xxxドライバで*最近の変更は、可能性のあるバグを導入しました
まれな状況下で、システムが応答しなくなる原因となります。この問題
とSAN構成を使用しているシステム上のI / Oエラーリカバリ中に発生した
QLogicファイバチャネルホットバスアダプタ(HBA)。このアップデートではqla2xxxのを修正
システム、ドライバは、もはやこのシナリオでは、ハングアップしません。 (BZ#790907)

tg3ドライバで最近の父ヨサに*があるため、ドライバが使用しようとしました
NICから回復したときに既にソケットバッファ(SKB)へのポインタを解放した
失敗したメモリマッピング。したが・ト、NICがオフラインにな・スし、カーネル
パニックが発生しました。このアップデートにより、SKBのポインタは、新しくこのシナリオでは、割ゆ墲トられています。
NICは期待どおりに回復し、カーネルパニックが発生しません。また、TG3
ドライバは、迭閧フ状況下で、メモリのフラグメントのマッピングを解除しようとする可能性があり
それがマッピングされていませんでした。その結果、カーネルはパニックが発生しました。この更新プログラムで修正される
付属の "最後"のパラメータを修正すらキとにより、バグを修正しました。 (BZ#790910)

*ファンを持つネットワークインターフェイスカード(NIC)がファンの障害が発生した場合、
PHYチップは、通常、そのファームウェアによ・トパワーダウンします。以前に、bnx2xドライバ
ノンマスカブルを引き起こす可能性がこれ、正しくファンの障害を処理しませんでした
割り込み(NMI)。したが・ト、カーネルがクラッシュしたり、パニックになる可能性があります。この更新
適切にファンの障害を処理するためのbnx2xドライバを変更して、NICが現在シャットダウンされ
ダウンが期待どおり、カーネルはこのシナリオではクラッシュしません。 (BZ#790912)

すべてのユーザは、これらの問題を解決する上記アップデートパッケージにアップグレードしてください
バグ。システムを有効にするには、このアップデートを再起動する必要があります。
▼配列の中の値を結合する

#現在のディレクトリの一覧を取得する
my @all_files = glob "*";

print join("-", @all_files) ;

print join("\n", @all_files) ;

print join("\n", @all_files) . "\n\n";
→最後尾、2行改行する

▼表示結果
$ perl test4.pl
debug.pl-test.pl-test.txt-test.vbs-test2.pl-test2.vbs-test3.pl-test4.pl


debug.pl
test.pl
test.txt
test.vbs
test2.pl
test2.vbs
test3.pl
test4.pl


作成日: 2012年6月12日(火) 11時43分

test2.pl

use File::Basename;

use strict;
use warnings;


while(<*.txt>)
{
open(FILE, "+< $_");         # ファイルを読み書きモードで開く
@lines = <FILE>;                  # すべての行を読み込む
$name = basename($_); # $name = 'test.txt'
@extlist = ('.txt');
$name2 = basename($_, @extlist);
utf8::decode($name2);
unshift(@lines, "$name2\r\n"); # 配列の先頭に行を追加
seek(FILE, 0, 0);                  # 書き込み位置をファイルの先頭に移動
print FILE @lines;                 # 配列をすべて書き込む
close(FILE);
}   

test3.pl

use File::Basename;
use utf8;
binmode STDIN,  ":utf8";
binmode STDOUT, ":utf8";

use strict;
use warnings;

while(<*.txt>)
{
open(FILE, "+<:encoding(shiftjis)",$_");         # ファイルを読み書きモードで開く
@lines = <FILE>;                  # すべての行を読み込む
$name = basename($_); # $name = 'test.txt'
    @extlist = ('.txt');
   
    $name2 = basename($_, @extlist);
   
unshift(@lines, "$name2\r\n"); # 配列の先頭に行を追加
seek(FILE, 0, 0);                  # 書き込み位置をファイルの先頭に移動
print FILE @lines;                 # 配列をすべて書き込む
close(FILE);
}   

test4.pl

use File::Basename;
while(<*.txt>)
{
open(FILE, "+< $_");         # ファイルを読み書きモードで開く
@lines = <FILE>;                  # すべての行を読み込む
$name = basename($_);# $name = 'test.txt'
@extlist = ('.txt');
$name2 = basename($_, @extlist);
utf8::decode($name2);
unshift(@lines, "$name2\r\n"); # 配列の先頭に行を追加
seek(FILE, 0, 0);                  # 書き込み位置をファイルの先頭に移動
print FILE @lines;                 # 配列をすべて書き込む
close(FILE);
}   


test.pl

use File::Basename;
use warnings;

my @all_files = glob "*";
print join("\n", @all_files) . "\n\n";

print "1: カレントディレクトリのファイル一覧を取得する。\n";
# * は、. で始まらないすべてのファイルを表現

print "2: .txt で終わるファイル一覧を取得する。\n" ;
my @text_files = glob "*.txt";
print join("\n", @text_files) . "\n\n";

opendir(DIR, "X:\999_個人ファイル\xxx_梶田資料" );
my @files = readdir(DIR);
close(DIR);
@files = sort @files;
foreach my $file(@files) {
    print($file."\n");
    if( $file  =~ /\.txt/ ){
    $name = basename($file); # $name = 'test.txt'
    @extlist = ('.txt');
    $name2 = basename($file, @extlist); # $name2 = 'test'
   
    open(FILE, "+< $file");         # ファイルを読み書きモードで開く
    @lines = <FILE>;                   # すべての行を読み込む
    unshift(@lines, "$name2\r\n"); # 配列の先頭に行を追加
    seek(FILE, 0, 0);                  # 書き込み位置をファイルの先頭に移動
    print FILE @lines; 
    close(FILE);                       # クローズする
   
    }
}

▼use strictについて

先ほどのプログラムの2行目に「use strict;」と入れて、再度実行すると、今度は以下のようにエラーが出ます。
Global symbol "$abc" requires explicit package name at test.pl line 3.
Global symbol "$acb" requires explicit package name at test.pl line 5.
Global symbol "$abc" requires explicit package name at test.pl line 5.
Global symbol "$abc" requires explicit package name at test.pl line 7.
Execution of test.pl aborted due to compilation errors.

これの意味は、
Symbole(=変数) "$abc"は厳密なパッケージ名を要求されます。(=厳密にパッケージ名を指定しないと使わせません。)
です。
変数の使用宣言を行う前に変数を自動宣言して使わせようとするとuse strict;配下ではエラーになります。

これを回避するには「my」などの局所化演算子をつけます。
myというのは、「今、この宣言のあるスコープのパッケージ名前空間にXXXXという変数を宣言する。」という意味です。
特殊な場合を除き、「use strict;配下ではmyをつけて宣言をしないと変数は使えない。」と覚えておいてください。
先ほどのサンプルプログラムでmyを使うべき箇所は3行目になります。
 3: $abc = 'aaaa'; → my $abc = 'aaaa'; に修正。

作成日: 2012年6月12日(火) 15時25分

▼ディレクトリ内のファイルとディレクトリをすべて読み出して表示させる

opendir(DIR, "/cygdrive/y/xxx_梶田資料/memo/技術メモ/プログラム関連" );
@file = readdir(DIR);
closedir(DIR);

foreach (@file) {
    print "$_\n";
}


作成日: 2012年6月12日(火) 12時51分

▼ファイルハンドルについて

Perlでは、ファイルの入出力にファイルハンドルというものを使います。
ファイルハンドルとは、今どのファイルを処理しているかを管理するための名前のことです。
ファイルの読み込みや書き込みをするには、まずファイルを開いてファイルハンドルに
関連付けし、そのファイルハンドルを操作するのが基本手順になります。

open関数とファイルハンドル
あらかじめ用意された標準のファイルハンドル以外を使う場合には、open関数を使用します。


作成日: 2012年6月12日(火) 11時00分

▼ファイルを開いて表示

$file = "./test.pl";
open( FILE, "$file") or die "Can't open $text";
while ( <FILE> ){
print;
}
close( FILE )

作成日: 2012年6月8日(金) 15時31分

現フォルダのtxtファイルのファイル名を先頭に追記する

use File::Basename;

while(<*.txt>)
{
open(FILE, "+< $_");         # ファイルを読み書きモードで開く
@lines = <FILE>;                  # すべての行を読み込む
$name = basename($_);# $name = 'test.txt'
@extlist = ('.txt');
$name2 = basename($_, @extlist);
utf8::decode($name2);
unshift(@lines, "$name2\r\n"); # 配列の先頭に行を追加
seek(FILE, 0, 0);                  # 書き込み位置をファイルの先頭に移動
print FILE @lines;                 # 配列をすべて書き込む
close(FILE);
}

▼現フォルダのtxtファイルの先頭にファイル名をつける

use File::Basename;

use strict;
use warnings;

while(<*.txt>)
{
open(FILE, "+< $_");         # ファイルを読み書きモードで開く
my @lines = <FILE>;                  # すべての行を読み込む
my $name = basename($_); # $name = 'test.txt'
my @extlist = ('.txt');
my $name2 = basename($_, @extlist);
unshift(@lines, "$name2\n"); # 配列の先頭に行を追加
seek(FILE, 0, 0);                  # 書き込み位置をファイルの先頭に移動
print FILE @lines;                 # 配列をすべて書き込む
close(FILE);
}   


▼指定ファイルの先頭にコメント(AAABBB)を追記する

open(FH,"+<test.pl"); # 入力モードでオープン
@lines = <FH>; # 1行読み込み
unshift(@lines, "AAABBB\n");
seek(FH, 0, 0);
print FH @lines;
close(FH);

作成日: 2012年6月12日(火) 10時13分
 

最終更新:2012年08月20日 12:55