Real time PC setup for SUPER MICRO

CentOS5.4

root setting

Packages

Formatting and rebooting

security

user setting

repository

/etc/yum.repos.d/CentOS-Base.repoに

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

を追加

/etc/sudoersに

controls        ALL=(ALL)       NOPASSWD:ALL

を追加しておくと便利

gcc, g++ install

# yum install gcc

# yum install gcc-c++

lib

yum -y install readline-devel

yum -y install ncurses-devel.x86_64

yum update

# yum -y update

パッケージアップデーターを使っても同じことができる

再起動

RT linux installation

sudo chown -R root:root /opt

# make modules_install install

もしkernel panicで立ち上がらない時は、biosのIDEの設定をAHCIを疑うこと。AHCIはデフォルトでサポートされていないので、biosのIDEの設定をIDE/Compatibleにするとよい。kernelにAHCIモジュールを組み込むといいかもしれない(試していない)。

network card (NIC)が認識されていない場合

Rial timeでないkernelで立ち上げ直して、NICが認識されてから、intelのページにいって82575/6 and 82580 for Linuxドライバーをダウンロード

tar xvf igb-2.1.9.tar.gz
cd igb-2.1.9/src/
sudo make install
sudo /sbin/insmod /lib/modules/2.1.16-rtl/kernel/drivers/net/igb/igb.ko

で認識されるはず。

menuのsystem,Administration,Networkから確認、もしくは/sbin/ifconfigからも確認できる。

network setting

ネットワークはローカルなルーターを使い外にでないようにする。固定IPに設定。例えばシステム->管理->ネットワークからか、もしくは/etc/host/に

IP:192.168.11.2
subnet mask:255.255.255.0
Gateway:192.168.11.1
DNS:192.168.11.1

とホストに

IP:192.168.11.2
name:kami2

などと登録しないと、後にawgmantpが立ち上がらない。

いらないサービスを停める

システム->管理->サービスから

再起動

Delキーでbiosを立ち上げ不要なデバイスを停止する

Expansion Chassis

/sbin/lspci

こんなのが見えていたらOK。

GDS software Installation

cd /
sudo tar xvf cvs.tar.gz
chown controls:root /cvs

/etc/fstab

/etc/fstabを必要に応じて直す

/dev/sdb1               /frames                 ext3       defaults     1 1
rpc_pipefs              /var/lib/nfs/rpc_pipefs rpc_pipefs defaults     0 0

必要に応じて再起動

/frames

/frames以下を作成

sudo mkdir /frames
chown controls;root /frames

/frames以下はこのようなディレクトリ構造になるように、ディレクトリを作る

こんなスクリプトを書くと楽

所有者を変える

sudo chown controls:root /frames
sudo chown controls:controls /frames/*

/etc/rc.local に以下の行を加える

/opt/epics-3.14.10-RC2-i386/base/bin/linux-x86/caRepeater&
/opt/rtldk-2.2/rtlinuxpro/modules/rtcore&
sleep 5
/usr/bin/setup_shmem.rtl ctr&

Add EPICS libraries to all paths

/etc/ld.so.conf.d/にfileを4つ追加

epics-i386.conf

gds-i386.conf

epics-x86_64.conf

root-i386.conf

[controls@kami1 ld.so.conf.d]$ ls
epics-i386.conf    gds-i386.conf  qt-x86_64.conf
epics-x86_64.conf  qt-i386.conf   root-i386.conf

/etc/inittab に以下の行を加え、daqdとnsdのスタートアップとrespawnを指定する旨を追加する

# Frame Builder
fb:35:respawn:/cvs/cds/llo/target/fb/start_daqd.inittab
nds:35:respawn:/cvs/cds/llo/target/fb/start_nds.inittab

/etc/xinit.d にfileを3つ追加

diagconf

leapconf

chnconf

chmod 755 *conf

で実行権限を加える。

xinetd

yum install xinetd

システム->管理->サービスからxinetdが立ち上がっていることを確認し、「オンデマンドのサービス」タブで

がきちんと立ち上がっているか確認。

/etc/service

/etc/serviceに

diagconf  5355/udp

を追加

/etc/rpc

/etc/rpc に以下を追加

chnconf 822087685
leapconf 822087686

installation of gds

.bashrc or .cshrc

.bashrcを編集 .cshrcを編集

再起動、及びリアルタイムコードの開始

再起動後

startqts

medm //cvs/cds/llo/medm/l1/qts/L1QTS_GDS_TP.adl

でepicsが動いているか確認。

もし

libXm.so.4: cannot open shared object file: No such file or directory

と出る場合は

#yum -y install openmotif

もし、数値のところが真っ白なら

daqconfig

と打って、epicsのチャンネル名がきちんと表示されているか確認。仮に表示されていても、特に初回は一度保存するといい時がある。

数値は表示されるが、とまっている時は左下のBURT Restoreのところに1をいれる。

dataviewer

LibXpm

[controls@kami2 ~]$ dataviewer
/apps/Linux/dataviewer/dc3: error while loading shared libraries: libXpm.so.4: cannot open shared object file: No such file or directory

解決策

#yum -y install libXpm

hostname

[controls@kami2 ~]$ dataviewer
Can't find hostname `teststand0'
Can't find hostname `teststand0'; gethostbyname(); error=2
Warning: Not all children have same parent in XtManageChildren
Error in obtaining chan info.
Can't find hostname `teststand0'
Can't find hostname `teststand0'; gethostbyname(); error=2

解決策

/apps/Linux/dataviewer/dataviewer

のteststand0を自分のホスト名(例えばkami2)に変える。

site を変えたいとき

Construction of K1 model

rc.localでリアルタイムコードを自動的に立ち上げたいとき

rc.localに

su -l controls -c "/cvs/cds/kami/scriptis/startctr"

等と書く

sudo: sorry, you must have a tty to run sudo

とかログに出る場合は、 /etc/sudoers の「Defaults requiretty」行を消すなりコメントアウトする。ただし書き込み不可になっている /etc/sudoers のパーミッションを一度変更して編集しなくてはならないが、通常は文法エラーなどをチェックしてくれる /usr/sbin/visudo コマンドを使うのが普通。直接編集してミスがあるとヤバイ事になる。vi が嫌いなら環境変数 EDITOR で変更が可能。

Slow channelの登録

dataviewerの信号選択でslowの欄には最初何も現れない。masterに

/cvs/cds/kami/chans/daq/K1EDCU.ini

等と書いて、 /cvs/cds/kami/chans/daq/K1EDCU.ini を編集。

途中でIPアドレスを変えたくなったとき

ネットワーク設定から、アダプタのAddressのIPと右端のHostsのタブのIPを変更

/cvs/cds/xxx/target/gds/param/error.parを変更

その他トラブル

sudoでどんなコマンドを実行しても,Connection refusedが出る

# sudo pwd
audit_log_user_command(): Connection refused

解決策

最新版のsudoを取って来てコンパイルする

# wget http://www.sudo.ws/sudo/dist/sudo-1.7.2p5.tar.gz
# tar xvf sudo-1.7.2p5.tar.gz
# cd sudo-1.7.2p5
# ./configure
# make
# sudo make

その際pamがないといわれるのでpam-devel-0.99.6.2-6.el5_4.1.x86_64をインストール。

RPC

Starting RPC idmapd: FATAL: Module sunrpc not found.
FATAL: Error running install command for sunrpc
Error: RPC MTAB does not exist.

というエラーが出る。動作はしているようだ。

解決策

どうも/etc/fstabに以下のように書いておけばいいらしい。

rpc_pipefs              /var/lib/nfs/rpc_pipefs rpc_pipefs      defaults        0 0

ディスクレス起動の時はカーネルにnfsを静的に取り込んであるが、nfsのsunrpcをモジュールだと仮定してロードしようとするらしい。 詳しくはhttp://linux-nfs.org/pipermail/nfsv4/2005-July/002246.html

diag

diag -iコマンドで

[controls@kami2 ~]$ diag -i
Diagnostics configuration:
awg 0 0 192.168.11.2 822087682 1 192.168.11.2
tp 0 0 192.168.11.2 822087681 1 192.168.11.2

だけしか表示されない場合はxinetdが立ち上がっていない可能性が高い。diagguiやawgguiでチャンネル名がでない時もこれらが関連している可能性が高い。

/ets/servicesの最後に

diagconf  5355/udp

がきちんと書かれているかチェック

/etc/xinit.dのchnconf,leapconf,diagconfをチェック、とくに最初の行のservice chnconf等が書いていない場合がある

後は、ネットがきちんと外につながっているかfirefox等できちんとチェック

正しい場合は以下のようになる。

[controls@kami2 ~]$ diag -i
Diagnostics configuration:
awg * 0 cobox0 5000 * 192.168.11.2
awg * 1 cobox0 5001 * 192.168.11.2
awg * 2 cobox1 5000 * 192.168.11.2
awg * 3 cobox1 5001 * 192.168.11.2
awg 0 0 192.168.11.2 822087682 1 192.168.11.2
chn * * 192.168.11.2 822087685 1 192.168.11.2
err 0 * 192.168.11.2 5353 * 192.168.11.2
err 1 * 192.168.11.2 5353 * 192.168.11.2
leap * * 192.168.11.2 822087686 1 192.168.11.2
nds * * 192.168.11.2 8088 * 192.168.11.2
ntp * * ntpServer * * 192.168.11.2
tp 0 0 192.168.11.2 822087681 1 192.168.11.2
tst * * gdsdmt 5354 * 192.168.11.2

dataviewerなどでchannel名が出てこない

daqdが走っていない

/cvs/cds/kami/target/fb/start_daqd.inittab

と打って、直接daqdを立ち上げてやるといい。

過去のDAQ dataが見えない

チャンネル名等も全部見えて、リアルタイムのデータはdataviewer等で見えるのに、過去のデータが見えない時は/cvs/cds/kami/target/fbにjobsというディレクトリがあるかどうか確認すること。とくに、/cvs/cds/kami/target/fb/daqd.logに以下のようなメッセージが残されている場合は、jobsを作るとかこのデータまで見えるようになる。

[Thu Apr  8 17:55:09 2010] /cvs/cds/kami/target/fb/jobs/1270716909: NDS job spec
 file open failed

もしくはNDSが走っていない場合がある

[controls@kami1 ~]$ ps -ef | grep nds
controls  7067  7025  0 08:53 pts/5    00:00:00 /cvs/cds/kami/target/fb/nds /cvs/cds/kami/target/fb/pipe
controls 13284 13201  0 09:14 pts/8    00:00:00 grep nds

とならない場合は、

/cvs/cds/kami/target/fb/start_nds.inittab

と打って、直接NDSを立ち上げてやるといい。

medm でfontがないと怒られる

Reference manualに解決策が書いてある。font pathは/usr/share/X11/fonts/miscだった。

Aliased Fonts in X Windows

Copy the following lines into your miscellaneous fonts.alias file. Beware that if you are in Windows then this may introduce CR-LF’s, which must be converted to LF’s.   The standard place is /usr/lib/X11/fonts/misc/fonts.alias.  You can get your own particular font path from “xset q”. Note that these specifications are the standard MEDM font specifications as used at the Advanced Photon Source, but you are free to define another set of font specifications that gives better results for your machine or your own preferences.  Keep in mind that displays may not look good if the fonts used are significantly different from those used by the designer of the display.

widgetDM_4   -misc-fixed-medium-r-normal--8-60-100-100-c-50-iso8859-1
widgetDM_6   -misc-fixed-medium-r-normal--8-60-100-100-c-50-iso8859-1
widgetDM_8   -misc-fixed-medium-r-normal--9-80-100-100-c-60-iso8859-1
widgetDM_10  -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
widgetDM_12  -misc-fixed-medium-r-normal--13-100-100-100-c-70-iso8859-1
widgetDM_14  -misc-fixed-medium-r-normal--14-110-100-100-c-70-iso8859-1
widgetDM_16  -misc-fixed-medium-r-normal--15-120-100-100-c-90-iso8859-1
widgetDM_18  -sony-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1
widgetDM_20  -misc-fixed-medium-r-normal--20-140-100-100-c-100-iso8859-1
widgetDM_22  -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1
widgetDM_24  -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1
widgetDM_30  -adobe-times-medium-r-normal--25-180-100-100-p-125-iso8859-1
widgetDM_36  -adobe-helvetica-medium-r-normal--34-240-100-100-p-176-iso8859-1
widgetDM_40  -adobe-helvetica-bold-r-normal--34-240-100-100-p-182-iso8859-1
widgetDM_48  -adobe-helvetica-bold-r-normal--34-240-100-100-p-182-iso8859-1
widgetDM_60  -adobe-helvetica-bold-r-normal--34-240-100-100-p-182-iso8859-1

Then run “xset fp rehash” to install them.  On Linux you may need to run “/etc/init.d/xfs restart” to restart the X font server.  You can see if the fonts are there with “xlsfonts” or “xlsfonts | grep widgetDM”.  You can get more information from any of the general-purpose books on X Windows.