諸々の事情により、Debian 6.0.7。
バージョン確認
debian:~# cat /etc/debian_version
6.0.7
debian:~# uname -a
Linux webclass-temp 2.6.32-5-amd64 #1 SMP Fri Feb 15 16:59:37 UTC 2013 x86_64 GNU/Linux
IFの入れ替え
参考: debianでeth0とeth1のNICを反転させる。
/etc/udev/rules.d/70-persistent-net.rules
を編集。
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x1096 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="01:23:45:67:89:10", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x1096 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="01:23:45:67:89:11", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
こいつの‘‘NAME=‘‘のところを変更。
再起動で反映。
IPアドレス
/etc/network/interfaces
を編集。
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.254
# The secondery network interface
allow-hotplug eth1
iface eth1 inet dhcp
ifdown eth0````ifup eth0
で反映。
apt-getとかaptitudeでProxyつかう
/etc/apt/apt.conf
を編集。(初期状態では存在しなかった。)
Acquire::ftp::proxy "ftp://proxy.hoge.fuga.com:3128";
Acquire::http::proxy "http://proxy.hoge.fuga.com:3128";
Acquire::https::proxy "https://proxy.hoge.fuga.com:3128";
wgetでProxyつかう
/etc/wgetrc
を編集。
# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
https_proxy = https://proxy.hoge.fuga.com:3128/"
http_proxy = http://proxy.hoge.fuga.com:3128/"
ftp_proxy = ftp://proxy.hoge.fuga.com:3128/"
一番後ろの/
のつけ忘れに注意。
忘れていると、「bad port」って怒られる。
サービスを止める
update-rc.d
を使うとupdate-rc.d: using dependency based boot sequencing
と怒られる。
代わりにinsserv
コマンドを使う。
32ビット版をインストールしたのに64ビットカーネルが入っている
64ビット対応のIAサーバーに、32ビット版DVDからインストール。
debian:~# uname -m
x86_64
なんでだ?
AMD64 移植版#i386 用の最小限の AMD64 動作対応
公式の i386 ディストリビューションにも、実際には最小限の AMD64 対応が含まれて おり、64 ビットカーネル、64 ビットバイナリを作成可能なツールチェイン、サードパーティ製の amd64 バイナリをネイティブの共有ライブラリで動作させるための amd64-libs パッケージ で構成されています。
そういうものらしいです。
時計が9時間ずれる
debian:~# date
Mon Mar 31 18:28:27 JST 2014
実際の時間は9時28分。時計が9時間進んでる。
debian:~# hwclock --show
Mon 31 Mar 2014 09:29:52 AM JST -0.359495 seconds
CMOSの時間はちゃんと合ってる。
Debianのドキュメントによると、こんな設定があるらしい。
/etc/default/rcS ファイルにある設定で、システムがハードウェアの時計を UTC として解釈するか、現地時間として解釈するかを決定します。
hwclock
で思いっきりJSTって認識してるのに、それでもUTCにしてくるのはこいつのせいか!
/etc/default/rcS
を変更すればOK。
TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=no
VERBOSE=no
FSCKFIX=no
RAMRUN=no
RAMLOCK=no
UTCをnoに変更。
debian:~# hwclock --hctosys --localtime
debian:~# date
Mon Mar 31 09:32:49 JST 2014
さらに、システムクロックを手で修正。
hwclock --hctosys
で、システムクロックをハードウェアクロック(=CMOS時間)に合わせる。
あとは、再起動したときにちゃんと設定が効いてるか確認。
エディタを変更
Debianではデフォルトのエディタがnanoになっていて、crontab -e
とかしたときに使い方が分からなくて困る。
コマンド叩いてVimに変更してあげる。
# update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).
Selection Path Priority Status
------------------------------------------------------------
* 0 /bin/nano 40 auto mode
1 /bin/ed -100 manual mode
2 /bin/nano 40 manual mode
3 /usr/bin/vim.basic 30 manual mode
4 /usr/bin/vim.tiny 10 manual mode
Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in manual mode.
crontabのログ
Debian 6.0 (squeeze) での、cronのログ有効化
デフォルトではcronのログが出なくなっている。
/etc/rsyslog.conf
を編集して、cronのログ出力部分がコメントアウトされているのを解除。
cronを再起動。
# /etc/init.d/cron restart
Restarting periodic command scheduler: cron.