http://thinkit.co.jp/story/2011/07/05/2188
CentOSでWake-On-Lanを使う方法はいろいろありますが、ここではethtoolというツールを使ってみたいと思います。
# yum -y install ethtool <- ethtoolをインストールします
# ethtool -s eth0 wol g <- eth0というNICがマジックパケットを受け取れるように
ただし上記の方法だとサーバーを起動する度にマジックパケットを受け取れるよう設定しなければなりませんので、以下のいずれかの要領で設定ファイルを書き加えておくと良いでしょう。
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
ETHTOOL_OPTS="wol g"
もしくは
# vi /etc/rc.local
ethtool -s eth0 wol g
の要領で追記します。
なお、設定が無事に行われたかどうかは以下のコマンドを実行することで判断することができます。
# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g <-ここが「g」になっていればOK
Current message level: 0x00000033 (51)
Link detected: yes
問題なければマジックパケットを飛ばすNICのMACアドレスをメモしておきます。
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:2F:C1:FB:DB:90 <- この部分にあるMAC
アドレスをメモします
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63293164 errors:0 dropped:0 overruns:0 frame:0
TX packets:25251966 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3115658524 (2.9 GiB) TX bytes:2933678118 (2.7 GiB)
Interrupt:217 Base address:0xa000
そしてマシンをシャットダウンします。
# shutdown -h now <- シャットダウン
|
Apache 2.0とTomcat 5.0の連携
dnotifyを利用する場合
SQLのテクニックを記
Oracleのテクニックを記
VARCHAR2をNUMBERに変換する際、桁数で怒られるときに桁数を無視するfunction
tracの設定メモ
inotifyを利用する場合
監視サーバーの設
SSLキー作
監視サーバーの設
|