LANDISKのdebian化(改)
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
*chroot-debian環境の構築 [#o9c16ea6]
-''debian化の方針''~
debian化の方針を次に記します。
--LANDISKのオリジナル環境は一切変更しない。~
LANDISKのルートファイルシステムをrwで再マウントすることな...
--debianディストリビューションをchrootの環境に構築~
debian環境で作業しながら、NAS(LANDISK)としても使用できま...
--データ領域の共有化~
LANDISKの/mnt/hda3/shareディレクトリは、debian環境からは/...
当然ながら、ネットワークで接続されたWindowsやMac等からも/...
-''ベースパッケージの取得および解凍''~
/mnt/hda3/debian以下にdebianのシステムをフルインストール...
http://eggplant.ddo.jp/www/download/debian/DEBIAN_K/base-...
を持ってきて以下のように解凍する。
# mkdir /mnt/hda3/debian
# cd /mnt/hda3/debian
# tar vxfz どこかの/base-sh4-020728kai.tar.gz
ネットワーク関連のファイルをLANDISK環境からコピーします。~
# cp /etc/hosts /mnt/hda3/debian/etc/
# cp /etc/resolv.conf /mnt/hda3/debian/etc/
# hostname > /mnt/hda3/debian/etc/hostname
-''debian環境の起動・終了スクリプトの作成と実行''~
--起動スクリプト(debian_start)~
/mnt/hda3/debian_startを以下の内容で作成します。~
#pre{{
#!/bin/sh
root=/mnt/hda3/debian
if [ ! -e $root/proc/cpuinfo ]; then
$root/usr/sbin/chroot $root mount -t proc proc /proc
fi
if [ ! -e $root/share/disk ]; then
mount --bind /mnt/hda3/share $root/share
fi
/etc/rc.d/init.d/S95httpd stop
sleep 1;
$root/usr/sbin/chroot $root /etc/init.d/mysql restart
$root/usr/sbin/chroot $root /etc/init.d/apache restart
$root/usr/sbin/chroot $root /etc/init.d/cron restart
$root/usr/sbin/chroot $root /etc/init.d/xdm restart
$root/usr/sbin/chroot $root /bin/bash -l
}}
--終了スクリプト(debian_stop)~
/mnt/hda3/debian_stopを以下の内容で作成します。~
#pre{{
#!/bin/sh
root=/mnt/hda3/debian
PATH=$PATH:/usr/local/bin
export PATH
$root/usr/sbin/chroot $root /etc/init.d/xdm stop
$root/usr/sbin/chroot $root /etc/init.d/cron stop
$root/usr/sbin/chroot $root /etc/init.d/apache stop
$root/usr/sbin/chroot $root /etc/init.d/mysql stop
killall -HUP debian_start
sleep 1;
umount $root/proc
umount $root/share
}}
--debian環境の起動(終了)~
それぞれのスクリプトに実行属性をセットし。
# chmod +x /mnt/hda3/debian_start
# chmod +x /mnt/hda3/debian_stop
次のコマンドでLANDISK環境からdebian環境へ移行します。
# /mnt/hda3/debian_start
landisk:/#
ちなみにdebian環境からLANDISK環境へ復帰するには次のように...
landisk:/# exit
# /mnt/hda3/debian_stop
-&color(red){''パッケージ管理ツールapt-get(1/9修正)''};~
base-sh4-020728kai.tar.gzの設定のままではapt-getが正常に...
これは最近、debianサイトにおいて、サーバ構成が変更された...
したがって、/etc/apt/sources.listの次の行を現サーバ構成に...
#deb-src http://ftp.jp.debian.org/debian/ sid main non-f...
deb-src http://ftp.debian.org/debian/ sid main non-free ...
~
その後、次のコマンドで最新のパッケージリストを取得します。~
landisk:/# apt-get update
apt-getの動作検証もかね、いくつかの定番ツールをインストー...
landisk:/# apt-get install less wget rpm 等。。。
~
*Xvncでxserver [#x77c3744]
-''X Window Systemの導入''~
MS-WindowsやMac上のVNCクライアントから、xdmログインできる...
--インストール~
apt-getで一気に入れてしまいます。~
途中でで"Fatal error"が出るかもしれませんが、~
インストールは続行されますので気にしないことにします。
#pre{{
landisk:/# apt-get install x-window-system xfonts-a12k12 ...
}}
--/root/.xsession~
X Windowが立ち上がる時、最初に実行されるファイルです。
ウィンドウマネージャやアプリケーションの起動を行います。~
以下の内容で作成します。(お好みに応じて変更してください。)~
#pre{{
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/s...
export PATH
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Deskt...
exec twm
}}
--/root/.Xresources~
これは各種アプリケーションの設定を記述するファイルです。~
お好みに応じて設定してください。
本例ではxtermの背景色と文字色を指定しています。~
#pre{{
XTerm.vt100.foreground: black
XTerm.vt100.background: white
}}
--/root/.twmrc~
ウィンドウマネージャーtwmの設定ファイルです。~
メニューからxterm等を起動できるように変更を加えます。~
/etc/X11/twm/system.twmrc-menuをコピーして、~
#pre{{
landisk:/# cd /root
landisk:~# cp /etc/X11/twm/system.twmrc-menu .twmrc
}}
以下のメニュー設定部を変更します。
#pre{{
&color(orange){70行目付近};
#
# And a menus with the usual things
#
menu "main"
{
"Main Menu" f.title
"Debian" f.menu "/Debian"
&color(red){ "xterm" f.exec "xterm -sb -ls &"};
&color(red){ "kterm" f.exec "kterm -sb -ls &"};
&color(red){ "emacs" f.exec "emacs &"};
&color(red){ "xcalc" f.exec "xcalc &"};
"" f.nop
"Show Icon Manager" f.showiconmgr
"Hide Icon Manager" f.hideiconmgr
"" f.nop
"Exit" f.menu "Quit-Verify"
}
}}
-''xdmとXvncの連携''~
vncクライアントからxdm経由でログインできるように設定しま...
--debian環境のrootパスワード設定~
ルートアカウントでxdmログインするには、パスワード必要とな...
#pre{{
landisk:~# passwd
Enter new UNIX password: &color(red){←パスワード入力};
Retype new UNIX password: &color(red){←再度入力};
passwd: password updated successfully
landisk:~#
}}
--/etc/X11/xdm/Xservers の最下行を次のように変更します。~
#pre{{
#:0 local /usr/X11R6/bin/X vt7 -dpi 100 -nolisten tcp
:0 local /usr/bin/Xrealvnc -geometry 1024x768 -depth 16
}}
--xdmを起動します。
#pre{{
landisk:/# /etc/init.d/xdm restart
Starting X display manager: xdm.
}}
--vncクライアントから接続します。~
WindowsやMac上のvncクライアントから接続します。~
通常は、"IPアドレス:DISPLAY番号"で接続しますが、~
xdm経由で接続する場合は、IPアドレスだけを入力します。~
~
&ref(vnc-xdm1.jpg,nolink);~
~
&ref(vnc-xdm2.jpg,nolink);~
~
debian環境のアカウントでログインできます。~
ただし、rootの場合はパスワード未設定だとログインできない...
~
--その他~
/mnt/hda3/debian_startを次のように変更すると、~
直接xdmからログインできるようになって便利かもしれません。
#pre{{
$root/usr/sbin/chroot $root /etc/init.d/xdm restart
}}
*補足事項 [#e89d5d02]
-''base-sh4-020728.tar.gzとbase-sh4-020728kai.tar.gzの相...
base-sh4-020728kai.tar.gzは、base-sh4-020728.tar.gzに対し...
変更を加えています。~
ご参考まで。~
-- mkdir /share ... /shareディレクトリの作成
-- chmod 1777 /tmp ... /tmpディレクトリのパーミッション設定
-- ln -fs /proc/mounts /etc/mtab
-- タイムゾーン設定(Asia/Tokyo/UTC=no)
-- aptの設定
---/etc/apt/sources.list
deb http://eggplant.ddo.jp/www/download/debian/ ./
deb http://debian.dodes.org/debian sid main non-free con...
deb-src http://ftp.jp.debian.org/debian/ sid main non-fr...
deb-src http://non-us.debian.org/debian-non-US sid/non-U...
---/etc/apt/preferences~
debian.dodes.orgのMySQLは動かない。かつ~
それ以前のバージョン(MySQL3.23.49)を使用したかったため。~
#pre{{
Package: mysql-common
Pin: version 3.23.49*
Pin-Priority: 1001
Package: mysql-client
Pin: version 3.23.49*
Pin-Priority: 1001
Package: mysql-server
Pin: version 3.23.49*
Pin-Priority: 1001
Package: libmysqlclient10
Pin: version 3.23.49*
Pin-Priority: 1001
Package: libmysqlclient10-dev
Pin: version 3.23.49*
Pin-Priority: 1001
}}
--パッケージの置き換え・追加~
---&color(red){libpam-runtime 0.76-22};
---&color(red){libpam0g 0.76-22};
---&color(red){libgcc1 1:3.3.4-7};
---libc6 2.2.5-14
---&color(red){libpam-modules 0.76-22};
---&color(red){login 1:4.0.3-30};
---&color(red){passwd 1:4.0.3-30};
---&color(red){bash 2.05b-23};
---&color(red){findutils 4.1.20-5};
---&color(red){libncurses5 5.4-4};
---&color(red){ncurses-bin 5.4-4};
---&color(red){perl-base 5.8.4-2};
---&color(red){sed 4.1.1-1};
---&color(red){ncurses-base 5.4-4};
---&color(red){slang1 1.4.9dbs-8};
---&color(red){libpcre3 4.5-1.1};
---&color(red){info 4.7-2};
---libdb3 3.2.9-17
---base-passwd 3.4.2
---libdb2 2:2.7.7.0-8
---mawk 1.3.3-9
---bsdmainutils 5.20020211-7
---libldap2 2.0.23-9
---exim 3.36-3
---logrotate 3.6.5-1
---mailx 1:8.1.2-0.20020411cvs-4
---man-db 2.4.0-10
---nano 1.1.11-1
---libreadline4 4.3-4
---modutils 2.4.19-3
---gettext-base 0.11.5-1
---libwrap0 7.6-ipv6.1-3
---tcpd 7.6-ipv6.1-3
---telnet 0.17-19
---dhcp-client 2.0pl5-14
---pppoe 3.3-1.2
---dialog 0.9b-20020814-1 <--Apache インストール不具合対...
---&color(red){/usr/sbin/lpc}; <-- X Window Systemインス...
-
という構成になっています。~
ちなみに"kai"は、改悪を意味するかもしれません。汗~
#counter
終了行:
*chroot-debian環境の構築 [#o9c16ea6]
-''debian化の方針''~
debian化の方針を次に記します。
--LANDISKのオリジナル環境は一切変更しない。~
LANDISKのルートファイルシステムをrwで再マウントすることな...
--debianディストリビューションをchrootの環境に構築~
debian環境で作業しながら、NAS(LANDISK)としても使用できま...
--データ領域の共有化~
LANDISKの/mnt/hda3/shareディレクトリは、debian環境からは/...
当然ながら、ネットワークで接続されたWindowsやMac等からも/...
-''ベースパッケージの取得および解凍''~
/mnt/hda3/debian以下にdebianのシステムをフルインストール...
http://eggplant.ddo.jp/www/download/debian/DEBIAN_K/base-...
を持ってきて以下のように解凍する。
# mkdir /mnt/hda3/debian
# cd /mnt/hda3/debian
# tar vxfz どこかの/base-sh4-020728kai.tar.gz
ネットワーク関連のファイルをLANDISK環境からコピーします。~
# cp /etc/hosts /mnt/hda3/debian/etc/
# cp /etc/resolv.conf /mnt/hda3/debian/etc/
# hostname > /mnt/hda3/debian/etc/hostname
-''debian環境の起動・終了スクリプトの作成と実行''~
--起動スクリプト(debian_start)~
/mnt/hda3/debian_startを以下の内容で作成します。~
#pre{{
#!/bin/sh
root=/mnt/hda3/debian
if [ ! -e $root/proc/cpuinfo ]; then
$root/usr/sbin/chroot $root mount -t proc proc /proc
fi
if [ ! -e $root/share/disk ]; then
mount --bind /mnt/hda3/share $root/share
fi
/etc/rc.d/init.d/S95httpd stop
sleep 1;
$root/usr/sbin/chroot $root /etc/init.d/mysql restart
$root/usr/sbin/chroot $root /etc/init.d/apache restart
$root/usr/sbin/chroot $root /etc/init.d/cron restart
$root/usr/sbin/chroot $root /etc/init.d/xdm restart
$root/usr/sbin/chroot $root /bin/bash -l
}}
--終了スクリプト(debian_stop)~
/mnt/hda3/debian_stopを以下の内容で作成します。~
#pre{{
#!/bin/sh
root=/mnt/hda3/debian
PATH=$PATH:/usr/local/bin
export PATH
$root/usr/sbin/chroot $root /etc/init.d/xdm stop
$root/usr/sbin/chroot $root /etc/init.d/cron stop
$root/usr/sbin/chroot $root /etc/init.d/apache stop
$root/usr/sbin/chroot $root /etc/init.d/mysql stop
killall -HUP debian_start
sleep 1;
umount $root/proc
umount $root/share
}}
--debian環境の起動(終了)~
それぞれのスクリプトに実行属性をセットし。
# chmod +x /mnt/hda3/debian_start
# chmod +x /mnt/hda3/debian_stop
次のコマンドでLANDISK環境からdebian環境へ移行します。
# /mnt/hda3/debian_start
landisk:/#
ちなみにdebian環境からLANDISK環境へ復帰するには次のように...
landisk:/# exit
# /mnt/hda3/debian_stop
-&color(red){''パッケージ管理ツールapt-get(1/9修正)''};~
base-sh4-020728kai.tar.gzの設定のままではapt-getが正常に...
これは最近、debianサイトにおいて、サーバ構成が変更された...
したがって、/etc/apt/sources.listの次の行を現サーバ構成に...
#deb-src http://ftp.jp.debian.org/debian/ sid main non-f...
deb-src http://ftp.debian.org/debian/ sid main non-free ...
~
その後、次のコマンドで最新のパッケージリストを取得します。~
landisk:/# apt-get update
apt-getの動作検証もかね、いくつかの定番ツールをインストー...
landisk:/# apt-get install less wget rpm 等。。。
~
*Xvncでxserver [#x77c3744]
-''X Window Systemの導入''~
MS-WindowsやMac上のVNCクライアントから、xdmログインできる...
--インストール~
apt-getで一気に入れてしまいます。~
途中でで"Fatal error"が出るかもしれませんが、~
インストールは続行されますので気にしないことにします。
#pre{{
landisk:/# apt-get install x-window-system xfonts-a12k12 ...
}}
--/root/.xsession~
X Windowが立ち上がる時、最初に実行されるファイルです。
ウィンドウマネージャやアプリケーションの起動を行います。~
以下の内容で作成します。(お好みに応じて変更してください。)~
#pre{{
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/s...
export PATH
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Deskt...
exec twm
}}
--/root/.Xresources~
これは各種アプリケーションの設定を記述するファイルです。~
お好みに応じて設定してください。
本例ではxtermの背景色と文字色を指定しています。~
#pre{{
XTerm.vt100.foreground: black
XTerm.vt100.background: white
}}
--/root/.twmrc~
ウィンドウマネージャーtwmの設定ファイルです。~
メニューからxterm等を起動できるように変更を加えます。~
/etc/X11/twm/system.twmrc-menuをコピーして、~
#pre{{
landisk:/# cd /root
landisk:~# cp /etc/X11/twm/system.twmrc-menu .twmrc
}}
以下のメニュー設定部を変更します。
#pre{{
&color(orange){70行目付近};
#
# And a menus with the usual things
#
menu "main"
{
"Main Menu" f.title
"Debian" f.menu "/Debian"
&color(red){ "xterm" f.exec "xterm -sb -ls &"};
&color(red){ "kterm" f.exec "kterm -sb -ls &"};
&color(red){ "emacs" f.exec "emacs &"};
&color(red){ "xcalc" f.exec "xcalc &"};
"" f.nop
"Show Icon Manager" f.showiconmgr
"Hide Icon Manager" f.hideiconmgr
"" f.nop
"Exit" f.menu "Quit-Verify"
}
}}
-''xdmとXvncの連携''~
vncクライアントからxdm経由でログインできるように設定しま...
--debian環境のrootパスワード設定~
ルートアカウントでxdmログインするには、パスワード必要とな...
#pre{{
landisk:~# passwd
Enter new UNIX password: &color(red){←パスワード入力};
Retype new UNIX password: &color(red){←再度入力};
passwd: password updated successfully
landisk:~#
}}
--/etc/X11/xdm/Xservers の最下行を次のように変更します。~
#pre{{
#:0 local /usr/X11R6/bin/X vt7 -dpi 100 -nolisten tcp
:0 local /usr/bin/Xrealvnc -geometry 1024x768 -depth 16
}}
--xdmを起動します。
#pre{{
landisk:/# /etc/init.d/xdm restart
Starting X display manager: xdm.
}}
--vncクライアントから接続します。~
WindowsやMac上のvncクライアントから接続します。~
通常は、"IPアドレス:DISPLAY番号"で接続しますが、~
xdm経由で接続する場合は、IPアドレスだけを入力します。~
~
&ref(vnc-xdm1.jpg,nolink);~
~
&ref(vnc-xdm2.jpg,nolink);~
~
debian環境のアカウントでログインできます。~
ただし、rootの場合はパスワード未設定だとログインできない...
~
--その他~
/mnt/hda3/debian_startを次のように変更すると、~
直接xdmからログインできるようになって便利かもしれません。
#pre{{
$root/usr/sbin/chroot $root /etc/init.d/xdm restart
}}
*補足事項 [#e89d5d02]
-''base-sh4-020728.tar.gzとbase-sh4-020728kai.tar.gzの相...
base-sh4-020728kai.tar.gzは、base-sh4-020728.tar.gzに対し...
変更を加えています。~
ご参考まで。~
-- mkdir /share ... /shareディレクトリの作成
-- chmod 1777 /tmp ... /tmpディレクトリのパーミッション設定
-- ln -fs /proc/mounts /etc/mtab
-- タイムゾーン設定(Asia/Tokyo/UTC=no)
-- aptの設定
---/etc/apt/sources.list
deb http://eggplant.ddo.jp/www/download/debian/ ./
deb http://debian.dodes.org/debian sid main non-free con...
deb-src http://ftp.jp.debian.org/debian/ sid main non-fr...
deb-src http://non-us.debian.org/debian-non-US sid/non-U...
---/etc/apt/preferences~
debian.dodes.orgのMySQLは動かない。かつ~
それ以前のバージョン(MySQL3.23.49)を使用したかったため。~
#pre{{
Package: mysql-common
Pin: version 3.23.49*
Pin-Priority: 1001
Package: mysql-client
Pin: version 3.23.49*
Pin-Priority: 1001
Package: mysql-server
Pin: version 3.23.49*
Pin-Priority: 1001
Package: libmysqlclient10
Pin: version 3.23.49*
Pin-Priority: 1001
Package: libmysqlclient10-dev
Pin: version 3.23.49*
Pin-Priority: 1001
}}
--パッケージの置き換え・追加~
---&color(red){libpam-runtime 0.76-22};
---&color(red){libpam0g 0.76-22};
---&color(red){libgcc1 1:3.3.4-7};
---libc6 2.2.5-14
---&color(red){libpam-modules 0.76-22};
---&color(red){login 1:4.0.3-30};
---&color(red){passwd 1:4.0.3-30};
---&color(red){bash 2.05b-23};
---&color(red){findutils 4.1.20-5};
---&color(red){libncurses5 5.4-4};
---&color(red){ncurses-bin 5.4-4};
---&color(red){perl-base 5.8.4-2};
---&color(red){sed 4.1.1-1};
---&color(red){ncurses-base 5.4-4};
---&color(red){slang1 1.4.9dbs-8};
---&color(red){libpcre3 4.5-1.1};
---&color(red){info 4.7-2};
---libdb3 3.2.9-17
---base-passwd 3.4.2
---libdb2 2:2.7.7.0-8
---mawk 1.3.3-9
---bsdmainutils 5.20020211-7
---libldap2 2.0.23-9
---exim 3.36-3
---logrotate 3.6.5-1
---mailx 1:8.1.2-0.20020411cvs-4
---man-db 2.4.0-10
---nano 1.1.11-1
---libreadline4 4.3-4
---modutils 2.4.19-3
---gettext-base 0.11.5-1
---libwrap0 7.6-ipv6.1-3
---tcpd 7.6-ipv6.1-3
---telnet 0.17-19
---dhcp-client 2.0pl5-14
---pppoe 3.3-1.2
---dialog 0.9b-20020814-1 <--Apache インストール不具合対...
---&color(red){/usr/sbin/lpc}; <-- X Window Systemインス...
-
という構成になっています。~
ちなみに"kai"は、改悪を意味するかもしれません。汗~
#counter
ページ名: