电竞比分网-中国电竞赛事及体育赛事平台

分享

計(jì)算機(jī)硬件知識(shí)——故障解析(七)SUN Solaris常見問題集錦

 寧民 2011-04-18

SUN Solaris常見問題集錦

1. Q: Solaris 的系統(tǒng)配置文件一般在什么地方?

A: 可以查看/etc/system文件,里面有一些solaris啟動(dòng)時(shí)默認(rèn)加載的選項(xiàng),包括

共享內(nèi)存大小等的設(shè)置。

2. Q: 在solaris中,用戶默認(rèn)的Shell在什么文件中規(guī)定?

A: 可以查看/etc/passwd中,用戶默認(rèn)的shell在這里規(guī)定。

3. Q: 如果solaris不幸忘記了root密碼,如何解決?

A: 可以有如下兩種情況

1. 工作站只有root用戶,無(wú)其他用戶。

2. 工作站除了root用戶以外,還有其他的用戶

1. 如果連接了網(wǎng)絡(luò),我們可以采用遠(yuǎn)程緩沖溢出的方法,但是這樣的方法不屬

于“經(jīng)典”方法,且有的遠(yuǎn)程緩沖溢出具有一定的破壞性,不建議使用。還

有一種方法就是采用SUN公司自帶的光盤采取引導(dǎo),建議采取這種方法:

1. boot cdrom -s

2. fsck /dev/dsk/c0t0d0s0 (取決于根分區(qū)的設(shè)備)

3. mount -F ufs /dev/dsk/c0t0d0s0 /mnt

4. TERM=ansi; export TERM

5. 編輯/mnt/etc shadow文件,把root對(duì)應(yīng)的口令去掉。

6. 重啟后的root的口令為空。

2. 如果還有普通用戶,方法可以采用本地緩沖溢出,這種方法雖然破壞性小,

但是也有損毀硬盤引導(dǎo)區(qū)的危險(xiǎn),建議采用“文件連接”錯(cuò)誤是獲得root權(quán)

限,這種方法沒有什么危險(xiǎn)性。

4. Q: 有時(shí)候用vi編輯器的時(shí)候,顯示窗口過(guò)大,如何處理?

A: 只需要用鼠標(biāo)拖曳終端窗口,使其縮小,即可解決。

5. Q: 共享內(nèi)存大小如何設(shè)置?

A: 在system文件的最后一行加入Set shmsys:shminfo_shmmax=XXX

/etc/set shmsys:shminfo_shmmin=XXX

這里的XXX是代表共享內(nèi)存的大小。單位:字節(jié)

共享內(nèi)存一般為內(nèi)存的一半

例如內(nèi)存為512M

設(shè)置應(yīng)為512/2*1024*1000=262144000

6. Q: root用戶的配置文件在什么地方?

A: root用戶的配置文件和其他用戶的配置文件有些不同,它在/etc/profile文件

中規(guī)定。

7. Q: SUN solaris 在遠(yuǎn)程X-win pro下無(wú)法以root進(jìn)行登陸,如何解決?

A: 直接以root在終端上登錄的時(shí)候,執(zhí)行/etc/default/login腳本。在這個(gè)腳本

中限制了在遠(yuǎn)程終端上不能直接以用戶root登錄,如果想這樣,修改此腳本,

將下面這一行注釋掉即可

CONSOLE=/dev/console

8. Q: 在solaris下,如何查看網(wǎng)絡(luò)是否配置成功?

A: 可以采用命令I(lǐng)fconfig -a來(lái)查看,如果網(wǎng)卡綁定ip成功,而不是顯示0.0.0.0

就證明網(wǎng)卡配置基本無(wú)誤,主要檢查網(wǎng)絡(luò)介質(zhì)(網(wǎng)線,RJ45插頭...)是否損壞。

9. Q: 如果敲錯(cuò)一個(gè)命令如何結(jié)束它呢?

A: solaris和SCO有少許不一樣,solaris可以采用ctrl+C來(lái)結(jié)束,而不是SCO的

ctrl+Del

10.Q: solaris的聯(lián)網(wǎng)中,網(wǎng)關(guān)如何配置?

A: solaris的網(wǎng)關(guān)設(shè)置和SCO的設(shè)置不一樣

SCO:

/etc/gateways

name1 gateway name2 metric values

所有中間的很長(zhǎng)的空均為TAB

Net,host 表示路由指向是網(wǎng)絡(luò)還是主機(jī),net和host是關(guān)鍵字

Name1 目的網(wǎng)絡(luò)名或主機(jī)名

Gateway 關(guān)鍵字

Name2 網(wǎng)關(guān)名或網(wǎng)關(guān)ip地址

Metric 關(guān)鍵字

values 跳數(shù)

Passive 關(guān)鍵字,表示被動(dòng)方式,路由器不叫換路由信息

Active 關(guān)鍵字,表示主動(dòng)方式,路由器交換路由信息

External 關(guān)鍵字,表示外部方式,其他進(jìn)程已安裝了路由

例如:

net 129.9 gateways 129.6.0.1 metric 1 passive

host 129.7.10.21 gateway 129.6.0.2 metric 1 passive

Solaris

為defautrouter,只需要在里面填入網(wǎng)關(guān)。

11.Q: 如何在網(wǎng)上安裝Solaris?

A: 假設(shè)SERVER IP為10.11.41.10,hostname為inssvr;CLIENT IP為10.11.41.11

,hostname為inscli。

在SERVER端執(zhí)行以下步驟

條件:有340M的剩余空間

1. 將Solaris 2.6的安裝盤插入CD-ROM

2. 將Solaris 2.6 CD-ROM的slice 0拷貝到硬盤

# cd /cdrom/sol_2_6_sparc_smcc_svr/s0/solaris_2.6/Tools

# ./setup_install_server /export/install

3. 編輯文件/export/autocfg/sysidcfg,以下是它的內(nèi)容

#Sample sysidcfg file for SPARC systems

system_locale=en_US

timezone=GMT-8

timeserver=10.11.41.10

terminal=dtterm

name_service=NONE

root_password=...(取自/etc/shadow文件)

4. 編輯文件/etc/hosts,以下是它的內(nèi)容

10.11.41.10 inssvr loghost

10.11.41.11 inscli

5. 增加安裝客戶

# cd /export/install

#./add_install_client -e CLIENT的以太網(wǎng)地址 -i CLIENT的IP地址 -s inssvr:/export/install -c inssvr:/export/autocfg -p inssvr:/export/autocfg inscli sun4u

在CLIENT端的OK提示符下執(zhí)行

OK boot net - install

Solaris 7 for sparc與2.6的區(qū)別,7沒有默認(rèn)的sysidcfg和autocfg目錄,需要自

己建立,而且OK boot net即可

12.Q: DHCP in Solaris8?

A: 1. # touch /etc/dhcp.hme0,hme0:請(qǐng)用相應(yīng)的網(wǎng)卡設(shè)備名;

2. 修改/etc/init.d/network,/etc/init.d/inetsvc

先備份

# cp /etc/init.d/network /etc/init.d/network.org

# cp /etc/init.d/inetsvc /etc/init.d/inetsvc.org

修改/etc/init.d/network第278行:

"dhcp") #hostname=`/sbin/dhcpinfo Hostname`

hostname=`cat /etc/nodename`

修改/etc/init.d/inetsvc第168行:

hostname=`/sbin/dhcpinfo Hostname`

if [ -z "$hostname" ]; then

#hostname="unknown"

hostname=`cat /etc/nodename`

fi

修改/etc/init.d/inetsvc第82行:

if [ "$_INIT_NET_STRATEGY" = "dhcp" ]; then

#dnsdomain=`/sbin/dhcpinfo DNSdmain`

dnsdomain=`cat /etc/defaultdomain`

else

dnsdomain=

fi

if [ -n "$dnsdomain" ]; then

#dnsservers=`/sbin/dhcpinfo DNSserv`

dnsservers=`cat /etc/dnsservers`

修改/etc/init.d/inetsvc第220行:

/usr/bin/mv /tmp/hosts_clear.$$ /tmp/hosts.$$

mydomain=`cat /etc/defaultdomain`

echo "${ipaddr}\t${hostname}\t${hostname}.${mydomain}\t# Added by DHCP" >>/tmp/hosts.$$

在/etc/init.d/inetsvc第一行加入如下語(yǔ)句:

if [ -f /etc/dhcp.*[0-9] ]; then

_INIT_NET_STRATEGY="dhcp"

export _INIT_NET_STRATEGY

fi

3. 創(chuàng)建/etc/defaultdomain,內(nèi)容為huawei.com.cn

4. 創(chuàng)建/etc/nodename,內(nèi)容為你的機(jī)器名

5. 創(chuàng)建/etc/dnsservers:129.9.111.100 10.15.1.3

之所以要修改,究其原因我們的DHCP服務(wù)器支持的協(xié)議可能比較老,不能返回給

客戶端DNSdomain,DNSServer,Nodename;

13. Q:SUN上如何編譯動(dòng)態(tài)庫(kù)?

A:

CC=cc

C++=CC +w

.SUFFIXES:.cpp

.cpp.o:

$(C++) -g -c -Kpic $<

liberrlog.so:ErrLog.o

ld -o liberrlog.so -G ErrLog.o

14. Q: 在sun工作站上安裝solaris軟件時(shí)沒有安裝網(wǎng)卡,安裝完成后應(yīng)該修改那些文

件添加網(wǎng)卡?

A:

1. #reboot --r 或者ok boot -r

2. 在1.成功找到你新加的硬件之后,再執(zhí)行相應(yīng)的硬件設(shè)置命令,對(duì)網(wǎng)卡執(zhí)行:

ifconfig hme0[ipmask],其中hme0是你網(wǎng)卡的設(shè)備名,可以通過(guò)dmesg知

道你的網(wǎng)卡設(shè)備名.

15. Q: 如何設(shè)置DNS?

A: (1)/etc/nsswitch.conf的hosts解析加上nis或/和dns,內(nèi)容如下

hosts: files dns

(2)設(shè)置到DNS服務(wù)器網(wǎng)關(guān)于/etc/defaultrouter,內(nèi)容如下

10.11.43.254

(3)設(shè)置DNS服務(wù)器的IP地址/etc/resolv.conf,內(nèi)容如下

nameserver 10.15.1.3

nameserver 129.9.111.100

domain huawei.com

16. Q: Ultra60工作站從外掛光驅(qū)啟動(dòng)?

A: Ultra60 工作站缺省配置是內(nèi)置光驅(qū),用外掛光驅(qū)重新安裝Solars時(shí),用boot

cdrom命令則不能從光驅(qū)啟動(dòng),屏幕上打印錯(cuò)誤信息:Drive not found.

原因如下:由于Ultra60工作站缺省支持內(nèi)置光驅(qū),cdrom的缺省配置是內(nèi)置光

驅(qū)的物理設(shè)備名。當(dāng)使用外掛光驅(qū)時(shí),當(dāng)使用boot cdrom命令時(shí),cdrom的替

換為內(nèi)置光驅(qū)的物理設(shè)備名。這就是不能從光驅(qū)啟動(dòng)的原因。

解決辦法如下:

(1)stop+a命令

(2)在ok提示符下輸入:probe-scsi-all

則出現(xiàn)硬盤、光驅(qū)、磁帶機(jī)等設(shè)備的實(shí)際物理名。

如:/pci@1f,4000/scsi@3,1

cdrom

(3)在ok提示符下輸入:devalias

則出現(xiàn)硬盤、光驅(qū)、磁帶機(jī)等設(shè)備的缺省設(shè)置。

如:cdrom /pci@1f,4000/scsi@3/disk6,0:f

這是缺省配置,用boot cdorm命令時(shí),cdrom被解釋為

/pci@1f,4000/scsi@3/disk6,0:f

而/pci@1f,4000/scsi@3/disk6,0:f指示的是內(nèi)置光驅(qū)的設(shè)備名,

因此不能從外掛光驅(qū)啟動(dòng)!

(4)在ok提示符下輸入:boot /pci@1f,4000/scsi@3,1/disk6,0:f

說(shuō)明:[boot后的參數(shù)參看(2)和(3)中的cdrom的設(shè)備名,由兩者組合而來(lái)

即可正確的從外掛光驅(qū)啟動(dòng)。

17. Q: 一臺(tái)Sun Ultra80工作站安裝SunOS 5.6失敗,請(qǐng)問其原因以及如何避免?

A: 硬件環(huán)境為Ultra-80/2CPU(450M)/1harddisk(18G)/2G Memory,從網(wǎng)絡(luò)啟動(dòng)安

裝SunOS 5.6。安裝過(guò)程中途中斷并出現(xiàn)以下提示:

panic[CPU3]/thread=0x301bde80: CPU3 privileged UE Error: AFSR 0x00000000 80200000

AFAR 0x00000000 7c5e0190 SIMM U1302 U0302 U1301 U0301

syning file systems... [27[ 406 136 done

12535 static and sysmap kernel pages

50 dynamic kernel data pages

205 kernel pageable pages

0 segkmap kernel pages

0 segvn kernel pages

0 current user process pages

12790 total pages (12790 chunks)

dumping to vp 6145608c, offset: 3989467

panic[CPU3]/thread=0x30043e80: panic dump timeout

Dump Aborted

Type 'go' to resume{3} ok

隨后輸入‘go'或者‘boot -r’都無(wú)法使系統(tǒng)啟動(dòng),提示如下:

Can not open Kernel/unix

input filename [Kernel/unix]:

只有重新從網(wǎng)絡(luò)啟動(dòng)。這是由于CPU硬件結(jié)構(gòu)與Solaris系統(tǒng)不兼容造成的,

需要補(bǔ)丁。這個(gè)問題不僅僅是在Ultra80的機(jī)器上,如果Ultra60使用了SUN的

新推出的高速CPU(400M以上,一般為450M)且操作系統(tǒng)為Solaris 2.6或者

Solaris 2.5.1,也會(huì)出現(xiàn)類似問題。如果工作站使用的是這種高速CPU,在

隨新機(jī)器一起的附件中會(huì)有一本手冊(cè):Installing Solaris 2.5.1 or

Solaris 2.6 Software on 419+ MHz Systems,其中詳細(xì)描述了如何解決這

個(gè)問題(在zh-6頁(yè))。另外,附件中還有一張補(bǔ)丁光盤,名字叫做:

Operating Environment Installation CD May 1999,此光盤專門用于解決

此問題.

18. Q :在solaris上如何進(jìn)行數(shù)據(jù)的備份和恢復(fù)?

A: 備份整個(gè)文件系統(tǒng),也稱作完全備份(full dump);在完全備份的基礎(chǔ)上備

份修改過(guò)的文件,稱作漸進(jìn)備份(incremental dump);

ufsdump

ufsdump命令用于備份文件系統(tǒng),可以完全備份也可以漸進(jìn)備份。ufsdump命令的格式

為:/usr/sbin/ufsdump [options] dump_device files_to_dump

options包括:

0-9:指定備份的級(jí)別。0為最低,即完全備份;9為最高。假設(shè)當(dāng)前備份級(jí)別為i,那

么ufsdump命令在執(zhí)行時(shí)將尋找最近一次級(jí)別等于i或小于i的備份,將以前備份過(guò)后修

改過(guò)的文件備份下來(lái)。例如,星期一執(zhí)行了一次級(jí)別為2的備份, 星期二執(zhí)行了一次

級(jí)別為4的備份,那么當(dāng)星期三執(zhí)行級(jí)別為3的備份時(shí)備份文件中將包括自星期一備份

以來(lái)所有修改過(guò)或新創(chuàng)建的文件。如果星期三執(zhí)行級(jí)別為4的備份,那么備份文件中將

包括自星期二備份以來(lái)所有修改過(guò)或新創(chuàng)建的文件。

f:指定備份的設(shè)備,例如/dev/rmt/0;

u:更新備份記錄(/etc/dumpdates)。使用這一選項(xiàng)后ufsdump將創(chuàng)建或更新

/etc/dumpdates文件,文件內(nèi)容包括文件系統(tǒng)名、備份級(jí)別、和備份時(shí)間,例如:

pioneer# ufsdump 0uf /tmp/ddd /dev/dsk/c0t0d0s0

DUMP: Writing 32 Kilobyte records

DUMP: Date of this level 0 dump: Mon Sep 07 22:37:16 1998

DUMP: Date of last level 0 dump: the epoch

DUMP: Dumping /dev/rdsk/c0t0d0s0 (pioneer:/) to /tmp/ddd.

DUMP: Mapping (Pass I) [regular files]

DUMP: Mapping (Pass II) [directories]

DUMP: Estimated 25234 blocks (12.32MB).

DUMP: Dumping (Pass III) [directories]

DUMP: Dumping (Pass IV) [regular files]

DUMP: 25214 blocks (12.31MB) on 1 volume at 1599 KB/sec

DUMP: DUMP IS DONE

DUMP: Level 0 dump on Mon Sep 07 22:37:16 1998

pioneer# more /etc/dumpdates

/dev/rdsk/c0t0d0s0 0 Mon Sep 7 22:37:16 1998

備份前的準(zhǔn)備工作

重新啟動(dòng)系統(tǒng)到單用戶狀態(tài),或?qū)⒁獋浞莸奈募到y(tǒng)卸載下來(lái)。

通知所有用戶該文件系統(tǒng)不可用。

#wall

/export/home will be unavailable in two minutes, please log out

Press ctrl-D

對(duì)文件系統(tǒng)進(jìn)行檢查(fsck)。

ufsdump

如前例所示。

如果使用漸進(jìn)的備份方法,最后實(shí)現(xiàn)建立備份計(jì)劃,例如:

Sun Mon Tue Wed Thu Fri

Week1: Full 5 5 5 5 3

Week2: 5 5 5 5 3

Week3: 5 5 5 5 3

Week4: 5 5 5 5 3

上例中,每個(gè)月作一次完全備份,每個(gè)周末對(duì)每一周的改動(dòng)作一次備份,每天的備份

只對(duì)當(dāng)天的改動(dòng)作備份。這樣作的目的是節(jié)省備份所用的空間。

ufsrestore

ufsrestore用于恢復(fù)使用ufsdump命令備份的文件系統(tǒng)。命令格式為:

/usr/lib/fs/ufs/ufsrestore options [arguments] [filename ...]

options包括:

t:備份列表;

x:只恢復(fù)命令行中指定的文件;

r:恢復(fù)整個(gè)備份;

f:指定備份文件所在的設(shè)備或目錄;

v:verbose mode,列出備份文件的路徑。

例如:

對(duì)備份文件進(jìn)行列表:

pioneer# ufsrestore tvf ddd

Verify volume and initialize maps

Media block size is 126

Extract directories from tape

Initialize symbol table.

Dump date: Mon Sep 07 22:37:16 1998

Dumped from: the epoch

Level 0 dump of / on pioneer:/dev/dsk/c0t0d0s0

Label: none

dir 2 .

dir 3 ./lost+found

dir 5696 ./usr

dir 11392 ./var

dir 5697 ./export

dir 11393 ./export/home

dir 5698 ./opt

leaf 4 ./bin

dir 11394 ./dev

dir 5699 ./dev/sad

leaf 5879 ./dev/sad/admin

leaf 5825 ./dev/sad/user

leaf 11592 ./dev/be

leaf 11496 ./dev/conslog

...

從備份中恢復(fù)指定文件:

pioneer# cd /tmp

pioneer# ufsrestore xvf ddd ./etc/passwd

Verify volume and initialize maps

Media block size is 126

Dump date: Mon Sep 07 22:37:16 1998

Dumped from: the epoch

Level 0 dump of / on pioneer:/dev/dsk/c0t0d0s0

Label: none

Extract directories from tape

Initialize symbol table.

Make node ./etc

Extract requested files

You have not read any volumes yet.

Unless you know which volume your file(s) are on you should start

with the last volume and work towards the first.

Specify next volume #: 1

extract file ./etc/passwd

Add links

Set directory mode, owner, and times.

set owner/mode for '.'? [yn] n

執(zhí)行該操作需要指定所要恢復(fù)的文件在備份文件中的位置。由于備份文件從卷1開始,

所以可以指定從卷1開始搜索?;謴?fù)整個(gè)文件系統(tǒng)下例將一個(gè)老的文件系統(tǒng)(/opt)移

到一個(gè)新的磁盤分區(qū)(/dev/rdsk/c0t3d0s5)中。首先,卸載老的文件系統(tǒng)并實(shí)施備

份:

#umount /opt

#fsck /opt

#ufsdump 0uf /dev/rmt/0 /opt

其次,生成新的文件系統(tǒng),將其安裝到一個(gè)臨時(shí)目錄(/mnt),并實(shí)施恢復(fù):

#newfs /dev/rdsk/c0t3d0s5

#fsck /dev/rdsk/c0t3d0s5

#mount /dev/dsk/c0t3d0s5 /mnt

#cd /mnt

#ufsrestore rvf /dev/rmt/0

#rm restoresymtable

最后,卸載新的文件系統(tǒng),用fsck檢查其一致性。

#cd /

umount /mnt

#fsck /dev/rdsk/c0t3d0s5

選擇性備份,備份指定的文件和目錄;

tar

系統(tǒng)備份:tar -cvf 目標(biāo)文件名/設(shè)備名 備份文件,例如:

tar -cvf backup.tar *

命令將當(dāng)前目錄下的所有文件(包括各級(jí)子目錄)都打包在backup.tar文件中。

tar -cvf /dev/rmt/0 *

命令將當(dāng)前目錄下的所有文件(包括各級(jí)子目錄)都打包到磁帶上。查看tar文件的內(nèi)

容:tar tvf 目標(biāo)文件名/設(shè)備名,例如:

tar -tvf backup.tar

tar -tvf /dev/rmt/0

將tar文件中的內(nèi)容恢復(fù)到指定目錄中去:tar xvf 目標(biāo)文件名/設(shè)備名 [目錄名],例

如:

tar -xvf backup.tar /home

tar -xvf /dev/rmt/0 /home

如果不指定目錄名則表示當(dāng)前目錄。

19. Q: 如何在Soraris下面安裝ATM網(wǎng)卡?

A: 網(wǎng)卡型號(hào):FORE PCA-200EUX/OC3

操作系統(tǒng):Solaris 2.7

工作站:SUN Ultra60

一、硬件安裝

1、工作站關(guān)電后,將網(wǎng)卡妥善安裝在一個(gè)PCI插槽中;

2、工作站上電,按STOP and A中斷boot process,到ok提示符;

3、輸入命令show-devs,顯示系統(tǒng)配置,F(xiàn)ORE網(wǎng)卡的device-pathname應(yīng)出現(xiàn)在

配置列表中,形式可能如下:

/pci@1f,2000/FORE,PCA-200E@2

4、設(shè)備提供光口自環(huán)測(cè)試(media loopback)和內(nèi)部自環(huán)測(cè)試(internal loopback),

供檢查設(shè)備及安裝是否完好。根據(jù)經(jīng)驗(yàn)用內(nèi)部自環(huán)測(cè)試即可,方法:

輸入命令 test /pci@1f,2000/FORE,PCA-200E@2

待出現(xiàn):pass 0 說(shuō)明硬件及安裝都正確;

5、輸入boot命令 ,啟動(dòng)系統(tǒng)。

二、軟件安裝

1、軟件安裝需要root權(quán)限;

2、網(wǎng)卡支撐軟件一般是一個(gè).tar文件提供,解開后在其目錄下有8個(gè)子目錄,分

別為:

FORECore ForeThought ATM Core Software

FOREDrv ForeThought ATM Card Drivers

FORESpans ForeThought SPANS Signalling Software

FOREUni ForeThought UNI Signalling Software

FOREclip ForeThought Classical IP Software

FOREip ForeThought FORE IP Software

FOREmpoa ForeThought MPOA / LAN Emulation Software

FORExti ForeThought XTI Application Programming Interface

3、例如.tar文件解開后在/home/FORE下,則該目錄下就有上述8個(gè)子目錄,我們要

用的程序在FOREDrv、FOREip下,但各個(gè)模塊之間有一定的依賴關(guān)系,需要安裝的模塊

有6個(gè): FORECore、FORESpans、FOREDrv、FOREip、FOREUni、FOREclip。安裝過(guò)程:

> pkgadd -d /home/FORE

The following packages are available:

1 FORECore ForeThought ATM Core Software

.........(sparc) 5.1

2 FOREDrv ForeThought ATM Card Drivers

.........(sparc) 5.1

3 FORESpans ForeThought SPANS Signalling Software

.........(sparc) 5.1

4 FOREUni ForeThought UNI Signalling Software

.........(sparc) 5.1

5 FOREclip ForeThought Classical IP Software

.........(sparc) 5.1

6 FOREip ForeThought FORE IP Software

.........(sparc) 5.1

7 FOREmpoa ForeThought MPOA / LAN Emulation Software

.........(sparc) 5.1

8 FORExti ForeThought XTI Application Programming Interface

Select package(s) you wish to process (or 'all' to process all packages).

(default: all) [?,??,q]:

選擇要安裝的模塊,根據(jù)提示安裝。

4、安裝后的軟件在/opt/FOREatm /bin (使用的配置命令所在目錄)

/conf

/examples

/include

/lib

/man

三、網(wǎng)卡配置

1、網(wǎng)絡(luò)接口名配置

>configure_atm

選擇配置ip模塊,得到一個(gè)ip interface名,默認(rèn)為fa0。重啟工作站,可以看到在

/dev下有fa0接口,而網(wǎng)卡的設(shè)備名為fatm0。

2、>adinfo fatm0 可查詢?cè)O(shè)備硬件信息

>adconfig fatm0 可進(jìn)行設(shè)備配置

>adstat fatm0 可查詢?cè)O(shè)備狀態(tài)

這三個(gè)命令較少用到。

3、接口ip地址配置

ifconfig fa0netmaskbroadcastup

4、IPOA配置

atmarp -s hostname device vpi vci aal encapsulation(outgoing PVC配置)

atmarp -l device vpi vci aal encapsulation (incoming PVC配置)

例:分配給工作站的pvc為 vpi 0 vci 150

工作站的IPOA地址為200.200.200.101

MUSA設(shè)備的IPOA地址為201.200.200.100

AAL類型為5

encapsulation 為llc_routed

>atmarp -s 201.200.200.100 fa0 0 150 5 llc_routed

>atmarp -l fa0 0 150 5 llc_routed

[在MUSA設(shè)備上要做:add nms、act nms、add route、add atm arp、add ipaccess]

>ping 200.200.200.101 如果ping通,則已配置成功。

20. Q: 在哪里能得到有關(guān)Solaris的較全面的文檔?

A: http://docs.

21 .Q: 請(qǐng)教sun小型機(jī)上的路由跟蹤命令是什么?(HP上是traceroute)謝謝!

A:這個(gè)命令也是traceroute.在/usr/sbin目錄下.

22. Q: 一個(gè)GUI程序,在換個(gè)不同的SUN環(huán)境時(shí)界面就變的難看了,主要是字體影響

(還有其它影響么?)SUN 的字體都有哪些,如

-sun-screen-bold-r-normal--14-140-72-72-m-90-iso8859-1

都有哪些可選?

A: If a font can not be found in the system, the system will select

another font which might be not so elegent as you expect. The

correct way is to insure the font you want is correctly installed in

system. In solaris answer book, there is a perfect reference talking

about the font administration "font administration" in System

Administration Vol1. You can get solaris answer book by accessing

sunlibrary.huawei.com. Chen Zhexue(4924)is responsible for maintain.

it.

23 Q: Solaris啟動(dòng)過(guò)程是如何的?啟動(dòng)的時(shí)候讀那些文件啟動(dòng)一些服務(wù)比如我要在系

統(tǒng)啟動(dòng)的時(shí)候自動(dòng)啟動(dòng)Apache(httpd)服務(wù),應(yīng)該在哪個(gè)文件里面配?

A: Solaris的啟動(dòng)是典型的ATT UNIX啟動(dòng)過(guò)程, 在普通的UNIX書記和SUN公司的文

檔中都有詳細(xì)的介紹,這里就不詳談了. 要點(diǎn)室內(nèi)核引導(dǎo)后啟動(dòng)init進(jìn)程, init

按照/etc/inittab 的控制加載各子系統(tǒng), 一般是執(zhí)行 /etc/rc* 之類的腳本.

這些腳本再執(zhí)行 /etc/rc*.d/ 下的腳本,其中 /etc/rc2.d/S72inetsvc 運(yùn)行

inetd, 該后臺(tái)進(jìn)程根據(jù)/etc/inetd.conf 控制網(wǎng)絡(luò)服務(wù),所以要自動(dòng)啟動(dòng)

Apache,需要在inetd.conf 中修改或增加 80 端口的啟動(dòng)命令。(如果不是用80

,還要修改/etc/services文件)

24 Q: 有一個(gè)問題要請(qǐng)教一下,謝謝!

一臺(tái)SUN服務(wù)器,更換IP地址。

原來(lái)地址為10.11.43.137,現(xiàn)在更換為10.108.22.247

我的操作步驟如下:

1:修改/etc/hosts文件,修改后的文件內(nèi)容如下:

127.0.0.1 localhost

10.108.22.247 westsnow loghost SYBASE

10.109.22.247 eastsnow

/etc/hostname.hme0文件內(nèi)容:

westsnow

/etc/hostname.hme0:1文件內(nèi)容:

eastsnow

2:修改/etc/netmasks文件,修改后的文件內(nèi)容如下:

10.0.0.0 255.255.0.0

3:修改網(wǎng)關(guān)/etc/defaultrouter文件,修改后的文件內(nèi)容如下:

10.108.22.1

按照上面步驟修改完后REBOOT機(jī)器,啟動(dòng)過(guò)程中沒有任何異常,但是機(jī)器啟動(dòng)

后和別的機(jī)器連不上,而且連網(wǎng)關(guān)都 PING 不通,請(qǐng)問是什么原因?謝謝!

A: /etc/hostname.hme0:1 中應(yīng)當(dāng)寫你想用的IP地址,而不是機(jī)器名. 如果只改IP

地址,就不需要這個(gè)文件.

25 Q: UTF-8和US-ASCII之間的區(qū)別在那里?請(qǐng)舉例說(shuō)明。

A: UTF-8 包括 US-ASCII 和多字節(jié)編碼。與普通的多字節(jié)編碼不同,UTF-8的字節(jié)

長(zhǎng)度不固定,對(duì)于ASCII, 字節(jié)長(zhǎng)度為1, 對(duì)于中文,阿拉伯文等,可以是2,3或更

多字節(jié),這樣能有效節(jié)省存儲(chǔ)空間. 它還與很多傳統(tǒng)編碼標(biāo)準(zhǔn)兼容,所以很受歡

迎.

26 Q: 如何在腳本里實(shí)現(xiàn)修改用戶口令?

A: 由于修改口令需要從終端讀取用戶口令,所以不能用重定向的辦法,但可以采用

expect 之類的工具,這些工具建立一個(gè)偽終端來(lái)模擬輸入, 所以起到用腳本控

制終端的效果.

27 Q: 我在用EXCEED連到工作站時(shí),開了一個(gè)root權(quán)限term,網(wǎng)絡(luò)突然中斷,請(qǐng)問如

何能夠kill該term的進(jìn)程?

A: 用xkill 連dtterm 一起殺掉。在桌面上是可以的,在exceed 中不知是否可以。

28 Q: 在Solaris下可用什么命令查看system software info?

A: 用/usr/bin/pkginfo .

或者 /usr/bin/prodreg,有圖形界面將注冊(cè)過(guò)的產(chǎn)品顯示成樹的形狀.

29 Q: 請(qǐng)問:在SOLARIS 8 中,用什么命令看port id?

A: 我曾就這個(gè)問題問過(guò)不少人, 有的說(shuō) fuser 可以做,但我查 fuser 的手冊(cè)

沒有見到相關(guān)選項(xiàng)。lsof 是一個(gè)比較理想的工具,可以從下

載。還有一個(gè)簡(jiǎn)單的辦法是這樣的:

/usr/proc/bin/pfiles /proc/* > result.txt

在到result.txt 中搜索相應(yīng) socket port. 也可以自己用awk 過(guò)濾 pfiles 的

結(jié)果

30 Q: 使用FTP時(shí),不能以root用戶登錄系統(tǒng),應(yīng)修改什么配置文件?

A: 看一下 /etc/ftpusers ,如果有root, 刪掉就可以了。

31 Q: 我們的系統(tǒng)需要計(jì)算solaris的負(fù)載,可以使用uptime輸出的load average嗎,

如果不用uptime,使用libkstat的load average可以嗎?

A: 可以.

32 Q: 請(qǐng)問uptime的load average 是如何計(jì)算出來(lái)的?

A: 這個(gè)問題滿復(fù)雜的,我們知道, unix內(nèi)核里有許多種結(jié)構(gòu),如 user,proc等,

有的還mount到 文件系統(tǒng)中 ,比如 /proc /dev/kstat /dev/ksysm, uptime,

kstat,sar ,vmstat, prstat 等命令都是通過(guò)分析這些結(jié)構(gòu)來(lái)進(jìn)行計(jì)算的有

一個(gè)系統(tǒng)函數(shù)叫g(shù)etloadavg ,uptime 就是直接調(diào)用這個(gè)函數(shù)的,你也可以試試.

33 Q: 如何得到和設(shè)置操作系統(tǒng)內(nèi)核參數(shù)。

A: 通常,這些參數(shù)在 /etc/system 中配置。

34 Q: 如何得到系統(tǒng)當(dāng)前動(dòng)態(tài)運(yùn)行指標(biāo),如CPU占有率、IO量、硬盤剩余空間等。

A: 檢查的命令則有許多,可用 vmstat 和 sar 命令,還有iostat ,df ,du 用

于檢查磁盤的情況。

35 Q: How can I get a Workshop6's licence?

A: get a new one from www. and install it again.

URL is http://www./forte/cplusplus/buy.html

cp licence-file install_dir/SUNWspro/licencse_dir/sunpro.lic,node

36 Q: 請(qǐng)問能否在一個(gè)slice里掛兩個(gè)文件系統(tǒng)?

A: 不可以.

37 Q: 請(qǐng)問修改了/etc/nodename后,UNIX工作站啟動(dòng)不了,該如何是好?

A: 單純修改nodename 不夠,還應(yīng)修改 /etc/net/*/hosts

38 Q: Solaris的/usr/lib/dmi/snmpXdmid是干什么用的?

A: Sun Solstice Enterprise SNMP-DMI mapper subagent

man snmpXdmid 可得.

39 Q: 我的工作站上沒有光驅(qū),想通過(guò)遠(yuǎn)程安裝,可否?

A: 可以,有兩種方式:

1。 將 solaris 光盤內(nèi)容以 ftp 上傳,本地安裝

2。 做一個(gè)install server ,遠(yuǎn)程直接安裝。

3. 用remote光驅(qū)安裝

(在remote機(jī)器)

# ps -ef | grep nfsd

# mkdir /dummy

# vi /etc/dfs/dfstab (share -F nfs -o ro /dummy)

# eject cdrom0

# chmod 644 /etc/rmmount.conf

# vi /etc/rmmount (share cdrom*)

# chmod 444 /etc/rmmount.conf

# (Load a CD.) share

- /dummy ro ""

- /cdrom/sol_7_sparc/s5 ro ""

(在本地)

$ showmount -e starbug

# mount -F nfs -o ro starbug:/cdrom/sol_8_sparc /cdrom

$ ls /cdrom

$

40 Q: 我們想了解一下SUN公司年機(jī)器在并行程序運(yùn)算方面的能力和相應(yīng)的平臺(tái)。

A: 您知道,SUN公司在SMP技術(shù)上居于領(lǐng)導(dǎo)地位,所設(shè)計(jì)的體系結(jié)構(gòu)具有良好的可

擴(kuò)展性。只對(duì)硬件升級(jí),不改動(dòng)代碼,往往就可以得到接近線性增長(zhǎng)的性能,

如果有開發(fā)工具的幫助,會(huì)取得更好的效果,sun公司提供的 Forte C/C++

workshop 包含許多工具幫助開發(fā)者分析軟件性能病進(jìn)行優(yōu)化,Solaris也包含專

門的庫(kù)函數(shù)以提高計(jì)算效率,SUN公司有一本白皮書專門介紹高性能計(jì)算 您可

以從 docs. 得到.書的名字叫: UltraConputing:How to Achieve Peak

Performance from Solaris Applications..

41 Q: 我在/etc/skel/local.profile作的環(huán)境變量的修改但沒有在新增用戶時(shí)候得到

驗(yàn)證,為什么?這不是一個(gè)模板嗎?(用EXIT退出窗口, 再用新用戶登錄)

A: 如果是從終端登錄,.profile 會(huì)起作用,但如果從CDE 登錄,則系統(tǒng)執(zhí)行

.dtprofile,要想執(zhí)行 .profile, 還要修改 .dtprofile一般情況下,如果想設(shè)

置一個(gè)環(huán)境變量使其對(duì)所有用戶生效,可以修改 /etc/profile

42 Q: /etc/system 文件中的namespace指的是什么,與Modules有何關(guān)系?system文

件中哪些參數(shù)將對(duì)機(jī)器性能有較大影響?

A: 所有的手冊(cè)都警告說(shuō)修改system文件應(yīng)當(dāng)慎重,事實(shí)上,也只有在安裝數(shù)據(jù)庫(kù),

增加新的設(shè)備時(shí),才有可能需要修改此文件.所改的參數(shù),也就是你附件中改過(guò)的

那幾個(gè)線程數(shù),信號(hào)量之類的. 修改參數(shù)值,會(huì)影響整個(gè)系統(tǒng)的開銷,因?yàn)檫@些值

所涉及的空間分配是在系統(tǒng)啟動(dòng)時(shí)進(jìn)行的namespace用于對(duì)modules分類, 說(shuō)明

中指出了目前支持的幾種namespace,用戶不能增加新的種類.

43 Q: I am a programer work with SUN C++. Can I use STL(stand template

library) in program. I can't find any help in SUN C++'s

document.Thank you.

A: Sun 的 C/C++ WorkShop 中的C++ 類庫(kù)好像包含 STL, 可以參考一下.

docs. 上有完整的文檔,可以參考一下.

44 Q: 原來(lái)的系統(tǒng)中/usr與 / 在同一個(gè)硬盤分區(qū)上,由于安裝了許多軟件,此分區(qū)已滿

,現(xiàn)在系統(tǒng)增加了硬盤,如何將/usr 目錄挪到新的硬盤上?

A: 1.在新的硬盤上將文件系統(tǒng)建好,

2.mv /usr /usr.bak

3.mkdir /usr

4.mount newdriverpath /usr

5.cp -r /usr.bak /usr

6.修改/etc/vfstab 文件.

45 Q: 運(yùn)行下面這段程序并用vmstat觀察內(nèi)存的使用情況:

int main(){

int *p[100];

int c;

printf("before new!");

c=getc(stdin);

for(int i=0;i<100;i++)

p=(int *)malloc(sizeof(int)*32000);

printf("after new!");

//1.....

c=getc(stdin);

for(int i=0;i<100;i++)

free((void *)p);

printf("after delete!");

//2......

c=getc(stdin);

return 0;

}

發(fā)現(xiàn)在 2 處系統(tǒng)的空閑內(nèi)存塊并沒有增加,free調(diào)用到底有沒有釋放內(nèi)存?

A: malloc 調(diào)用引起進(jìn)程堆空間增長(zhǎng),但free調(diào)用不會(huì)導(dǎo)致該堆空間立即縮小,

系統(tǒng)只是簡(jiǎn)單記錄這一變化,就繼續(xù)運(yùn)行程序,只有系統(tǒng)出現(xiàn)內(nèi)存短缺時(shí),

系統(tǒng)才收集這些內(nèi)存塊重新分配,這樣實(shí)現(xiàn)是為了減少系統(tǒng)開銷,提高效率.

46 Q: 請(qǐng)問在kstat的輸出中,類似avenrun_15min這種內(nèi)核動(dòng)態(tài)參數(shù)有沒有介紹材料?

A: 通常, kstat輸出的是內(nèi)核模塊中的一些鏈表或數(shù)組,按照SUN公司的文檔,這些

輸出結(jié)果是自解釋型的,根據(jù)他們的名字就可以猜到其含義.但實(shí)際上并不是這

樣.這些鏈表中包含的結(jié)構(gòu)是在下的一些頭文件中定義的,比如

kmem_cache模塊的結(jié)構(gòu)由kmem_impl.h定義,hme模塊的結(jié)構(gòu)由hme.h定義,等等.

翻看這些頭文件,可以得到稍微詳細(xì)一點(diǎn)的資料. 參數(shù)名字通常與某結(jié)構(gòu)的成員

變量同名,頭文件中由簡(jiǎn)單的注釋指出其作用. 比如:hme模塊輸出中包含如下字

段:

brdcstrcv 1094670

我們就可以查hme.h,hme.h中有一個(gè)很大的結(jié)構(gòu):hme, 其中有:

uint32_t hme_brdcstrcv; /* # broadcast packets received */

47 Q: 1.問題描述:Router&LanSwitch的日志管理依賴系統(tǒng)的syslogd進(jìn)程來(lái)實(shí)現(xiàn)。

通過(guò)設(shè)置/etc/syslog.conf文件, 可以控制syslogd把日志存入特定的文本

文件中。然后日志后臺(tái)就可以周期性的輪詢這些文件并導(dǎo)入數(shù)據(jù)庫(kù)。按照sun

的man頁(yè)說(shuō)明,當(dāng)向syslogd進(jìn)程發(fā)HUP信號(hào)時(shí),進(jìn)程將重讀配置文件

/etc/syslog.conf,然后繼續(xù)運(yùn)行。 但在Solaris2.7以下實(shí)際的效果是:發(fā)

HUP信號(hào)將導(dǎo)致syslogd進(jìn)程不能正常工作(有的試驗(yàn)結(jié)果是,信號(hào)導(dǎo)致進(jìn)程

終止),后續(xù)設(shè)備日志全部丟失。

2.解決建議:

我們的建議是,修改系統(tǒng)的腳本文件/usr/lib/newsyslog,不讓其向syslogd

發(fā)HUP信號(hào),而是TERM(終止信號(hào)),然后重啟。此種方法的弊端是,如果用

戶主動(dòng)向進(jìn)程發(fā)HUP信號(hào),仍然存在問題。而且也不能解決syslogd意外退出

的情況。第二種建議是由綜合統(tǒng)一做一個(gè)檢測(cè)進(jìn)程,這樣各項(xiàng)目就不會(huì)產(chǎn)生

沖突。但仍然存在用戶主動(dòng)向進(jìn)程發(fā)HUP信號(hào)使syslogd失效的問題。由上述

可以看出,無(wú)論何種方法,都不能徹底解決問題。

A: 問題的產(chǎn)生可能是由于程序員定義了新的日志文件并企圖 使用newsyslog 腳

本來(lái)處理,這個(gè)腳本備份日志文件再發(fā)送 HUP信號(hào)。newsyslog 腳本在處理系

統(tǒng)文件時(shí)不會(huì)有問題,很可能是由于syslogd對(duì)這些文件做過(guò)專門的處理。但

不能認(rèn)為我們自己的文件也會(huì)得到同樣的照顧,事實(shí)上,這樣做通常是危險(xiǎn)

的。 我認(rèn)為建議2 是可行的, 因syslogd打開的是新的日志文件,不會(huì)發(fā)

生異常。而用戶發(fā)送的 HUP 命令只是使 syslogd重讀 syslog.conf 文件

,也不會(huì)發(fā)生意外.為了比較好的定位問題,建議在一個(gè)比較干凈的系統(tǒng)上進(jìn)

行測(cè)試,在測(cè)試之前最好停掉自己的程序,

簡(jiǎn)化/etc/syslog.conf,我是這樣測(cè)試的:

# /usr/lib/newsyslog

# logger -p deamon.notice "12345"

# cat /var/adm/messages

# kill -HUP `cat /etc/syslog.id`

# logger -p deamon.notice "aaaa"

# cat /var/adm/messages

結(jié)果正常.

48 Q: Solaris 8中,為什么不可以用如下命令給網(wǎng)卡增加邏輯地址?

ifconfig hme0:1 xxx.xxx.xxx.xxx up

A: Solaris 8 對(duì)ifconfig 作了一些改動(dòng),在這個(gè)命令之前,先執(zhí)行下面的命令就可

以了: ifconfig hme0:1 plumb

49 Q: 為什么Solaris 中的多個(gè)網(wǎng)卡顯示的以太網(wǎng)地址都是一樣的?

A: 缺省情況下,系統(tǒng)使用本機(jī)的MAC地址作為各網(wǎng)卡的MAC地址,可以用如下

OpenBoot 命令讓系統(tǒng)使用網(wǎng)卡自帶的MAC地址.

ok setenv local-mac-address? true

50 Q: 如何在一臺(tái)機(jī)器里如何實(shí)現(xiàn)用多塊網(wǎng)卡容錯(cuò)?

A: Solaris8 新增了一個(gè)daemon叫mpathd將網(wǎng)卡管理分組管理來(lái)完成這樣的功能.

原理是給每個(gè)網(wǎng)卡分配兩個(gè)地址,多出的一個(gè)邏輯IP地址由mpathd用來(lái)檢查個(gè)網(wǎng)

卡的工作情況.下面一兩塊網(wǎng)卡為例介紹配置過(guò)程,這里兩塊網(wǎng)卡分別是hme0和

hme1,

1. ifconfig hme0 group test

ifconfig hme1 group test

2. ifconfig hme0 addif 19.16.85.21 netmask + broadcast + -failover deprecated up

ifconfig hme1 addif 19.16.85.22 netmask + broadcast + -failover deprecated up

3. 檢查hme0:1和hme1:1看是否有邏輯IP

ifconfig hme0:1

ifconfig hme1:1

這里要注意,給網(wǎng)卡增加的邏輯IP應(yīng)當(dāng)與實(shí)際分配的IP地址在同一個(gè)網(wǎng)段并

且不能與網(wǎng)上其他主機(jī)IP地址沖突.

51 Q: 一個(gè)進(jìn)程里最多可以打開多少文件?

A: 操作系統(tǒng)為每個(gè)進(jìn)程維護(hù)一個(gè)所打開文件的數(shù)組,進(jìn)程能夠打開的文件與此數(shù)組

的大小有關(guān).此數(shù)組的大小由兩個(gè)系統(tǒng)變量限制: rlim_fd_max , rlim_fd_cur,

這兩個(gè)變量可以用limit或ulimit 命令察看和修改,要擴(kuò)大rlim_fd_max需要

root權(quán)限,rlim_fd_cur不能超過(guò)rlim_fd_max. 編程時(shí)則有庫(kù)函數(shù) getrlimit

和 setrlimit 可以使用. 另外一種改法是在 /etc/system文件中修改. 如果是

調(diào)用stdio函數(shù)打開文件,則還有另外一種限制,32位內(nèi)核Solaris 的 FILE 結(jié)構(gòu)

中的 文件句柄是一個(gè)字節(jié),所以同時(shí)打開文件的上限是256

52 Q: 如何改變登錄CDE時(shí)的語(yǔ)言環(huán)境?

A: 修改/usr/dt/config/Xconfig文件中的變量 Dtlogin*language即可.

53 Q: 如何防止用戶通過(guò)CDE 環(huán)境中的 suspend 菜單關(guān)閉計(jì)算機(jī)?

A: 修改 /usr/openwin/bin/sys-suspend的執(zhí)行權(quán)限就可以了.

54 Q: 我安裝完solaris5.7之后(安裝時(shí)選擇簡(jiǎn)體中文),運(yùn)行C語(yǔ)言編譯器cc不成功

,提示“l(fā)anguage optional software package not installed.”。請(qǐng)問這是

怎么回事,該如何解決?

A: Solaris本身帶有adb,mdb,make工具,但不帶C語(yǔ)言編譯器.若要使用需要單獨(dú)購(gòu)

買軟件包及l(fā)icense.

55 Q: 想修改ROOT的缺省PATH,在哪改?不要告訴我LOCAL.PROFILE,不管用.

A: 如果以root用戶身份登錄或者用 su - 命令進(jìn)行切換,則修改 home目錄下

.profile是管用的. 如果是簡(jiǎn)單的 用 su 進(jìn)行切換, 則系統(tǒng)保留除 PATH之外

的所有環(huán)境變量, PATH被設(shè)為 /etc/default/su 中的 SUPATH ,缺省時(shí)為

/usr/sbin:/usr/bin

56 Q: 問一下,現(xiàn)在在Solaris下有什么比較好的測(cè)試程序語(yǔ)句以及條件覆蓋率的工具

A: prof 和 gprof 都有. 如果您使用workshop 或者 Forte 6.0,則其中有

performence analysis tools 可以使用.

57 Q: 怎么樣讓系統(tǒng)啟動(dòng)時(shí)就自動(dòng)在一個(gè)網(wǎng)卡上綁定兩個(gè)IP地址

A: 創(chuàng)建文件 /etc/hostname.hme0:1,其中寫上第二個(gè)ip地址.

58 Q: Sun solaris7系統(tǒng)中有一下幾種SHELL,sh,csh,ksh,另外還有一個(gè)jsh.

我的問題是:jsh是什麼SHELL?另外有bash SHELL嗎?

A: jsh 就是 sh, 只不過(guò)是激活了job control 模式. 但現(xiàn)在 sh 本身就有job

control 功能,所以只用 sh 就可以了. bash 是 sh 的增強(qiáng), 如果你的系統(tǒng)沒

有這個(gè)shell, 可以到 www. 下載.

ls /bin/*sh 可以看到系統(tǒng)所有存在的shell.

59 Q: 我的光驅(qū)無(wú)法讀取光盤?且總是顯示設(shè)備忙,如何搞定?mount顯示沒有被

mount.

A: 查找進(jìn)程 vold 并將其殺死,就可以手工打開光驅(qū).

60 Q: 如何將root用戶的shell改掉,我知道一般用戶可在admintool下修改,但root

用戶不能。

A: 1. chmod 666 /etc/passwd (一定要讓普通用戶有些權(quán)限,切記!)

2. vi /etc/passwd(最后一個(gè)字段試root 的 shell,要確保該程序存在方可改

掉它. )

61 Q: 我在安裝Solaris 8時(shí)啟用了DHCP,現(xiàn)在我的主機(jī)名是unknown,在啟動(dòng)時(shí)工作

站啟用DHCP并分配IP,主機(jī)名也自動(dòng)改為unknow。請(qǐng)問怎樣改主機(jī)名?

A: DHCP in Solaris8

1. # touch /etc/dhcp.hme0,hme0:請(qǐng)用相應(yīng)的網(wǎng)卡設(shè)備名;

2. 修改/etc/init.d/network,/etc/init.d/inetsvc

先備份

# cp /etc/init.d/network /etc/init.d/network.org

# cp /etc/init.d/inetsvc /etc/init.d/inetsvc.org

修改/etc/init.d/network第278行:

"dhcp") #hostname=`/sbin/dhcpinfo Hostname`

hostname=`cat /etc/nodename`

修改/etc/init.d/inetsvc第168行:

hostname=`/sbin/dhcpinfo Hostname`

if [ -z "$hostname" ]; then

#hostname="unknown"

hostname=`cat /etc/nodename`

fi

修改/etc/init.d/inetsvc第82行:

if [ "$_INIT_NET_STRATEGY" = "dhcp" ]; then

#dnsdomain=`/sbin/dhcpinfo DNSdmain`

dnsdomain=`cat /etc/defaultdomain`

else

dnsdomain=

fi

if [ -n "$dnsdomain" ]; then

#dnsservers=`/sbin/dhcpinfo DNSserv`

dnsservers=`cat /etc/dnsservers`

修改/etc/init.d/inetsvc第220行:

/usr/bin/mv /tmp/hosts_clear.$$ /tmp/hosts.$$

mydomain=`cat /etc/defaultdomain`

echo "${ipaddr}\t${hostname}\t${hostname}.${mydomain}\t# Added by DHCP" >>/tmp/hosts.$$

在/etc/init.d/inetsvc第一行加入如下語(yǔ)句:

if [ -f /etc/dhcp.*[0-9] ]; then

_INIT_NET_STRATEGY="dhcp"

export _INIT_NET_STRATEGY

fi

3.創(chuàng)建/etc/defaultdomain,內(nèi)容為huawei.com.cn

4.創(chuàng)建/etc/nodename,內(nèi)容為你的機(jī)器名

5.創(chuàng)建/etc/dnsservers:129.9.111.100 10.15.1.3

62 Q: 我用msgget建一消息隊(duì)列:

ret = msgget(IPC_PRIVATE, (0660)|IPC_CREAT);

在一個(gè)線程用msgsnd發(fā)消息,另一個(gè)msgrcv收:

ulReturnCode = msgsnd( QueueID, pBufferAddr, 8 ,IPC_NOWAIT);

當(dāng)消息隊(duì)列中的消息個(gè)數(shù)等于40時(shí)(每個(gè)消息尺寸為8字節(jié)),msgsnd函數(shù)返

回-1,errno= 11,請(qǐng)問是什么原因。是消息隊(duì)列滿嗎?怎樣調(diào)整系統(tǒng)參數(shù),使

消息隊(duì)列能大些。

A: msgmap : 100 maximum size of resource map for messages

msgmax : 2048 maximum size ,in byte, of a massages

msgmnb: 4096 maximum number of bytes on a message queue.

msgmni: 50 maximum size of message queue identifiers.

msgssi: 8 message segment size.

msgtql: 40 maximum number of message headers

msgseg: 1024 maximum number of message segments.

msgseg 最大為 32k, 其他參數(shù)最大值都是 2 billion.

63 Q: license server 如何啟動(dòng)?

A: run /opt/SUNWste/bin/lmgrd.ste 可啟動(dòng) license server

64 Q: 在Solaris8下,如何修改一個(gè)目錄的大小。安裝時(shí)系統(tǒng)自動(dòng)的設(shè)置

/export/home目錄空間很大,而其他目錄空間很小。

A: 1, 備份 /export/home,

2. umount /export/home,

3. 用 format 修改盤片大小,

4. 備份要增大的目錄,

5, umount

5. 用 format 增加盤片大小.

6. 重新mount.

65 Q: 請(qǐng)問用什么命令可以確定是否有磁帶設(shè)備?多謝。

A: 看一下 /dev/rmt 如果是空就沒有.

.

66 Q: 在solaris 8下安裝Forte Developer 6 到達(dá):

installing Forte C++ Entep Ed 6/SPARC

installing Forte Developer 6

時(shí)死掉應(yīng)如何解決

A: 在安裝之前,應(yīng)當(dāng)清除所有以前安裝時(shí)添加進(jìn)系統(tǒng)的package.

另外,不用缺省目錄 /opt , 換一個(gè)新建的空目錄也有效.

67 Q: Forte c/c++版本可以用在solaris2.6操作系統(tǒng)上嗎?

A: 可以

68 Q: 在輸入用戶名后啟動(dòng)很慢,有時(shí)甚至進(jìn)不了,停在啟動(dòng)畫面,不知如何解決(我用

過(guò)fsck,也不好使,有沒有更好的辦法)!能否重裝操作系統(tǒng),而不影響現(xiàn)有的已裝

軟件.謝謝!

A: 一般說(shuō)來(lái), 這與家目錄下配置文件有關(guān).新建一個(gè)用戶試一試.

69 Q: 現(xiàn)在遠(yuǎn)程維護(hù)的解決方式是通過(guò)Modem撥號(hào),建立連接,通過(guò)我們自己編寫的IP

代理轉(zhuǎn)發(fā)程序,完成對(duì)傳輸設(shè)備遠(yuǎn)程維護(hù)。在PC機(jī)上的撥號(hào)網(wǎng)絡(luò),撥號(hào)程序運(yùn)

行都比較正常,對(duì)連接速度,穩(wěn)定性方面目前使用還算可以。但是在設(shè)置Sun工

作站的撥號(hào)程序的時(shí)候,我常常會(huì)遇到一些“奇怪”的問題, 比如Modem不握

手,沒有撥號(hào)音等?,F(xiàn)在我們的撥號(hào)設(shè)置是自己編寫的腳本文件方式??赡軐?duì)

各種情況考慮的不全面,因此請(qǐng)問是否有相應(yīng)的軟件包(程序)可以幫助我們

機(jī)型撥號(hào)設(shè)置,保證撥號(hào)成功?

A. 連接失敗通常與配置參數(shù)有關(guān),由于硬件種類繁多,很難保證一個(gè)程序在所有的

硬件環(huán)境下都能順利配置成功.我們只能針對(duì)具體情況進(jìn)行分析.但我們發(fā)現(xiàn),改

變串口的流倥方式經(jīng)常有助于問題的解決.Sun solstice 中有一個(gè)撥號(hào)軟件據(jù)

說(shuō)比aspppd 更容易使用,我沒有用過(guò),或許您愿意試一試?

70 Q: 我這多線程程序,我用ftime得到函數(shù)的調(diào)用時(shí)間,發(fā)現(xiàn)在一個(gè)線程中,增加一

個(gè)printf后,調(diào)用時(shí)間為5毫秒。去掉這個(gè)printf,調(diào)用時(shí)間卻為15毫秒。增加

了一個(gè)printf為什么后使該函數(shù)的執(zhí)行更快了?

A: ftime 得到系統(tǒng)當(dāng)前時(shí)間,但具體到線程的執(zhí)行時(shí)間,是和系統(tǒng)的調(diào)度情況有關(guān)

的, 請(qǐng)用調(diào)試工具來(lái)檢查準(zhǔn)確的執(zhí)行時(shí)間.

71 Q: 我們的技術(shù)支持人員遇到一個(gè)問題,向您請(qǐng)教:在安裝時(shí)沒有選擇安裝網(wǎng)絡(luò),

現(xiàn)在需要安裝網(wǎng)絡(luò),怎樣增加一個(gè)interface。目前只有l(wèi)o0,沒有hme0。

A: 在 /etc 下 touch 一個(gè)空文件 hostname.hme0, 用 boot -r 命令重起.

72 Q: 在Sun Ultra 5工作站(安裝SOLARIS 2.6),每次開機(jī)時(shí),都出現(xiàn)以下問題:

Restoring the system.Please Wait ... cpr_read_bitmap:Can't

cpr_alloc bitmap0

Can't read statefile bitmap,please reboot

Program terminated

{0} OK

每次開機(jī)都需要boot才能進(jìn)入。

請(qǐng)問如何解決?

A: 首先, 在 ok 狀態(tài)下檢查 boot-file 參數(shù):

printenv boot-file

如果是 boot-file = -F cprboot 之類, 用如下命令:

set-default boot-file

再檢查一下.應(yīng)該是空才對(duì).

如果不是, 則需要設(shè)置:

setenv boot-file -F ufsboot

重新啟動(dòng).

73 Q: 經(jīng)實(shí)驗(yàn),兩臺(tái)Sun工作站之間通過(guò)網(wǎng)絡(luò)發(fā)Syslog日志,也不支持漢字,該問題可

能是syslogd的問題。

A: 估計(jì)是由于syslogd在望上傳輸時(shí)丟掉了字節(jié)的最高位.

74 Q: 如果需要ID:105181-15的patch,請(qǐng)問ID:105181-19可以代替嗎?ID毫最好兩位

是不是patch的版本號(hào),如果是版本號(hào)有沒有前項(xiàng)兼容性?

A: 可以, 后兩位表示同一patch的版本號(hào).

75 Q: 以下代碼在Forte C++下導(dǎo)致編譯錯(cuò)誤,請(qǐng)問如何解決?

template

void testimpl(int i1, int i2, p1* n1 = 0, p2* n2 = 0)

{

p1* pReq = new p1;

p2* pRsp = new p2;

}

void test()

{

int i = 0;

int j = 0;

testimpl( i, j);

}

A: 請(qǐng)下載新的patch更新Forte C++

76 Q: 請(qǐng)問:如何設(shè)置工作站的最大客戶端數(shù)?現(xiàn)有一臺(tái)測(cè)試用機(jī),使用人較多,經(jīng)

常出現(xiàn)“無(wú)法得到pty”的提示。

A: 在/etc/system ,可以用參數(shù) maxusers 設(shè)置,最大2048,如果這里沒有設(shè)置,默

認(rèn)為與系統(tǒng)內(nèi)存容量相同(以M記,最大為1024),

77 Q: I install visibroker into my solaris 2.7.

When I execute a example program,it cannot execute and tell me:

ld.so.1: Server: 致命的: liborb64r_so:打開失?。簾o(wú)此文件或目錄

被殺掉

(Server is my program)

Can you tell me how to settle it?

A: you should set this envirnment variable: LD_LIBRARY_PATH

78 Q: 貴處有無(wú)磁帶機(jī)的使用手冊(cè)或指導(dǎo)說(shuō)明?

A: answerbook 中系統(tǒng)管理員手冊(cè) I 有使用說(shuō)明.

answerbook 的文檔不是html格式,需要一個(gè)服務(wù)器程序轉(zhuǎn)換, 察看本機(jī)http進(jìn)

程看有沒有下面這個(gè):

# ps -ef |grep http

# /usr/lib/ab2/dweb/sunos5/bin/dwhttpd /usr/lib/ab2/dweb/data

79 Q: 在 solaris 2.5.1 上 把 系統(tǒng)時(shí)間 改為 2004 年,無(wú)問題,然后把時(shí)間再改回

來(lái)后,整個(gè)UNIX 死機(jī),請(qǐng)SUN工程師答復(fù). 具體操作為: 將操作系統(tǒng)時(shí)間設(shè)為

2004年3月1日,然后再將操作系統(tǒng)時(shí)間改回當(dāng)前的時(shí)間,則系統(tǒng)的cpu資源被兩個(gè)

進(jìn)程dtwm,dtfile嚴(yán)重占用,X Window反應(yīng)非常緩慢,在低配置的系統(tǒng)上導(dǎo)致系統(tǒng)

不可操作.同時(shí)顯示 "Warning:selected failed;error code 22.

A: 在窗口環(huán)境下或多用戶模式下來(lái)回切換時(shí)間,會(huì)導(dǎo)致不可預(yù)測(cè)的結(jié)果,所以,

如果當(dāng)真要執(zhí)行此類操作,請(qǐng)?jiān)趩斡脩裟J较逻M(jìn)行.

80 Q: shell 文件中如何從文件中讀參數(shù)?

A: cat yourfile`

81 Q: 如何分析網(wǎng)絡(luò)負(fù)載,在SUN上面有沒有相應(yīng)的工具

A: netstat -i

82 Q: 請(qǐng)問目前SUN E250,E450,E3500支持的CPU主頻和緩存分別是多少?您能將這

些配置列表發(fā)給我嗎?

A: docs. 有 硬件的answerbook ,可以參考一下。

現(xiàn)在支持的CPU到400M, 480M 產(chǎn)品已有.but still have not released

83 Q: mt -f /dev/rmt/0 有個(gè)參數(shù):retension中文為“拉緊”,在磁帶操作中具體

做什么?

A: the man page of this command said it clearly:

Rewind the cartridge tape completely, then wind it

forward to the end of the reel and back to beginning-

of-tape to smooth out tape tension.

so ,it is not 拉緊, but 放松 instead.

84 Q: 具體問題是:有一個(gè)進(jìn)程不停的向該文件增加內(nèi)容,同時(shí)另外一個(gè)進(jìn)程建立了

與該文件的管道,從該文件中讀取一行記錄進(jìn)行處理。然后刪除該行記錄。因

此需要保持該文件i-node不能改變,否則,向該文件寫的進(jìn)程就不能將信息寫

入該文件了。有沒有解決方法,請(qǐng)指教。

A: I don't know if I have understood you :

If you want save this file for later use, you should not remove its'

content,if you don't need these content, you don't need this file as

well, you can use pipe only, or other interprocess communication

methods.

85 Q: 我用dos2unix轉(zhuǎn)換一文件,卻不成功,提示信息如下:(我用PC機(jī)通過(guò)rexec遠(yuǎn)

程登陸的)

$dos2unix filename1 filename2

could not open /dev/kbd to get keyboard type US keyboard assumed

could not get keyboard tyep US keyboard assumed

請(qǐng)問此問題是怎麼回事?如何解決?

A: 權(quán)限問題, 檢查一下 /dev/kbd 讀寫權(quán)限

86 Q: 我希望在一臺(tái)ultra機(jī)器為以下網(wǎng)絡(luò)配置路由

子網(wǎng):10.1.0.0

掩碼:255.255.0.0

網(wǎng)關(guān):10.220.10.113

應(yīng)該如何配置?

用以下命令可以嗎?如果永久配置需要修改那些文件?

%route add 10.1.0.0 10.220.10.113

A: no,try this commond:

#route add default 10.220.10.113

87 Q: 有個(gè)patch 107311-09,能解決CC4.2不能處理#pragma pack()的問題嗎?

A: the right patch is 104631, but you should add all related patch

to avoid other problem,find them at: sunsolve.

88 Q: 在CSH下我輸入以下命令?

$setenv IWAVE 'pwd'

$echo $IWAVE

結(jié)果顯示為:pwd

在我的理解中應(yīng)該是將pwd的輸出(如/tmp)賦值給變量IWAVE,所以我想象的

輸出是/tmp

A: use ` instead ' apparently,they are different. read some unix books

for reference

89 Q: 為什么有時(shí)普通用戶不能登錄CDE?

A: 這個(gè)錯(cuò)誤可能是由于CDE的不正確設(shè)置造成的。在每一個(gè)用戶的home目錄下有一

個(gè).dt子目錄.在此目錄下有一個(gè)errorlog文件記錄了CDE登錄失敗的原因.查

看此文件可以找到失敗的原因.一個(gè)可行的方法是:使用root登錄并且刪除對(duì)

應(yīng)用戶home目錄下的.dt目錄,同時(shí)可以刪除/.dtprofile文件, 然后使用

用戶口令登錄即可.外檢查/usr/dt/bin/dtsessoin的使用權(quán)限.正確的權(quán)限應(yīng)

當(dāng)是-r-sr-xr-x

90 Q: 關(guān)于Solaris8上DHCP的配置問題安裝Solaris8后,進(jìn)程dhcpagent的CPU占用率一

直都超過(guò)88%, 請(qǐng)問有什么方法可以解決.謝謝.

A: I solve this program by going to the field sit.

The update period parameter can not be set longer than 2 weeks in the

DHCP server side.

91 Q(1)能否在Ultra60上只安裝64位的Solaris8?

(2) Solaris8安裝在Ultra60上,內(nèi)核是32位還是64位?

(3)在其上安裝的Oracle 8是安裝的32位版本還是64位版本?

A: Solaris8 的內(nèi)核是64位的, 但是,它同時(shí)帶有32位程序的解釋器,也就是說(shuō)32位

的程序也可以在Solaris8上面運(yùn)行。事實(shí)上Solaris8上面有一些系統(tǒng)命令就是

32位的程序,如link等。所有的Solaris8都是64位的,但是都帶有32位的解釋

器。(就現(xiàn)在的情況而言,32位的解釋器是必 須的)。在Solairs 8上面運(yùn)行

的應(yīng)用程序可以是64位,也可以是32位的,包括Oracle 8在內(nèi)

92 Q: 很感謝你的答復(fù)。原來(lái)不能創(chuàng)建用戶的原因應(yīng)該是文件系統(tǒng)已滿,我刪除了一

些用戶賬號(hào)后,創(chuàng)建正常?,F(xiàn)在的問題是c0d0t0s0文件系統(tǒng)的容量太小,現(xiàn)在

已經(jīng)達(dá)到100%,如何擴(kuò)展這個(gè)文件系統(tǒng),是否只有重裝系統(tǒng)這一個(gè)辦法?

A: 在系統(tǒng)安裝時(shí),各個(gè)分區(qū)劃分的有些不太合理。/ 目錄和 /usr 太小

/export/home和/tmp 太大。實(shí)際上在安裝時(shí),比較合理的辦法是只設(shè)置 / 和

/tmp,/tmp最多 500M即可。然后在 / 上面建立/usr,/opt 和/export/home。

現(xiàn)在補(bǔ)救的辦法是利用軟link的辦法:首先將一些在/或/usr中不太是系統(tǒng)直接

使用的目錄(一定不可以包含/usr/sbin,/sbin, /etc,等等)轉(zhuǎn)移到有空間的分

區(qū)上面,然后使用ln建立軟連接。關(guān)于ln的使用可以man.這種辦法是不得已而

為之。不是很好把握,搞不好就會(huì)死機(jī),并且啟動(dòng)不起來(lái)。所以在進(jìn)行此項(xiàng)活

動(dòng)時(shí),首先要備份數(shù)據(jù),以免發(fā)生以上情況時(shí)丟失。如果您在下午下班的時(shí)間

可以抽出一點(diǎn)時(shí)間,最好還是將系統(tǒng)重新安裝一遍的好。因?yàn)?,每一個(gè)目錄都

有一定的用意,一些軟件的安裝不是地方會(huì)讓人感到很別扭。而使用軟連接又

會(huì)降低系統(tǒng)的運(yùn)行速度。

93 Q: 求助--請(qǐng)教一個(gè)多線程編程問題。關(guān)于我們發(fā)現(xiàn)的問題具體現(xiàn)象如下:

函數(shù) void* A(void *pInput)

{

char szBuf[30000]; //this buffer maybe larger than 30,000

...

...

}

在多線程程序中,該函數(shù)在main中運(yùn)行(此時(shí)相當(dāng)于在主線程中運(yùn)行)正常。

如果使用pthread_create創(chuàng)建一個(gè)線程,以A作為線程入口函數(shù),用內(nèi)存測(cè)試工

具purify可以觀察到該線程運(yùn)行過(guò)程中出現(xiàn)Beyond Stack Read、Beyond Stack

Write錯(cuò)誤。如果把szBuf改為堆中分配的內(nèi)存,則無(wú)此問題。據(jù)此,我們判斷

是線程的??臻g溢出造成該問題。按資料描述,主線程的缺省??臻g大小為8M

,子線程缺省??臻g為2M;我們使用pthread_attr_setstack函數(shù)將子線程的棧

空間設(shè)置為8M,但仍未解決問題。后又將線程屬 性設(shè)置為

PTHREAD_SCOPE_SYSTEM, 問題仍然存在。函數(shù)A以靜態(tài)庫(kù)方式由第三方提供,

我們現(xiàn)需要使之在一個(gè)子線程中運(yùn)行,因此希望能夠提供主線程與子線程差異

的資料,除堆??臻g、調(diào)度方式外,是否還有其他差別,造成以上錯(cuò)誤的發(fā)生

A: In fact, there is no problem in the program. I think there is a bug

in their debug tool: purify. You can use dbx to debug your program.

94 Q: 請(qǐng)問一塊硬盤上可以有兩個(gè)Solaris分區(qū)嗎?在一塊硬盤上分了兩個(gè)solaris分

區(qū),一個(gè)是active的系統(tǒng)安裝分區(qū),另一個(gè)是后來(lái)用fdisk創(chuàng)建的,請(qǐng)問怎樣把

第二個(gè)分區(qū)加入到solaris系統(tǒng)中使用。謝謝。

A: Yes, There can be up to six partitions in a disk. you can see the

partition using utility format. Command list:

#format

Then you will see the disks installed in you system.then select the

disks you are interested in. then print "partition" and then "print"

to see the partition information. The partition you want to add to

the system can be identified as c#t#d#s#. Make sure the mount point(

a empty directory in file system). such as /disk1.then run the

command:

#mount /dev/dsk/c#t#d#s# /disk1

run the command

#df -k

to verify the slice(partition) is properly installed.

95 Q: 請(qǐng)問在Solaris 2.7上,可以動(dòng)態(tài)改變分區(qū)大小嗎? 我的工作站劃分分區(qū)不合理,

根分區(qū)太小,已經(jīng)滿了,可以使用工具動(dòng)態(tài)改變嗎?

A: No, If you want to modify it, the whole disk data will be lost.

In fact, I think it high time for you to re-instal the solaris

system. In the new installation. You really need just two partitions

swap and root. Leave no more than 1G to swap partition and all the

left to root.Don't forget to backup all you data before re-installation.

96 Q: 用CC編譯器如何實(shí)現(xiàn)結(jié)構(gòu)成員按字節(jié)對(duì)齊,類似于其他編譯器的#pragma pack(1)

功能。

A: It is a standard compilation option(#pragma pack). It is also

supported in Solaris C.You can get documents about SC options from

http://sunlibray under workshop directory.

97 Q: 為什么SUN的本地界面有時(shí)候會(huì)出現(xiàn)死掉的情況,此時(shí)kill掉用戶的dtsession

是否就可以恢復(fù)正常。如不能恢復(fù)正常還需要做那些操作。

A: In my experince, the interface dying, may be caused by other

application other than dtsession. You should determine which

program's interface causes the interface dying. This situation is not

often happens, and most of them happened when you are manipulating a

program's interface by mouse. When it happen, login the system from

network as "root" or the account which cause the dying, kill the

program.

98 Q: 系統(tǒng)不能啟動(dòng), 任何二級(jí)目錄都沒有了,但用戶下,所有命令都不能用,怎么

安裝Solaris,能直接從光盤啟動(dòng)嗎?

A: You harddisk is damaged. It may be salvaged manually, or can not.

You should restall the system. Or even worse, you should change your

harddisk.

99 Q: Can you tell me if I want to add a new CPU chip to a only one CPU

chip machine on solaris system,Can the application run continually in

the old cpu chip without interruption on solaris system ?

A: Please tell me the machine's type. If your machine is a workstation.

CPU chips can not be added without turning down the power. I don't

know so much in this field. But, I have forwarded this message to the

specitest in our company. You will get much more detailed answers.

But you should wait several days. Another way for you is to consult

the vender who sell you the machine directly.

100 Q: what's deference between the processor_bind() and pset_bind()?

A: You can get the differences between two functions by seeing the

manual:

# man processor_bind

# man pset_bind

101 Q: 我們有一個(gè)產(chǎn)品在移植到SOLARIS的過(guò)程中出現(xiàn)了大量難以理解的問題,請(qǐng)給

我們現(xiàn)場(chǎng)支援一下,非常感謝!使用Forte Develop6編譯C++程序的時(shí)候出現(xiàn)

以下信息:

"mit/../teglobal.h", line 39: Warning (Anachronism): Attempt to redefine TRUE without using #undef.

"mit/../teglobal.h", line 40: Warning (Anachronism): Attempt to redefine FALSE without using #undef.

>> Assertion: (../links/prepexpression.cc, line 65)

while processing mit/multilock.cpp at line 0.

請(qǐng)問是什么意思,難道編譯器還要assert嗎?

A: CC 編譯器要求被編譯的文件以兩個(gè)新行結(jié)束,請(qǐng)?jiān)谙嚓P(guān)頭文件末尾加上新行。

102 Q: solaris的問題:激活小鍵盤上的Numlock,激活中文輸入法,按小鍵盤上的0

鍵,中文輸入法自行關(guān)閉,請(qǐng)問是何原因?

A: You can solve the problem you metioned by trying the following three

ways:

1. Make sure using GB locale, instead of GBK.

2. Visit http://sunsolve. to get the "recommended patches"

package for the your solaris platform, and add it.

3. If possible, you can change the solaris platform from solaris 2.7

to solaris 2.8

103 Q: 有關(guān)在SOLARIS上使用NETSCAPE問題

問題描述:

1.在SOLARIS2.6上安裝NETSCAP4.04后,安裝提示成功后,運(yùn)行netscape,出現(xiàn)以

下錯(cuò)誤信息:

xlib:connection to "0.0" refused by server

xlib:client is not authorized to server

can't open display : :0.0

2.在SOLARIS2.6上安裝Acroread后,如何設(shè)置能直接點(diǎn)擊打開.pdf文件,而無(wú)需

每次要先啟動(dòng)Acroread,然后再打開? 請(qǐng)問上述問題如何解決?

A: 1. You run the command:

#xhost:0.0

and then, you can use NETSCAPE In the terminal, in which the

netscape is launched, please set the envrionment DISPLAY as :0.0

2. Actually, I don't know how to configure it. If you are interested

in it. You can read some topics in AnswerBook2 User Collection.

104 Q: syslogd 如何支持漢字? syslogd 好像會(huì)把漢字拆分成兩個(gè)字節(jié),并去掉高位

如何解決?

A: How the background service provider syslogd supports character set

depends on the locale environment it starts. So, if you want Chinese

characters transferring by syslog. You can restart syslogd in

Chinese environment by issuing the following commands:

# LANG=zh; export LANG # set the locale environment in Chinese.

# kill -9 `cat /etc/syslog.pid` # to kill the former syslogd

# /usr/sbin/syslogd

If you want syslogd to support Chinese characters whenever the

machine boot. Put the attacted file in the /etc/rc3.d directory.Make

sure this file's mode is "rwxr-xr-x" and the owner is root.

105 Q: 我的工作站的交換分區(qū)分的太小了,除重裝系統(tǒng)外,是否有其它辦法將空間調(diào)

整一下。

A: You can extend your swap region by issueing the following command:

#mkfile-m

#swap -a

Note: theshould be the full path name.

106 Q: 用vi打開一個(gè)script文件,發(fā)現(xiàn)里面有非法字符^M,在vi命令行如何全程替代

掉該字符?我試了一下用以下命令來(lái)做,卻不行:0,$s/^M//

A: 1,$s/^M//g ,其中,^M是 ctrl+V ,ctrl+M,或者,用下面這個(gè)命令。

%unix2dos $filename > $newfilename

107 Q: How to add space to a filesystem in solaris2.5.7 ? When I patchadd a

patch,It tell me that there is no sufficient filesystem capacity.

A: It seems like your root partition too small. Please check it

availiable size. If it is small, I think you would better to

reinstall the system. Please store all the data in the disk.

In the new installation, you need really to partitions, one is for

swap, and another is for /. The swap partition /tmp needs about 200M

to 500M. Then all the left should be given to /.

108 Q: 請(qǐng)教關(guān)于Solaris Patch的問題。我們?cè)诎惭b一些軟件時(shí),經(jīng)常需要先安裝一

些Patch,有一事不明,向您請(qǐng)教一下,比如某個(gè)軟件需要Patch : 107546-02,

現(xiàn)在我的機(jī)器上已經(jīng)安裝107546-08,是不是就不用再安裝107546-02了Patch

后面的那部分是什么意思?是不是大的數(shù)字可以包含小的數(shù)字的功能了? 同一

個(gè)Patch的不同版本之間會(huì)不會(huì)有沖突?

A: You are right. If you have installed a bigger version of the same

patch, it not necessary for you to install the smaller one. The

bigger version will override the earlier one if it installed before.

You need not worry about any collision.

109 Q: 關(guān)于sun的SunNet 我目前想了解關(guān)于sun的SunNet。我從sun的網(wǎng)站上了解到

SunNet已經(jīng)被合并入到Solstice里了,我目前想試著把我做得程序集成到

SunNet或Solstice里,我看了Slostice得White Paper,但里邊只提到了一點(diǎn)點(diǎn)

相關(guān)得Api,我從哪里,怎么才能到比較完全得文檔呢?

A: To my knowledge, you can go to the following for a detailed info:

http://www./software/solstice/em-products/network/sunnetmgr.html.

110 Q: 關(guān)于SUN機(jī)器root口令丟失問題,如何解決?

A: 辦法如下:

利用SOLARIS的啟動(dòng)盤來(lái)啟動(dòng),然后把硬盤mount上去,修改硬盤上原etc目錄

下的shadow文件,將root項(xiàng)里的password域內(nèi)容刪除,變成無(wú)密碼。然后重新

啟動(dòng)主機(jī),以無(wú)密碼的root登陸后,重新設(shè)置root口令。具體步驟如下:

1.把你的solaris光盤放進(jìn)cdrom

2.鍵入stop+a

3.當(dāng)出現(xiàn)'ok'字樣時(shí),鍵入boot cdrom -s

4.cd /tmp/root

5.mkdir /tmp/root/xxx (xxx是什么鬼東西就無(wú)關(guān)緊要了)

6.mount /dev/dsk/c0t0d0s0 /tmp/root/xxx (在這里c0t0d0s0是你的root盤)

7.運(yùn)行csh

8.setenv TERM vt220

9.cp /tmp/root/xxx/etc/shadow /tmp/root/xxx/shadow/shadow.bak

10.vi /tmp/root/xxx/shadow,并且將root項(xiàng)里的password域刪除即可。

11.重啟動(dòng),你就可以以無(wú)密碼的root登陸了,登錄后,更改root的密碼。

111 Q: In solaris 2.6. when i use command "killall" ,all process started in

CDE will be killed and the eviroment will change to CDE login. I

looked up the man manual about "killall" ,it told me that "only root

can use the command".But I really use it with common id.In

solaris7 and solairs 8, with common id,i can't use the common.can

you tell me why i can execute "killall" successfully in solaris 2.6?

A: Just see the access mode of /usr/sbin/killall. If you can use it

with a common account identity, the access mode should be x-rsx-rx-r.

If you can not use it in a common account identity, the mode should

be x-r--r--r. You can change the mode as you like, whenever in 2.6,

or 2.7 or 2.8.

112 Q: I downloaded the SDM2.3 from the Download Center of "www."

,read the White Paper and web detailed describing.But it is only the

outlook of the software. I need the detailed document about how to

integrated my own network management application to Solstice.

A: I transfer this messag to Sun Service in Guangdong.

113 Q: 請(qǐng)問有沒有磁盤管理工具。我們有一臺(tái)E450,有5塊硬盤,想做RAID,但是沒有工

具.

A: If the machine's OS is solaris 2.8, the storage management software

is also installed in you machine. You can make the RAID by issuing

the command family: /usr/sbin/meta*; If you are not so familiar with

these commands. I can do it for you. or you can use solstice

disksuite, it is a GUI tool.

114 Q: 怎樣強(qiáng)制更改NIS客戶端的本地NIS數(shù)據(jù)表?有時(shí)候NIS客戶端和NIS服務(wù)器端有

時(shí)會(huì)出現(xiàn)不一致的情況.NIS服務(wù)器和NIS slave 服務(wù)器也會(huì)出現(xiàn)這種情況。

A: 你可以用yppush和 ypxfr 來(lái)做這種工作,更常見的方法是把它們寫進(jìn)cron,定

期更新,具體步驟請(qǐng)查閱Answerbook.

115 Q: 為了將工作站設(shè)為從DHCP動(dòng)態(tài)分配IP,并且將主機(jī)名由"unknown"改為原名

修改了/etc/init.d/rootusr,將dhcpinfo后面三行(不是四行)注釋掉;

hostname=`/sbin/dhcpinfo Hostname`

# case $? in

# 0) [ -z "$hostname" ] && hostname='unknown' ;;

# 2) try_dhcp=no ;;

esac

重啟后,提示:

/sbin/rcs:ysntax error at line 143 : 'esac' unexpected

INIT:cannot creat /var/adm/utmp or /var/adm/utmpx

INIT:SINGLE USER MODE

輸入root口令后,只能運(yùn)行在單用戶模式,且vi、ls等都不能用(#vi:not found)

如何才能打開/etc/init.d/rootusr文件進(jìn)行修改,恢復(fù)正常狀態(tài)。

A: 請(qǐng)找一個(gè)SOLARIS的安裝啟動(dòng)盤,使用以下方法可以修改rootusr文件,步驟如

下:

1.把你的solaris光盤放進(jìn)cdrom

2.鍵入stop+a

3.當(dāng)出現(xiàn)'ok'字樣時(shí),鍵入boot cdrom -s

4.cd /tmp

5.mkdir /tmp/xxx (xxx是什么東西無(wú)關(guān)緊要,隨便取一個(gè)名字,如test)

6.mount /dev/dsk/c0t0d0s0 /tmp/xxx (在這里c0t0d0s0是你的root盤)

7.運(yùn)行csh

8.setenv TERM vt220

9.vi /tmp/xxx/etc/init.d/rootusr,把esac那行也注釋掉即可。

10.把solaris光盤拿出,reboot,重啟動(dòng)即可。

116 Q: 一臺(tái)Ultra60工作站,其固定IP為10.11.105.247,用ifconfig hme0 dhcp

start總是失敗,如下所示。

# netstat -a|grep 4999

# ifconfig hme0 dhcp start

May 7 20:11:11 hwMusa01 dhcpagent[478]: ERROR! Address 10.11.105.147

is already in use ifconfig: internal error in DHCP agent

# netstat -a|grep 4999

localhost.4999 *.* 0 0 0 0 LISTEN

localhost.4999 localhost.1023 32768 0 32768 0 TIME_WAIT

抓包發(fā)現(xiàn)是dhcp服務(wù)器offer的IP地址10.11.105.147被decline了。手工運(yùn)行

dhcpagent,提示4999端口被使用了。以前此工作站曾配置為固定IP:

10.11.105.147,但現(xiàn)在已改為10.11.105.247并重啟過(guò)多次。請(qǐng)問,可能是什

么原因?qū)е耫hcp失????

A: 導(dǎo)致問題出現(xiàn)的原因是,由于客戶機(jī)在申請(qǐng)?jiān)瓉?lái)的被保留分配的IP時(shí),服務(wù)器

發(fā)現(xiàn)這個(gè)IP不能夠被使用(已經(jīng)有其它機(jī)器使用了這個(gè)IP地址)。使客戶機(jī)申

請(qǐng)失敗,并且使其中的某些進(jìn)程不能正常退出,繼續(xù)占用了端口4999而使后面

的申請(qǐng)不能進(jìn)行。辦法是找到占用端口4999的進(jìn)程,殺掉即可。找到這個(gè)進(jìn)程

的辦法是,這個(gè)申請(qǐng)進(jìn)程是帶有dhcp字樣的。

# ps -e | grep dhcp

會(huì)出現(xiàn)一到兩個(gè)進(jìn)程號(hào)。驗(yàn)證這些進(jìn)程是否占用了4999是看進(jìn)程打開的文件:

# /usr/proc/bin/pfiles #pid

早到進(jìn)程然后殺掉。這樣就可以繼續(xù)啟動(dòng)Client 端的dhcp申請(qǐng)。注意,修改

服務(wù)器的設(shè)置使新的申請(qǐng)可以成功。

117 Q: 我們有一臺(tái)Natra T1,它的/tmp目錄已經(jīng)長(zhǎng)到90%,如果目錄滿了是否會(huì)使系統(tǒng)

運(yùn)行異常.(因?yàn)槲覀冞\(yùn)行的業(yè)務(wù)不能停,故不能重啟SUN機(jī)器來(lái)讓系統(tǒng)清空該目

錄,也不能直接清空該目錄,應(yīng)為應(yīng)用程序正在運(yùn)行.)下面是一些數(shù)據(jù):

# df -k

Filesystem kbytes used avail capacity Mounted on

/proc 0 0 0 0% /proc

/dev/dsk/c0t0d0s0 1258491 51942 1143625 5% /

/dev/dsk/c0t0d0s6 1612343 500741 1063232 33% /usr

fd 0 0 0 0% /dev/fd

/dev/dsk/c0t0d0s3 33099 9211 20579 31% /var

/dev/dsk/c0t0d0s7 13550703 838475 12576721 7% /export/home

/dev/dsk/c0t0d0s5 30743 10319 17350 38% /opt

/dev/dsk/c0t0d0s1 548687 369368 124451 75% /usr/openwin

swap 627864 563360 64504 90% /tmp

# cd tmp

# ls

ps_data

# ls -a -l

total 98

drwxrwxrwt 6 sys sys 443 May 7 15:29 .

drwxr-xr-x 22 root root 512 Mar 20 17:45 ..

drwxrwxr-x 2 root root 176 Feb 27 23:18 .X11-pipe

drwxrwxr-x 2 root root 176 Feb 27 23:18 .X11-unix

drwxrwxrwx 2 root root 179 Feb 27 23:18 .pcmcia

drwxrwxrwt 2 root root 327 Feb 27 23:18 .rpc_door

-rw-rw-r-- 1 root sys 5056 Feb 27 23:18 ps_data

# cd .pcmcia

# ls -a -l

total 32

drwxrwxrwx 2 root root 179 Feb 27 23:18 .

drwxrwxrwt 6 sys sys 443 May 7 15:35 ..

prw-rw-rw- 1 root root 0 Feb 27 23:18 pcram

# cd ..

# pwd

/tmp

# cd .rpc_door

# ls -a -l

total 32

drwxrwxrwt 2 root root 327 Feb 27 23:18 .

drwxrwxrwt 6 sys sys 443 May 7 15:36 ..

Drw-r--r-- 1 root root 0 Feb 27 23:18 .rpc_100029.1

Drw-r--r-- 1 root root 0 Feb 27 23:18 .rpc_100029.2

Drw-r--r-- 1 root root 0 Feb 27 23:18 .rpc_100029.3

# cd ..

# cd .X11-pipe

# ls -a -l

total 32

drwxrwxr-x 2 root root 176 Feb 27 23:18 .

drwxrwxrwt 6 sys sys 443 May 7 15:37 ..

-rw-rw-rw- 1 root root 0 Feb 27 23:18 X0

# cd ..

# ls

ps_data

# cd .X11-unix

# ls -al

total 32

drwxrwxr-x 2 root root 176 Feb 27 23:18 .

drwxrwxrwt 6 sys sys 443 May 7 15:38 ..

srwxrwxrwx 1 root root 0 Feb 27 23:18 X0

等待您的回答,謝謝

A: 我認(rèn)為是系統(tǒng)統(tǒng)計(jì)信息錯(cuò)誤的, 本人的經(jīng)驗(yàn)是當(dāng)/tmp的使用率超過(guò)10%時(shí),系統(tǒng)就

變的很慢了。出現(xiàn)這種情況,首先,要檢查系統(tǒng)中運(yùn)行的程序有沒有不停分配內(nèi)存,

卻沒有釋放(指自己開發(fā)的程序)。另外看一下系統(tǒng)對(duì)/tmp的swap交換情況。使用工

具sar 和iostat 都可以看到。關(guān)于sar和iostat的用法, 可以看man即可。

118 Q: 有一用MOTIF 寫的程序,運(yùn)行之后不能顯示中文(亂碼),由于顯示的信息是

不固定的,故不能使用資源文件.懷疑程序中與創(chuàng)建字體時(shí)使用了以下的函數(shù)

有關(guān),但注釋掉后也一樣:

font1=XLoadQueryFont(XtDisplay(toplevel), "-*-screen-bold-r-normal--12-*");

font2=XLoadQueryFont(XtDisplay(toplevel), "-*-screen-bold-r-normal--14-*");

font3=XLoadQueryFont(XtDisplay(toplevel), "-*-screen-bold-r-normal--16-*");

fontlist=XmFontListCreate(font1, "charset1");

fontlist=XmFontListAdd(fontlist, font2, "charset2");

fontlist=XmFontListAdd(fontlist, font3, "charset3");

運(yùn)行環(huán)境是ULTRA 60 ,Solaris 2.6 ,安裝了中文環(huán)境。編譯環(huán)境是SUN C++ 4.0 。

還懷疑與LANG 相關(guān),曾試過(guò)設(shè)置為zh ,chinese 等也不行,請(qǐng)教此問題如何解決?

A: 實(shí)際上,關(guān)于選擇字體和字符集可以看這個(gè)資料,使

用系統(tǒng)提供的標(biāo)準(zhǔn)工具來(lái)從中間找到系統(tǒng)中存在的字體和字體的名稱。這個(gè)資料在

Answer Book 的System Administration Collection 中。 實(shí)際上,上面的問題不

出現(xiàn)在字體的選擇上面, 而是在MOTIF中在選擇框的使用設(shè)置中還要設(shè)置一次字體

119 Q: 請(qǐng)問SUN的E250以上機(jī)器支持“雙機(jī)熱備+磁盤陣列”的使用方式嗎?Ultra系

列的機(jī)器是否也能支持呢?

A: SUN的E250以上機(jī)器支持“雙機(jī)熱備+磁盤陣列”的使用方式,可以使用

SunCluster軟件實(shí)現(xiàn);Netrat系列電信服務(wù)器也支持;Ultra系列的機(jī)器,不

在支持的列表中。但是,“雙機(jī)熱備+磁盤陣列”的具體含義應(yīng)該搞清楚。推

薦的文檔在sun cluster collection 中。

120 Q: 我在一個(gè)JAVA程序中打開50個(gè)SOCKET端口,結(jié)果出現(xiàn)異常:

java.net.SocketException:Too many open files

請(qǐng)問如何解決此問題?謝謝!另外,請(qǐng)問在一個(gè)JAVA進(jìn)程中可以同時(shí)啟動(dòng)的線

程數(shù)是多少?最大線程數(shù)受什么限制?能否達(dá)到240個(gè)線程?謝謝!如上問題

如果可以通過(guò)修改配置來(lái)解決的話,會(huì)有什么樣的負(fù)面影響?

A: You have two ways to modify the limit number of files that a process

can open simutanously.

One: modify the /etc/system file add the following entry:

set rlim_fd_cur = #n

#n is the number you want. Should be no more than 1024.

You should reboot the machine.

Two: Use the system command: ulimit

$ulimit -n #n

Note: You should use B-shell.

And using the same terminal session(in the same terminal

window) to run the your application program( to guarantee your

application process is a child process of the setting

terminal.)You can man ulimit to see the detailed usaged.

The disadvantage brought by incread the file limite for a

process or the whole system is increasing the system memory

usage. But, for today's machine, this disadvantage is not too

expensive. (William said:) There is no limit for max open

socket number in Java. But the operating system has a limit for

max open file descriptors.A socket resource is treated as a

file descriptor in Unix. The previous email answered your

question. You can try as said.

121 Q: 我想把一個(gè)HP平臺(tái)上運(yùn)行的B SHELL 腳本在SOLARIS 2。6上運(yùn)行,但是出現(xiàn)了

問題:要運(yùn)行的腳本部分:

command_count = 0

command_item[$command_count]=check_AutoRaid

command_count=`expr $command_count + 1`

command_item[$command_count] = check_system_resource

command_count=`expr $command_count + 1`

command_item[$command_count]= check_diskspace

command_count=`expr $command_count + 1`

command_item[$command_count]= check_bill_record

command_count=`expr $command_count + 1`

command_item[$command_count]= get_max_CAPS

command_count=`expr $command_count + 1`

command_item[$command_count]= check_DataBase

command_count=`expr $command_count + 1`

command_item[$command_count]= check_netstate_SMP

command_count=`expr $command_count + 1`

command_item[$command_count]= check_work_dir

command_count=`expr $command_count + 1`

command_item[$command_count]= check_dir_OAM

command_count=`expr $command_count + 1`

command_item[$command_count]= check_dir_others

command_count=`expr $command_count + 1`

command_item[$command_count]= check_files_informix

command_count=`expr $command_count + 1`

command_item[$command_count]= check_crontab

command_count=`expr $command_count + 1`

出現(xiàn)的問題:

./scp.sh: command_item[0]: not found

./scp.sh: command_item[1]: not found

./scp.sh: command_item[2]=: not found

./scp.sh: command_item[3]=: not found

./scp.sh: command_item[4]=: not found

./scp.sh: command_item[5]=: not found

./scp.sh: command_item[6]=: not found

./scp.sh: command_item[7]=: not found

./scp.sh: command_item[8]=: not found

./scp.sh: command_item[9]=: not found

./scp.sh: command_item[10]=: not found

./scp.sh: command_item[11]=: not found

./scp.sh: bad substitution

請(qǐng)問這是否因?yàn)槠脚_(tái)的問題引起的

A: I have looked up several documents about B Shell. There is no array

definition and usage in original B-shell. It seems like B-shell is

expended in HP platform. I think you should modify the source script to

make it pure B-shell and then can run in Solaris.

122 Q: 現(xiàn)在我們有一個(gè)特殊的需求,需要在編譯時(shí),指定一字節(jié)對(duì)齊(缺省好象是八

字節(jié)對(duì)齊的),請(qǐng)問我們使用哪一個(gè)編譯選項(xiàng)能達(dá)到這個(gè)目的?

A: There are some differences between different c/c++ compiler in their

options. Actually, I don't know so much about the options used in

gcc, but I think you can get some documents from the web site

http://www.. We have detailed document about Solaris C. If

you want these documents, you can contact me or get from

http://docs., in which site you find workshop collection.

123 Q: 有如下幾個(gè)問題請(qǐng)幫助解決:

1、solaris用戶登錄以后,總是彈出很多控制臺(tái)窗口和瀏覽器窗口等,請(qǐng)問:

如何定制用戶的登錄界面和環(huán)境,讓其登錄后只彈出一個(gè)窗口。

2、請(qǐng)問如何再solaris上設(shè)置dns?

3、如果想再solaris上將固定ip方式改為自動(dòng)獲取ip的dhcp方式,需要修改哪

些文件?而如果將工作站設(shè)為dhcp服務(wù)器,又如何設(shè)置?最好是能發(fā)一份

solaris這方面的配置資料,謝謝

A: 1. 刪掉不想要的窗口,選擇 exit 退出桌面環(huán)境,系統(tǒng)提示是否保存當(dāng)前桌

面,回答是。.

2. 手邊剛好有一本教程,請(qǐng)參照進(jìn)行配置.

dnsconfig

3. You can create a empty file dhcp.hme0 in /etc directory. If you

don't want to reboot your machine, run the command:

# ifconfig hme0 dhcp start

124 Q: 我們用一臺(tái)Netra T1,操作系統(tǒng)為solaris7,運(yùn)行一個(gè)應(yīng)用程序。

用df -k /tmp查看swap空間,發(fā)現(xiàn)一些奇怪的現(xiàn)象:

應(yīng)用程序啟動(dòng)時(shí):

文件系統(tǒng) 千字節(jié) 用了 可用 容量 掛接在

swap 1158400 8 1156392 1% /tmp

運(yùn)行1小時(shí)后:

文件系統(tǒng) 千字節(jié) 用了 可用 容量 掛接在

swap 1158392 8 1158384 1% /tmp

再過(guò)一段時(shí)間:

文件系統(tǒng) 千字節(jié) 用了 可用 容量 掛接在

swap 1158276 8 1158268 1% /tmp

再過(guò)一段時(shí)間:

文件系統(tǒng) 千字節(jié) 用了 可用 容量 掛接在

swap 1158392 8 1158384 1% /tmp

其中,1158400為swap的總空間大小,為什么總的swap空間會(huì)變化。如果swap不斷減少

,總有一天會(huì)用完,該怎么辦。帶著疑惑向您請(qǐng)教

A: Actually, the sample data in your table look very healthy. Don't

trust so much about these statistics numbers. In fact, if the gloss

number of swap file system reduced not big, the system can run well.

If the number decrease much, it means a process use a lot of swap

space. If you kill the process, the number will increase some.

125 Q: 在WinNT中有任務(wù)管理器, 在Linux上面有top程序, 可以查看一個(gè)進(jìn)程占用

的CPU時(shí)間,內(nèi)存,當(dāng)前運(yùn)行的線程數(shù)等,但是在Solaris上面如何查詢這些信

息呢?

A: There are two ways to see a process's cpu occuptation.

1. run the command in a terminal or console: #ps -elf

2. In cde interface, there is a graphic utility which you can find

in tool(or 工具) column

126 Q: 請(qǐng)問: 設(shè)置了一個(gè)普通用戶,該用戶設(shè)置有相應(yīng)的$PATH環(huán)境變量,用su命令(不

是su -)切換到超級(jí)用戶以后,原來(lái)的$PATH變量的值發(fā)生了改變,導(dǎo)致了應(yīng)用有

些不正常,請(qǐng)問這如何解決?

A: 實(shí)際上,使用su命令切換到超級(jí)用戶,環(huán)境變量$PATH只受文件

/etc/default/su中SUPATH條目的控制。現(xiàn)在,你可以參照此文件對(duì)SUPATH條

目進(jìn)行修改即可滿足你的要求。

127 Q: 如果采用“Cluster”機(jī)制進(jìn)行雙機(jī)熱備,兩臺(tái)機(jī)器之間需要通過(guò)心跳線相連

,請(qǐng)問這些心跳線是如何連接的?也就是說(shuō),每臺(tái)機(jī)器有兩個(gè)網(wǎng)口做心跳偵聽,

兩臺(tái)機(jī)器間的心跳網(wǎng)線是交叉直接相連,還是可以通過(guò)“Lanswitch”或“Hubor”間接相連?

A: 交叉568a-568b

128 Q: 我們的程序需要建立很多socket連接,但因?yàn)椴僮飨到y(tǒng)的限制,只能建立有限

的連接。如何修改系統(tǒng)參數(shù),提高操作系統(tǒng)對(duì)文件描述符數(shù)量的限制。

A: You have two ways to modify the limit number of files that a process

can open simutanously.

One: modify the /etc/system file add the following entry:

set rlim_fd_cur = #n

#n is the number you want. Should be no more than 1

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多