亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2667 | 回復: 0
打印 上一主題 下一主題

solaris 經(jīng)典120問!! [復制鏈接]

論壇徽章:
1
榮譽版主
日期:2011-11-23 16:44:17
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2008-06-15 11:21 |只看該作者 |倒序瀏覽
solaris 經(jīng)典120問!!


1. Q: Solaris 的系統(tǒng)配置文件一般在什么地方?
   A: 可以查看/etc/system文件,里面有一些solaris啟動時默認加載的選項,包括
      共享內(nèi)存大小等的設置。
2. Q: 在solaris中,用戶默認的Shell在什么文件中規(guī)定?
   A: 可以查看/etc/passwd中,用戶默認的shell在這里規(guī)定。
3. Q: 如果solaris不幸忘記了root密碼,如何解決?
   A: 可以有如下兩種情況
      1. 工作站只有root用戶,無其他用戶。
      2. 工作站除了root用戶以外,還有其他的用戶
      1. 如果連接了網(wǎng)絡,我們可以采用遠程緩沖溢出的方法,但是這樣的方法不屬
         于“經(jīng)典”方法,且有的遠程緩沖溢出具有一定的破壞性,不建議使用。還
         有一種方法就是采用SUN公司自帶的光盤采取引導,建議采取這種方法:
         1. boot cdrom -s
         2. fsck /dev/dsk/c0t0d0s0 (取決于根分區(qū)的設備)
         3. mount -F ufs /dev/dsk/c0t0d0s0 /mnt
         4. TERM=ansi; export TERM
         5. 編輯/mnt/etc shadow文件,把root對應的口令去掉。
         6. 重啟后的root的口令為空。
      2. 如果還有普通用戶,方法可以采用本地緩沖溢出,這種方法雖然破壞性小,
         但是也有損毀硬盤引導區(qū)的危險,建議采用“文件連接”錯誤是獲得root權(quán)
         限,這種方法沒有什么危險性。
4. Q: 有時候用vi編輯器的時候,顯示窗口過大,如何處理?
   A: 只需要用鼠標拖曳終端窗口,使其縮小,即可解決。
5. Q: 共享內(nèi)存大小如何設置?
   A: 在system文件的最后一行加入Set shmsys:shminfo_shmmax=XXX
      /etc/set shmsys:shminfo_shmmin=XXX
      這里的XXX是代表共享內(nèi)存的大小。單位:字節(jié)
      共享內(nèi)存一般為內(nèi)存的一半
      例如內(nèi)存為512M
      設置應為512/2*1024*1000=262144000
6. Q: root用戶的配置文件在什么地方?
   A: root用戶的配置文件和其他用戶的配置文件有些不同,它在/etc/profile文件
      中規(guī)定。
7. Q: SUN solaris 在遠程X-win pro下無法以root進行登陸,如何解決?
   A: 直接以root在終端上登錄的時候,執(zhí)行/etc/default/login腳本。在這個腳本
      中限制了在遠程終端上不能直接以用戶root登錄,如果想這樣,修改此腳本,
      將下面這一行注釋掉即可
      CONSOLE=/dev/console
8. Q: 在solaris下,如何查看網(wǎng)絡是否配置成功?
   A: 可以采用命令Ifconfig -a來查看,如果網(wǎng)卡綁定ip成功,而不是顯示0.0.0.0
      就證明網(wǎng)卡配置基本無誤,主要檢查網(wǎng)絡介質(zhì)(網(wǎng)線,RJ45插頭...)是否損壞。
9. Q: 如果敲錯一個命令如何結(jié)束它呢?
   A: solaris和SCO有少許不一樣,solaris可以采用ctrl+C來結(jié)束,而不是SCO的
      ctrl+Del
10.Q: solaris的聯(lián)網(wǎng)中,網(wǎng)關如何配置?
   A: solaris的網(wǎng)關設置和SCO的設置不一樣
      SCO:
      /etc/gateways
      ; name1 gateway name2 metric value ;
      所有中間的很長的空均為TAB
      Net,host  表示路由指向是網(wǎng)絡還是主機,net和host是關鍵字
      Name1     目的網(wǎng)絡名或主機名
      Gateway   關鍵字
      Name2     網(wǎng)關名或網(wǎng)關ip地址
      Metric    關鍵字
      Value     跳數(shù)
      Passive   關鍵字,表示被動方式,路由器不叫換路由信息
      Active    關鍵字,表示主動方式,路由器交換路由信息
      External  關鍵字,表示外部方式,其他進程已安裝了路由
      例如:
      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)關。
11.Q: 如何在網(wǎng)上安裝Solaris?
   A: 假設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沒有默認的sysidcfg和autocfg目錄,需要自
   己建立,而且OK boot net即可
12.Q: DHCP in Solaris8?
   A: 1. # touch /etc/dhcp.hme0,hme0:請用相應的網(wǎng)卡設備名;
      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第一行加入如下語句:
        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)容為你的機器名
       5. 創(chuàng)建/etc/dnsservers:129.9.111.100 10.15.1.3
       之所以要修改,究其原因我們的DHCP服務器支持的協(xié)議可能比較老,不能返回給
       客戶端DNSdomain,DNSServer,Nodename;
13. Q:SUN上如何編譯動態(tài)庫?
    A:
    CC=cc
    C++=CC +w
    .SUFFIXES:.cpp
    .cpp.o:
    $(C++) -g  -c -Kpic $
14. Q: 在sun工作站上安裝solaris軟件時沒有安裝網(wǎng)卡,安裝完成后應該修改那些文
       件添加網(wǎng)卡?
    A:
    1. #reboot --r 或者ok boot -r
    2. 在1.成功找到你新加的硬件之后,再執(zhí)行相應的硬件設置命令,對網(wǎng)卡執(zhí)行:
       ifconfig hme0 ; [ipmask],其中hme0是你網(wǎng)卡的設備名,可以通過dmesg知
       道你的網(wǎng)卡設備名.
15. Q: 如何設置DNS?
    A: (1)/etc/nsswitch.conf的hosts解析加上nis或/和dns,內(nèi)容如下
       hosts:    files    dns
       (2)設置到DNS服務器網(wǎng)關于/etc/defaultrouter,內(nèi)容如下
       10.11.43.254
       (3)設置DNS服務器的IP地址/etc/resolv.conf,內(nèi)容如下
        nameserver    10.15.1.3
        nameserver    129.9.111.100
        domain        huawei.com
16. Q: Ultra60工作站從外掛光驅(qū)啟動?
    A: Ultra60 工作站缺省配置是內(nèi)置光驅(qū),用外掛光驅(qū)重新安裝Solars時,用boot
       cdrom命令則不能從光驅(qū)啟動,屏幕上打印錯誤信息:Drive not found.
       原因如下:由于Ultra60工作站缺省支持內(nèi)置光驅(qū),cdrom的缺省配置是內(nèi)置光
       驅(qū)的物理設備名。當使用外掛光驅(qū)時,當使用boot cdrom命令時,cdrom的替
       換為內(nèi)置光驅(qū)的物理設備名。這就是不能從光驅(qū)啟動的原因。
       解決辦法如下:
       (1)stop+a命令
       (2)在ok提示符下輸入:probe-scsi-all
          則出現(xiàn)硬盤、光驅(qū)、磁帶機等設備的實際物理名。
          如:/pci@1f,4000/scsi@3,1
          cdrom
       (3)在ok提示符下輸入:devalias
          則出現(xiàn)硬盤、光驅(qū)、磁帶機等設備的缺省設置。
          如:cdrom /pci@1f,4000/scsi@3/disk6,0:f
          這是缺省配置,用boot cdorm命令時,cdrom被解釋為
          /pci@1f,4000/scsi@3/disk6,0:f
          而/pci@1f,4000/scsi@3/disk6,0:f指示的是內(nèi)置光驅(qū)的設備名,
          因此不能從外掛光驅(qū)啟動!
       (4)在ok提示符下輸入:boot /pci@1f,4000/scsi@3,1/disk6,0:f
          說明:[boot后的參數(shù)參看(2)和(3)中的cdrom的設備名,由兩者組合而來
          即可正確的從外掛光驅(qū)啟動。
17. Q: 一臺Sun Ultra80工作站安裝SunOS 5.6失敗,請問其原因以及如何避免?
    A: 硬件環(huán)境為Ultra-80/2CPU(450M)/1harddisk(18G)/2G Memory,從網(wǎng)絡啟動安
       裝SunOS 5.6。安裝過程中途中斷并出現(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’都無法使系統(tǒng)啟動,提示如下:
        Can not open Kernel/unix
        input filename [Kernel/unix]:
        只有重新從網(wǎng)絡啟動。這是由于CPU硬件結(jié)構(gòu)與Solaris系統(tǒng)不兼容造成的,
        需要補丁。這個問題不僅僅是在Ultra80的機器上,如果Ultra60使用了SUN的
        新推出的高速CPU(400M以上,一般為450M)且操作系統(tǒng)為Solaris 2.6或者
        Solaris 2.5.1,也會出現(xiàn)類似問題。如果工作站使用的是這種高速CPU,在
        隨新機器一起的附件中會有一本手冊:Installing Solaris 2.5.1 or
        Solaris 2.6 Software on 419+ MHz Systems,其中詳細描述了如何解決這
        個問題(在zh-6頁)。另外,附件中還有一張補丁光盤,名字叫做:
        Operating Environment Installation CD May 1999,此光盤專門用于解決
        此問題.
18. Q :在solaris上如何進行數(shù)據(jù)的備份和恢復?
    A: 備份整個文件系統(tǒng),也稱作完全備份(full dump);在完全備份的基礎上備
       份修改過的文件,稱作漸進備份(incremental dump);
ufsdump
ufsdump命令用于備份文件系統(tǒng),可以完全備份也可以漸進備份。ufsdump命令的格式
為:/usr/sbin/ufsdump [options] dump_device  files_to_dump
options包括:
0-9:指定備份的級別。0為最低,即完全備份;9為最高。假設當前備份級別為i,那
么ufsdump命令在執(zhí)行時將尋找最近一次級別等于i或小于i的備份,將以前備份過后修
改過的文件備份下來。例如,星期一執(zhí)行了一次級別為2的備份, 星期二執(zhí)行了一次
級別為4的備份,那么當星期三執(zhí)行級別為3的備份時備份文件中將包括自星期一備份
以來所有修改過或新創(chuàng)建的文件。如果星期三執(zhí)行級別為4的備份,那么備份文件中將
包括自星期二備份以來所有修改過或新創(chuàng)建的文件。
f:指定備份的設備,例如/dev/rmt/0;
u:更新備份記錄(/etc/dumpdates)。使用這一選項后ufsdump將創(chuàng)建或更新
/etc/dumpdates文件,文件內(nèi)容包括文件系統(tǒng)名、備份級別、和備份時間,例如:
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
備份前的準備工作
重新啟動系統(tǒng)到單用戶狀態(tài),或?qū)⒁獋浞莸奈募到y(tǒng)卸載下來。
通知所有用戶該文件系統(tǒng)不可用。
#wall
/export/home will be unavailable in two minutes, please log out
Press ctrl-D
對文件系統(tǒng)進行檢查(fsck)。
ufsdump
如前例所示。
如果使用漸進的備份方法,最后實現(xiàn)建立備份計劃,例如:
    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
上例中,每個月作一次完全備份,每個周末對每一周的改動作一次備份,每天的備份
只對當天的改動作備份。這樣作的目的是節(jié)省備份所用的空間。
ufsrestore
ufsrestore用于恢復使用ufsdump命令備份的文件系統(tǒng)。命令格式為:
/usr/lib/fs/ufs/ufsrestore options [arguments] [filename ...]
options包括:
t:備份列表;
x:只恢復命令行中指定的文件;
r:恢復整個備份;
f:指定備份文件所在的設備或目錄;
v:verbose mode,列出備份文件的路徑。
例如:
對備份文件進行列表:
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
...
從備份中恢復指定文件:
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í)行該操作需要指定所要恢復的文件在備份文件中的位置。由于備份文件從卷1開始,
所以可以指定從卷1開始搜索;謴驼麄文件系統(tǒng)下例將一個老的文件系統(tǒng)(/opt)移
到一個新的磁盤分區(qū)(/dev/rdsk/c0t3d0s5)中。首先,卸載老的文件系統(tǒng)并實施備
份:
#umount /opt
#fsck /opt
#ufsdump 0uf /dev/rmt/0 /opt
其次,生成新的文件系統(tǒng),將其安裝到一個臨時目錄(/mnt),并實施恢復:
#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  目標文件名/設備名 備份文件,例如:
tar -cvf backup.tar  *
命令將當前目錄下的所有文件(包括各級子目錄)都打包在backup.tar文件中。
tar -cvf /dev/rmt/0  *
命令將當前目錄下的所有文件(包括各級子目錄)都打包到磁帶上。查看tar文件的內(nèi)
容:tar tvf  目標文件名/設備名,例如:
tar -tvf backup.tar
tar -tvf /dev/rmt/0
將tar文件中的內(nèi)容恢復到指定目錄中去:tar xvf 目標文件名/設備名 [目錄名],例
如:
tar -xvf backup.tar  /home
tar -xvf /dev/rmt/0     /home
如果不指定目錄名則表示當前目錄。
19. Q: 如何在Soraris下面安裝ATM網(wǎng)卡?
    A: 網(wǎng)卡型號:FORE PCA-200EUX/OC3
       操作系統(tǒng):Solaris 2.7
       工作站:SUN Ultra60
一、硬件安裝
     1、工作站關電后,將網(wǎng)卡妥善安裝在一個PCI插槽中;
     2、工作站上電,按STOP and A中斷boot process,到ok提示符;
     3、輸入命令show-devs,顯示系統(tǒng)配置,F(xiàn)ORE網(wǎng)卡的device-pathname應出現(xiàn)在
        配置列表中,形式可能如下:
        /pci@1f,2000/FORE,PCA-200E@2
     4、設備提供光口自環(huán)測試(media loopback)和內(nèi)部自環(huán)測試(internal loopback),
        供檢查設備及安裝是否完好。根據(jù)經(jīng)驗用內(nèi)部自環(huán)測試即可,方法:
        輸入命令  test    /pci@1f,2000/FORE,PCA-200E@2
        待出現(xiàn):pass   0 說明硬件及安裝都正確;
     5、輸入boot命令 ,啟動系統(tǒng)。
二、軟件安裝
     1、軟件安裝需要root權(quán)限;
     2、網(wǎng)卡支撐軟件一般是一個.tar文件提供,解開后在其目錄下有8個子目錄,分
        別為:
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個子目錄,我們要
用的程序在FOREDrv、FOREip下,但各個模塊之間有一定的依賴關系,需要安裝的模塊
有6個: FORECore、FORESpans、FOREDrv、FOREip、FOREUni、FOREclip。安裝過程:
>; 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)絡接口名配置
>;configure_atm
選擇配置ip模塊,得到一個ip interface名,默認為fa0。重啟工作站,可以看到在
/dev下有fa0接口,而網(wǎng)卡的設備名為fatm0。
2、>;adinfo fatm0     可查詢設備硬件信息
   >;adconfig fatm0 可進行設備配置
   >;adstat fatm0    可查詢設備狀態(tài)
   這三個命令較少用到。
3、接口ip地址配置
   ifconfig fa0 ; netmask ; broadcast ; up
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設備的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設備上要做:add nms、act nms、add  route、add atm arp、add ipaccess]
   >;ping 200.200.200.101           如果ping通,則已配置成功。
20. Q: 在哪里能得到有關Solaris的較全面的文檔?
    A:
http://docs.sun.com
21 .Q: 請教sun小型機上的路由跟蹤命令是什么?(HP上是traceroute)謝謝!
    A:這個命令也是traceroute.在/usr/sbin目錄下.
22. Q: 一個GUI程序,在換個不同的SUN環(huán)境時界面就變的難看了,主要是字體影響
      (還有其它影響么?)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啟動過程是如何的?啟動的時候讀那些文件啟動一些服務比如我要在系
      統(tǒng)啟動的時候自動啟動Apache(httpd)服務,應該在哪個文件里面配?
   A: Solaris的啟動是典型的ATT UNIX啟動過程, 在普通的UNIX書記和SUN公司的文
      檔中都有詳細的介紹,這里就不詳談了. 要點室內(nèi)核引導后啟動init進程, init
      按照/etc/inittab 的控制加載各子系統(tǒng), 一般是執(zhí)行 /etc/rc* 之類的腳本.
      這些腳本再執(zhí)行 /etc/rc*.d/ 下的腳本,其中 /etc/rc2.d/S72inetsvc 運行
      inetd, 該后臺進程根據(jù)/etc/inetd.conf 控制網(wǎng)絡服務,所以要自動啟動
      Apache,需要在inetd.conf 中修改或增加 80 端口的啟動命令。(如果不是用80
      ,還要修改/etc/services文件)
24 Q: 有一個問題要請教一下,謝謝!
      一臺SUN服務器,更換IP地址。
      原來地址為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)關/etc/defaultrouter文件,修改后的文件內(nèi)容如下:
         10.108.22.1
      按照上面步驟修改完后REBOOT機器,啟動過程中沒有任何異常,但是機器啟動
      后和別的機器連不上,而且連網(wǎng)關都 PING 不通,請問是什么原因?謝謝!
   A: /etc/hostname.hme0:1 中應當寫你想用的IP地址,而不是機器名. 如果只改IP
      地址,就不需要這個文件.
25 Q: UTF-8和US-ASCII之間的區(qū)別在那里?請舉例說明。
   A: UTF-8 包括 US-ASCII 和多字節(jié)編碼。與普通的多字節(jié)編碼不同,UTF-8的字節(jié)
      長度不固定,對于ASCII, 字節(jié)長度為1, 對于中文,阿拉伯文等,可以是2,3或更
      多字節(jié),這樣能有效節(jié)省存儲空間. 它還與很多傳統(tǒng)編碼標準兼容,所以很受歡
      迎.
26 Q: 如何在腳本里實現(xiàn)修改用戶口令?
   A: 由于修改口令需要從終端讀取用戶口令,所以不能用重定向的辦法,但可以采用
      expect 之類的工具,這些工具建立一個偽終端來模擬輸入, 所以起到用腳本控
      制終端的效果.
27 Q: 我在用EXCEED連到工作站時,開了一個root權(quán)限term,網(wǎng)絡突然中斷,請問如
      何能夠kill該term的進程?
   A: 用xkill 連dtterm 一起殺掉。在桌面上是可以的,在exceed 中不知是否可以。
28 Q: 在Solaris下可用什么命令查看system software info?
   A: 用/usr/bin/pkginfo .
      或者 /usr/bin/prodreg,有圖形界面將注冊過的產(chǎn)品顯示成樹的形狀.
29 Q: 請問:在SOLARIS 8 中,用什么命令看port id?
   A: 我曾就這個問題問過不少人, 有的說 fuser 可以做,但我查 fuser 的手冊
      沒有見到相關選項。lsof 是一個比較理想的工具,可以從sunfreeware.com下
      載。還有一個簡單的辦法是這樣的:
      /usr/proc/bin/pfiles /proc/* >; result.txt
      在到result.txt 中搜索相應 socket port. 也可以自己用awk 過濾 pfiles 的
      結(jié)果
30 Q: 使用FTP時,不能以root用戶登錄系統(tǒng),應修改什么配置文件?
   A: 看一下 /etc/ftpusers  ,如果有root, 刪掉就可以了。
31 Q: 我們的系統(tǒng)需要計算solaris的負載,可以使用uptime輸出的load average嗎,
      如果不用uptime,使用libkstat的load average可以嗎?
   A: 可以.
32 Q: 請問uptime的load average 是如何計算出來的?
   A: 這個問題滿復雜的,我們知道, unix內(nèi)核里有許多種結(jié)構(gòu),如 user,proc等,
      有的還mount到 文件系統(tǒng)中 ,比如 /proc /dev/kstat /dev/ksysm, uptime,
      kstat,sar ,vmstat, prstat 等命令都是通過分析這些結(jié)構(gòu)來進行計算的有
      一個系統(tǒng)函數(shù)叫g(shù)etloadavg ,uptime 就是直接調(diào)用這個函數(shù)的,你也可以試試.
33 Q: 如何得到和設置操作系統(tǒng)內(nèi)核參數(shù)。
   A: 通常,這些參數(shù)在 /etc/system 中配置。
34 Q: 如何得到系統(tǒng)當前動態(tài)運行指標,如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.sun.com
and install it again.
      URL is
http://www.sun.com/forte/cplusplus/buy.html
      cp licence-file install_dir/SUNWspro/licencse_dir/sunpro.lic,node
36 Q: 請問能否在一個slice里掛兩個文件系統(tǒng)?
   A: 不可以.
37 Q: 請問修改了/etc/nodename后,UNIX工作站啟動不了,該如何是好?
   A: 單純修改nodename 不夠,還應修改 /etc/net/*/hosts
38 Q: Solaris的/usr/lib/dmi/snmpXdmid是干什么用的?
   A: Sun Solstice Enterprise SNMP-DMI mapper subagent
      man snmpXdmid 可得.
39 Q: 我的工作站上沒有光驅(qū),想通過遠程安裝,可否?
   A: 可以,有兩種方式:
    1。 將 solaris 光盤內(nèi)容以 ftp 上傳,本地安裝
    2。 做一個install server ,遠程直接安裝。
    3.  用remote光驅(qū)安裝
         (在remote機器)
         # 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公司年機器在并行程序運算方面的能力和相應的平臺。
   A: 您知道,SUN公司在SMP技術(shù)上居于領導地位,所設計的體系結(jié)構(gòu)具有良好的可
      擴展性。只對硬件升級,不改動代碼,往往就可以得到接近線性增長的性能,
      如果有開發(fā)工具的幫助,會取得更好的效果,sun公司提供的 Forte C/C++
      workshop 包含許多工具幫助開發(fā)者分析軟件性能病進行優(yōu)化,Solaris也包含專
      門的庫函數(shù)以提高計算效率,SUN公司有一本白皮書專門介紹高性能計算 您可
      以從 docs.sun.com 得到.書的名字叫: UltraConputing:How to Achieve Peak
      Performance from Solaris Applications..
41 Q: 我在/etc/skel/local.profile作的環(huán)境變量的修改但沒有在新增用戶時候得到
      驗證,為什么?這不是一個模板嗎?(用EXIT退出窗口, 再用新用戶登錄)
   A: 如果是從終端登錄,.profile 會起作用,但如果從CDE 登錄,則系統(tǒng)執(zhí)行
      .dtprofile,要想執(zhí)行 .profile, 還要修改 .dtprofile一般情況下,如果想設
      置一個環(huán)境變量使其對所有用戶生效,可以修改 /etc/profile
42 Q: /etc/system 文件中的namespace指的是什么,與Modules有何關系?system文
      件中哪些參數(shù)將對機器性能有較大影響?
   A: 所有的手冊都警告說修改system文件應當慎重,事實上,也只有在安裝數(shù)據(jù)庫,
      增加新的設備時,才有可能需要修改此文件.所改的參數(shù),也就是你附件中改過的
      那幾個線程數(shù),信號量之類的. 修改參數(shù)值,會影響整個系統(tǒng)的開銷,因為這些值
      所涉及的空間分配是在系統(tǒng)啟動時進行的namespace用于對modules分類, 說明
      中指出了目前支持的幾種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++ 類庫好像包含 STL, 可以參考一下.
      docs.sun.com 上有完整的文檔,可以參考一下.
44 Q: 原來的系統(tǒng)中/usr與 / 在同一個硬盤分區(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: 運行下面這段程序并用vmstat觀察內(nèi)存的使用情況:
      int main(){
      int *p[100];
      int c;
        printf("before new!";
        c=getc(stdin);
        for(int i=0;i
46 Q: 請問在kstat的輸出中,類似avenrun_15min這種內(nèi)核動態(tài)參數(shù)有沒有介紹材料?
   A: 通常, kstat輸出的是內(nèi)核模塊中的一些鏈表或數(shù)組,按照SUN公司的文檔,這些
      輸出結(jié)果是自解釋型的,根據(jù)他們的名字就可以猜到其含義.但實際上并不是這
      樣.這些鏈表中包含的結(jié)構(gòu)是在;下的一些頭文件中定義的,比如
      kmem_cache模塊的結(jié)構(gòu)由kmem_impl.h定義,hme模塊的結(jié)構(gòu)由hme.h定義,等等.
      翻看這些頭文件,可以得到稍微詳細一點的資料. 參數(shù)名字通常與某結(jié)構(gòu)的成員
      變量同名,頭文件中由簡單的注釋指出其作用. 比如:hme模塊輸出中包含如下字
      段:
      brdcstrcv                       1094670
      我們就可以查hme.h,hme.h中有一個很大的結(jié)構(gòu):hme, 其中有:
       uint32_t hme_brdcstrcv;         /* # broadcast packets received */
47 Q: 1.問題描述:Router&LanSwitch的日志管理依賴系統(tǒng)的syslogd進程來實現(xiàn)。
        通過設置/etc/syslog.conf文件, 可以控制syslogd把日志存入特定的文本
        文件中。然后日志后臺就可以周期性的輪詢這些文件并導入數(shù)據(jù)庫。按照sun
        的man頁說明,當向syslogd進程發(fā)HUP信號時,進程將重讀配置文件
        /etc/syslog.conf,然后繼續(xù)運行。 但在Solaris2.7以下實際的效果是:發(fā)
        HUP信號將導致syslogd進程不能正常工作(有的試驗結(jié)果是,信號導致進程
        終止),后續(xù)設備日志全部丟失。
      2.解決建議:
        我們的建議是,修改系統(tǒng)的腳本文件/usr/lib/newsyslog,不讓其向syslogd
        發(fā)HUP信號,而是TERM(終止信號),然后重啟。此種方法的弊端是,如果用
        戶主動向進程發(fā)HUP信號,仍然存在問題。而且也不能解決syslogd意外退出
        的情況。第二種建議是由綜合統(tǒng)一做一個檢測進程,這樣各項目就不會產(chǎn)生
        沖突。但仍然存在用戶主動向進程發(fā)HUP信號使syslogd失效的問題。由上述
        可以看出,無論何種方法,都不能徹底解決問題。
     A: 問題的產(chǎn)生可能是由于程序員定義了新的日志文件并企圖 使用newsyslog 腳
        本來處理,這個腳本備份日志文件再發(fā)送 HUP信號。newsyslog 腳本在處理系
        統(tǒng)文件時不會有問題,很可能是由于syslogd對這些文件做過專門的處理。但
        不能認為我們自己的文件也會得到同樣的照顧,事實上,這樣做通常是危險
        的。  我認為建議2 是可行的, 因syslogd打開的是新的日志文件,不會發(fā)
        生異常。而用戶發(fā)送的   HUP 命令只是使 syslogd重讀 syslog.conf 文件
        ,也不會發(fā)生意外.為了比較好的定位問題,建議在一個比較干凈的系統(tǒng)上進
        行測試,在測試之前最好停掉自己的程序,
        簡化/etc/syslog.conf,我是這樣測試的:
        # /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 對ifconfig 作了一些改動,在這個命令之前,先執(zhí)行下面的命令就可
      以了: ifconfig hme0:1 plumb
49 Q: 為什么Solaris 中的多個網(wǎng)卡顯示的以太網(wǎng)地址都是一樣的?
   A: 缺省情況下,系統(tǒng)使用本機的MAC地址作為各網(wǎng)卡的MAC地址,可以用如下
      OpenBoot 命令讓系統(tǒng)使用網(wǎng)卡自帶的MAC地址.
      ok setenv local-mac-address? true
50 Q: 如何在一臺機器里如何實現(xiàn)用多塊網(wǎng)卡容錯?
   A: Solaris8 新增了一個daemon叫mpathd將網(wǎng)卡管理分組管理來完成這樣的功能.
      原理是給每個網(wǎng)卡分配兩個地址,多出的一個邏輯IP地址由mpathd用來檢查個網(wǎng)
      卡的工作情況.下面一兩塊網(wǎng)卡為例介紹配置過程,這里兩塊網(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應當與實際分配的IP地址在同一個網(wǎng)段并
         且不能與網(wǎng)上其他主機IP地址沖突.
51 Q: 一個進程里最多可以打開多少文件?
   A: 操作系統(tǒng)為每個進程維護一個所打開文件的數(shù)組,進程能夠打開的文件與此數(shù)組
      的大小有關.此數(shù)組的大小由兩個系統(tǒng)變量限制: rlim_fd_max , rlim_fd_cur,
      這兩個變量可以用limit或ulimit 命令察看和修改,要擴大rlim_fd_max需要
      root權(quán)限,rlim_fd_cur不能超過rlim_fd_max. 編程時則有庫函數(shù) getrlimit
      和 setrlimit 可以使用. 另外一種改法是在 /etc/system文件中修改. 如果是
      調(diào)用stdio函數(shù)打開文件,則還有另外一種限制,32位內(nèi)核Solaris 的 FILE 結(jié)構(gòu)
      中的 文件句柄是一個字節(jié),所以同時打開文件的上限是256
52 Q: 如何改變登錄CDE時的語言環(huán)境?
   A: 修改/usr/dt/config/Xconfig文件中的變量 Dtlogin*language即可.
53 Q: 如何防止用戶通過CDE 環(huán)境中的 suspend 菜單關閉計算機?
   A: 修改 /usr/openwin/bin/sys-suspend的執(zhí)行權(quán)限就可以了.
54 Q: 我安裝完solaris5.7之后(安裝時選擇簡體中文),運行C語言編譯器cc不成功
      ,提示“l(fā)anguage optional software package not installed.”。請問這是
      怎么回事,該如何解決?
   A: Solaris本身帶有adb,mdb,make工具,但不帶C語言編譯器.若要使用需要單獨購
      買軟件包及l(fā)icense.
55 Q: 想修改ROOT的缺省PATH,在哪改?不要告訴我LOCAL.PROFILE,不管用.
   A: 如果以root用戶身份登錄或者用 su -  命令進行切換,則修改 home目錄下
      .profile是管用的. 如果是簡單的 用 su 進行切換, 則系統(tǒng)保留除 PATH之外
      的所有環(huán)境變量, PATH被設為 /etc/default/su 中的 SUPATH ,缺省時為
      /usr/sbin:/usr/bin
56 Q: 問一下,現(xiàn)在在Solaris下有什么比較好的測試程序語句以及條件覆蓋率的工具
   A: prof 和 gprof 都有. 如果您使用workshop 或者 Forte 6.0,則其中有
      performence analysis tools 可以使用.
57 Q: 怎么樣讓系統(tǒng)啟動時就自動在一個網(wǎng)卡上綁定兩個IP地址
   A: 創(chuàng)建文件 /etc/hostname.hme0:1,其中寫上第二個ip地址.
58 Q: Sun solaris7系統(tǒng)中有一下幾種SHELL,sh,csh,ksh,另外還有一個jsh.
      我的問題是:jsh是什麼SHELL?另外有bash SHELL嗎?
   A: jsh 就是 sh, 只不過是激活了job control 模式. 但現(xiàn)在 sh 本身就有job
      control 功能,所以只用 sh 就可以了. bash 是 sh 的增強, 如果你的系統(tǒng)沒
      有這個shell, 可以到
www.sunfreeware.com
下載.
      ls /bin/*sh 可以看到系統(tǒng)所有存在的shell.
59 Q: 我的光驅(qū)無法讀取光盤?且總是顯示設備忙,如何搞定?mount顯示沒有被
      mount.
   A: 查找進程 vold 并將其殺死,就可以手工打開光驅(qū).
60 Q: 如何將root用戶的shell改掉,我知道一般用戶可在admintool下修改,但root
      用戶不能。
   A: 1. chmod 666 /etc/passwd (一定要讓普通用戶有些權(quán)限,切記!)
      2. vi /etc/passwd(最后一個字段試root 的 shell,要確保該程序存在方可改
         掉它. )
61 Q: 我在安裝Solaris 8時啟用了DHCP,現(xiàn)在我的主機名是unknown,在啟動時工作
      站啟用DHCP并分配IP,主機名也自動改為unknow。請問怎樣改主機名?
   A: DHCP in Solaris8
      1. # touch /etc/dhcp.hme0,hme0:請用相應的網(wǎng)卡設備名;
      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第一行加入如下語句:
        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)容為你的機器名
    5.創(chuàng)建/etc/dnsservers:129.9.111.100 10.15.1.3
62 Q: 我用msgget建一消息隊列:
      ret = msgget(IPC_PRIVATE, (0660)|IPC_CREAT);
      在一個線程用msgsnd發(fā)消息,另一個msgrcv收:
      ulReturnCode = msgsnd( QueueID, pBufferAddr, 8 ,IPC_NOWAIT);
      當消息隊列中的消息個數(shù)等于40時(每個消息尺寸為8字節(jié)),msgsnd函數(shù)返
      回-1,errno= 11,請問是什么原因。是消息隊列滿嗎?怎樣調(diào)整系統(tǒng)參數(shù),使
      消息隊列能大些。
   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 如何啟動?
   A: run /opt/SUNWste/bin/lmgrd.ste 可啟動 license server
64 Q: 在Solaris8下,如何修改一個目錄的大小。安裝時系統(tǒng)自動的設置
      /export/home目錄空間很大,而其他目錄空間很小。
   A: 1, 備份 /export/home,
      2. umount /export/home,
      3. 用 format 修改盤片大小,
      4. 備份要增大的目錄,
      5, umount
      5. 用 format 增加盤片大小.
      6. 重新mount.
65 Q: 請問用什么命令可以確定是否有磁帶設備?多謝。
   A: 看一下 /dev/rmt 如果是空就沒有.
.
66 Q: 在solaris 8下安裝Forte Developer 6 到達:
      installing Forte C++ Entep Ed 6/SPARC
      installing Forte Developer 6
      時死掉應如何解決
   A: 在安裝之前,應當清除所有以前安裝時添加進系統(tǒng)的package.
      另外,不用缺省目錄 /opt , 換一個新建的空目錄也有效.
67 Q: Forte c/c++版本可以用在solaris2.6操作系統(tǒng)上嗎?
   A: 可以
68 Q: 在輸入用戶名后啟動很慢,有時甚至進不了,停在啟動畫面,不知如何解決(我用
      過fsck,也不好使,有沒有更好的辦法)!能否重裝操作系統(tǒng),而不影響現(xiàn)有的已裝
      軟件.謝謝!
   A: 一般說來, 這與家目錄下配置文件有關.新建一個用戶試一試.
69 Q: 現(xiàn)在遠程維護的解決方式是通過Modem撥號,建立連接,通過我們自己編寫的IP
      代理轉(zhuǎn)發(fā)程序,完成對傳輸設備遠程維護。在PC機上的撥號網(wǎng)絡,撥號程序運
      行都比較正常,對連接速度,穩(wěn)定性方面目前使用還算可以。但是在設置Sun工
      作站的撥號程序的時候,我常常會遇到一些“奇怪”的問題, 比如Modem不握
      手,沒有撥號音等,F(xiàn)在我們的撥號設置是自己編寫的腳本文件方式?赡軐
      各種情況考慮的不全面,因此請問是否有相應的軟件包(程序)可以幫助我們
      機型撥號設置,保證撥號成功?
   A. 連接失敗通常與配置參數(shù)有關,由于硬件種類繁多,很難保證一個程序在所有的
      硬件環(huán)境下都能順利配置成功.我們只能針對具體情況進行分析.但我們發(fā)現(xiàn),改
      變串口的流倥方式經(jīng)常有助于問題的解決.Sun solstice 中有一個撥號軟件據(jù)
      說比aspppd 更容易使用,我沒有用過,或許您愿意試一試?
70 Q: 我這多線程程序,我用ftime得到函數(shù)的調(diào)用時間,發(fā)現(xiàn)在一個線程中,增加一
      個printf后,調(diào)用時間為5毫秒。去掉這個printf,調(diào)用時間卻為15毫秒。增加
      了一個printf為什么后使該函數(shù)的執(zhí)行更快了?
   A: ftime 得到系統(tǒng)當前時間,但具體到線程的執(zhí)行時間,是和系統(tǒng)的調(diào)度情況有關
      的, 請用調(diào)試工具來檢查準確的執(zhí)行時間.
71 Q: 我們的技術(shù)支持人員遇到一個問題,向您請教:在安裝時沒有選擇安裝網(wǎng)絡,
      現(xiàn)在需要安裝網(wǎng)絡,怎樣增加一個interface。目前只有l(wèi)o0,沒有hme0。
   A: 在 /etc 下 touch 一個空文件 hostname.hme0, 用 boot -r 命令重起.
72 Q: 在Sun Ultra 5工作站(安裝SOLARIS 2.6),每次開機時,都出現(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
      每次開機都需要boot才能進入。
      請問如何解決?
   A: 首先, 在 ok 狀態(tài)下檢查 boot-file 參數(shù):
      printenv boot-file
      如果是 boot-file =  -F cprboot 之類, 用如下命令:
      set-default boot-file
      再檢查一下.應該是空才對.
      如果不是, 則需要設置:
      setenv boot-file -F ufsboot
      重新啟動.
73 Q: 經(jīng)實驗,兩臺Sun工作站之間通過網(wǎng)絡發(fā)Syslog日志,也不支持漢字,該問題可
      能是syslogd的問題。
   A: 估計是由于syslogd在望上傳輸時丟掉了字節(jié)的最高位.
74 Q: 如果需要ID:105181-15的patch,請問ID:105181-19可以代替嗎?ID毫最好兩位
      是不是patch的版本號,如果是版本號有沒有前項兼容性?
   A: 可以, 后兩位表示同一patch的版本號.
75 Q: 以下代碼在Forte C++下導致編譯錯誤,請問如何解決?
    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: 請下載新的patch更新Forte C++
76 Q: 請問:如何設置工作站的最大客戶端數(shù)?現(xiàn)有一臺測試用機,使用人較多,經(jīng)
      常出現(xiàn)“無法得到pty”的提示。
   A: 在/etc/system  ,可以用參數(shù) maxusers 設置,最大2048,如果這里沒有設置,默
      認為與系統(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此文件或目錄
      被殺掉
    (Server is my program)
    Can you tell me how to settle it?
   A: you should set this envirnment variable: LD_LIBRARY_PATH
78 Q: 貴處有無磁帶機的使用手冊或指導說明?
   A: answerbook 中系統(tǒng)管理員手冊 I 有使用說明.
      answerbook 的文檔不是html格式,需要一個服務器程序轉(zhuǎn)換, 察看本機http進
      程看有沒有下面這個:
      # ps -ef |grep http
      # /usr/lib/ab2/dweb/sunos5/bin/dwhttpd /usr/lib/ab2/dweb/data
79 Q: 在 solaris 2.5.1 上 把 系統(tǒng)時間 改為 2004 年,無問題,然后把時間再改回
      來后,整個UNIX 死機,請SUN工程師答復. 具體操作為: 將操作系統(tǒng)時間設為
      2004年3月1日,然后再將操作系統(tǒng)時間改回當前的時間,則系統(tǒng)的cpu資源被兩個
      進程dtwm,dtfile嚴重占用,X Window反應非常緩慢,在低配置的系統(tǒng)上導致系統(tǒng)
      不可操作.同時顯示 "Warning:selected failed;error code 22.
   A: 在窗口環(huán)境下或多用戶模式下來回切換時間,會導致不可預測的結(jié)果,所以,
      如果當真要執(zhí)行此類操作,請在單用戶模式下進行.
80 Q: shell 文件中如何從文件中讀參數(shù)?
   A: cat yourfile`
81 Q: 如何分析網(wǎng)絡負載,在SUN上面有沒有相應的工具
   A: netstat -i
82 Q: 請問目前SUN E250,E450,E3500支持的CPU主頻和緩存分別是多少?您能將這
      些配置列表發(fā)給我嗎?
   A: docs.sun.com 有 硬件的answerbook ,可以參考一下。
      現(xiàn)在支持的CPU到400M, 480M 產(chǎn)品已有.but still have not released
83 Q: mt -f /dev/rmt/0 有個參數(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: 具體問題是:有一個進程不停的向該文件增加內(nèi)容,同時另外一個進程建立了
      與該文件的管道,從該文件中讀取一行記錄進行處理。然后刪除該行記錄。因
      此需要保持該文件i-node不能改變,否則,向該文件寫的進程就不能將信息寫
      入該文件了。有沒有解決方法,請指教。
   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機通過rexec遠
      程登陸的)
      $dos2unix  filename1  filename2
      could not open /dev/kbd to get keyboard type US keyboard assumed
      could not get keyboard tyep US keyboard assumed
      請問此問題是怎麼回事?如何解決?
   A: 權(quán)限問題, 檢查一下 /dev/kbd 讀寫權(quán)限
86 Q: 我希望在一臺ultra機器為以下網(wǎng)絡配置路由
      子網(wǎng):10.1.0.0
      掩碼:255.255.0.0
      網(wǎng)關:10.220.10.113
      應該如何配置?
      用以下命令可以嗎?如果永久配置需要修改那些文件?
      %route add 10.1.0.0 10.220.10.113
   A: no,try this commond:
      #route add default 10.220.10.113
87 Q: 有個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.sun.com
88 Q: 在CSH下我輸入以下命令?
      $setenv IWAVE 'pwd'
      $echo $IWAVE
      結(jié)果顯示為:pwd
      在我的理解中應該是將pwd的輸出(如/tmp)賦值給變量IWAVE,所以我想象的
      輸出是/tmp
   A: use ` instead ' apparently,they are different. read some unix books
      for reference
89 Q: 為什么有時普通用戶不能登錄CDE?
   A: 這個錯誤可能是由于CDE的不正確設置造成的。在每一個用戶的home目錄下有一
      個.dt子目錄.在此目錄下有一個errorlog文件記錄了CDE登錄失敗的原因.查
      看此文件可以找到失敗的原因.一個可行的方法是:使用root登錄并且刪除對
      應用戶home目錄下的.dt目錄,同時可以刪除;/.dtprofile文件, 然后使用
      用戶口令登錄即可.外檢查/usr/dt/bin/dtsessoin的使用權(quán)限.正確的權(quán)限應
      當是-r-sr-xr-x
90 Q: 關于Solaris8上DHCP的配置問題安裝Solaris8后,進程dhcpagent的CPU占用率一
      直都超過88%, 請問有什么方法可以解決.謝謝.
   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位的, 但是,它同時帶有32位程序的解釋器,也就是說32位
      的程序也可以在Solaris8上面運行。事實上Solaris8上面有一些系統(tǒng)命令就是
      32位的程序,如link等。所有的Solaris8都是64位的,但是都帶有32位的解釋
      器。(就現(xiàn)在的情況而言,32位的解釋器是必 須的)。在Solairs 8上面運行
      的應用程序可以是64位,也可以是32位的,包括Oracle 8在內(nèi)
92 Q: 很感謝你的答復。原來不能創(chuàng)建用戶的原因應該是文件系統(tǒng)已滿,我刪除了一
      些用戶賬號后,創(chuàng)建正!,F(xiàn)在的問題是c0d0t0s0文件系統(tǒng)的容量太小,現(xiàn)在
      已經(jīng)達到100%,如何擴展這個文件系統(tǒng),是否只有重裝系統(tǒng)這一個辦法?
   A: 在系統(tǒng)安裝時,各個分區(qū)劃分的有些不太合理。/ 目錄和 /usr 太小
      /export/home和/tmp 太大。實際上在安裝時,比較合理的辦法是只設置 / 和
      /tmp,/tmp最多 500M即可。然后在 / 上面建立/usr,/opt 和/export/home。
      現(xiàn)在補救的辦法是利用軟link的辦法:首先將一些在/或/usr中不太是系統(tǒng)直接
      使用的目錄(一定不可以包含/usr/sbin,/sbin, /etc,等等)轉(zhuǎn)移到有空間的分
      區(qū)上面,然后使用ln建立軟連接。關于ln的使用可以man.這種辦法是不得已而
      為之。不是很好把握,搞不好就會死機,并且啟動不起來。所以在進行此項活
      動時,首先要備份數(shù)據(jù),以免發(fā)生以上情況時丟失。如果您在下午下班的時間
      可以抽出一點時間,最好還是將系統(tǒng)重新安裝一遍的好。因為,每一個目錄都
      有一定的用意,一些軟件的安裝不是地方會讓人感到很別扭。而使用軟連接又
      會降低系統(tǒng)的運行速度。
93 Q: 求助--請教一個多線程編程問題。關于我們發(fā)現(xiàn)的問題具體現(xiàn)象如下:
      函數(shù) void* A(void *pInput)
          {
              char szBuf[30000];   //this buffer maybe larger than 30,000
              ...
              ...
          }
      在多線程程序中,該函數(shù)在main中運行(此時相當于在主線程中運行)正常。
      如果使用pthread_create創(chuàng)建一個線程,以A作為線程入口函數(shù),用內(nèi)存測試工
      具purify可以觀察到該線程運行過程中出現(xiàn)Beyond Stack Read、Beyond Stack
      Write錯誤。如果把szBuf改為堆中分配的內(nèi)存,則無此問題。據(jù)此,我們判斷
      是線程的?臻g溢出造成該問題。按資料描述,主線程的缺省?臻g大小為8M
      ,子線程缺省?臻g為2M;我們使用pthread_attr_setstack函數(shù)將子線程的棧
      空間設置為8M,但仍未解決問題。后又將線程屬 性設置為
      PTHREAD_SCOPE_SYSTEM, 問題仍然存在。函數(shù)A以靜態(tài)庫方式由第三方提供,
      我們現(xiàn)需要使之在一個子線程中運行,因此希望能夠提供主線程與子線程差異
      的資料,除堆?臻g、調(diào)度方式外,是否還有其他差別,造成以上錯誤的發(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: 請問一塊硬盤上可以有兩個Solaris分區(qū)嗎?在一塊硬盤上分了兩個solaris分
      區(qū),一個是active的系統(tǒng)安裝分區(qū),另一個是后來用fdisk創(chuàng)建的,請問怎樣把
      第二個分區(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: 請問在Solaris 2.7上,可以動態(tài)改變分區(qū)大小嗎? 我的工作站劃分分區(qū)不合理,
      根分區(qū)太小,已經(jī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編譯器如何實現(xiàn)結(jié)構(gòu)成員按字節(jié)對齊,類似于其他編譯器的#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的本地界面有時候會出現(xiàn)死掉的情況,此時kill掉用戶的dtsession
      是否就可以恢復正常。如不能恢復正常還需要做那些操作。
   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)不能啟動, 任何二級目錄都沒有了,但用戶下,所有命令都不能用,怎么
      安裝Solaris,能直接從光盤啟動嗎?
   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: 我們有一個產(chǎn)品在移植到SOLARIS的過程中出現(xiàn)了大量難以理解的問題,請給
       我們現(xiàn)場支援一下,非常感謝!使用Forte Develop6編譯C++程序的時候出現(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.
       請問是什么意思,難道編譯器還要assert嗎?
    A: CC 編譯器要求被編譯的文件以兩個新行結(jié)束,請在相關頭文件末尾加上新行。
102 Q: solaris的問題:激活小鍵盤上的Numlock,激活中文輸入法,按小鍵盤上的0
       鍵,中文輸入法自行關閉,請問是何原因?
    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.sun.com
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: 有關在SOLARIS上使用NETSCAPE問題
       問題描述:
       1.在SOLARIS2.6上安裝NETSCAP4.04后,安裝提示成功后,運行netscape,出現(xiàn)以
         下錯誤信息:
         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后,如何設置能直接點擊打開.pdf文件,而無需
         每次要先啟動Acroread,然后再打開? 請問上述問題如何解決?
    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 好像會把漢字拆分成兩個字節(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: the ; should be the full path name.
106 Q: 用vi打開一個script文件,發(fā)現(xiàn)里面有非法字符^M,在vi命令行如何全程替代
       掉該字符?我試了一下用以下命令來做,卻不行:0,$s/^M//
    A: 1,$s/^M//g ,其中,^M是 ctrl+V ,ctrl+M,或者,用下面這個命令。
       %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: 請教關于Solaris Patch的問題。我們在安裝一些軟件時,經(jīng)常需要先安裝一
       些Patch,有一事不明,向您請教一下,比如某個軟件需要Patch : 107546-02,
       現(xiàn)在我的機器上已經(jīng)安裝107546-08,是不是就不用再安裝107546-02了Patch
       后面的那部分是什么意思?是不是大的數(shù)字可以包含小的數(shù)字的功能了? 同一
       個Patch的不同版本之間會不會有沖突?
    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: 關于sun的SunNet 我目前想了解關于sun的SunNet。我從sun的網(wǎng)站上了解到
       SunNet已經(jīng)被合并入到Solstice里了,我目前想試著把我做得程序集成到
       SunNet或Solstice里,我看了Slostice得White Paper,但里邊只提到了一點點
       相關得Api,我從哪里,怎么才能到比較完全得文檔呢?
    A: To my knowledge, you can go to the following for a detailed info:
      
http://www.sun.com/software/solstice/em-products/network/sunnetmgr.html
.
110 Q: 關于SUN機器root口令丟失問題,如何解決?
    A: 辦法如下:
       利用SOLARIS的啟動盤來啟動,然后把硬盤mount上去,修改硬盤上原etc目錄
       下的shadow文件,將root項里的password域內(nèi)容刪除,變成無密碼。然后重新
       啟動主機,以無密碼的root登陸后,重新設置root口令。具體步驟如下:
       1.把你的solaris光盤放進cdrom
       2.鍵入stop+a
       3.當出現(xiàn)'ok'字樣時,鍵入boot cdrom -s
       4.cd /tmp/root
       5.mkdir /tmp/root/xxx (xxx是什么鬼東西就無關緊要了)
       6.mount /dev/dsk/c0t0d0s0 /tmp/root/xxx (在這里c0t0d0s0是你的root盤)
       7.運行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項里的password域刪除即可。
       11.重啟動,你就可以以無密碼的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.sun.com
"
       ,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: 請問有沒有磁盤管理工具。我們有一臺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: 怎樣強制更改NIS客戶端的本地NIS數(shù)據(jù)表?有時候NIS客戶端和NIS服務器端有
       時會出現(xiàn)不一致的情況.NIS服務器和NIS slave 服務器也會出現(xiàn)這種情況。
    A: 你可以用yppush和 ypxfr 來做這種工作,更常見的方法是把它們寫進cron,定
       期更新,具體步驟請查閱Answerbook.
115 Q: 為了將工作站設為從DHCP動態(tài)分配IP,并且將主機名由"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口令后,只能運行在單用戶模式,且vi、ls等都不能用(#vi:not found)
       如何才能打開/etc/init.d/rootusr文件進行修改,恢復正常狀態(tài)。
    A: 請找一個SOLARIS的安裝啟動盤,使用以下方法可以修改rootusr文件,步驟如
       下:
       1.把你的solaris光盤放進cdrom
       2.鍵入stop+a
       3.當出現(xiàn)'ok'字樣時,鍵入boot cdrom -s
       4.cd /tmp
       5.mkdir /tmp/xxx (xxx是什么東西無關緊要,隨便取一個名字,如test)
       6.mount /dev/dsk/c0t0d0s0 /tmp/xxx (在這里c0t0d0s0是你的root盤)
       7.運行csh
       8.setenv TERM vt220
       9.vi /tmp/xxx/etc/init.d/rootusr,把esac那行也注釋掉即可。
       10.把solaris光盤拿出,reboot,重啟動即可。
116 Q: 一臺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服務器offer的IP地址10.11.105.147被decline了。手工運行
       dhcpagent,提示4999端口被使用了。以前此工作站曾配置為固定IP:
       10.11.105.147,但現(xiàn)在已改為10.11.105.247并重啟過多次。請問,可能是什
       么原因?qū)е耫hcp失敗??
    A: 導致問題出現(xiàn)的原因是,由于客戶機在申請原來的被保留分配的IP時,服務器
       發(fā)現(xiàn)這個IP不能夠被使用(已經(jīng)有其它機器使用了這個IP地址)。使客戶機申
       請失敗,并且使其中的某些進程不能正常退出,繼續(xù)占用了端口4999而使后面
       的申請不能進行。辦法是找到占用端口4999的進程,殺掉即可。找到這個進程
       的辦法是,這個申請進程是帶有dhcp字樣的。
       # ps -e | grep dhcp
       會出現(xiàn)一到兩個進程號。驗證這些進程是否占用了4999是看進程打開的文件:
       # /usr/proc/bin/pfiles #pid
       早到進程然后殺掉。這樣就可以繼續(xù)啟動Client 端的dhcp申請。注意,修改
       服務器的設置使新的申請可以成功。
117 Q: 我們有一臺Natra T1,它的/tmp目錄已經(jīng)長到90%,如果目錄滿了是否會使系統(tǒng)
       運行異常.(因為我們運行的業(yè)務不能停,故不能重啟SUN機器來讓系統(tǒng)清空該目
       錄,也不能直接清空該目錄,應為應用程序正在運行.)下面是一些數(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: 我認為是系統(tǒng)統(tǒng)計信息錯誤的, 本人的經(jīng)驗是當/tmp的使用率超過10%時,系統(tǒng)就
變的很慢了。出現(xiàn)這種情況,首先,要檢查系統(tǒng)中運行的程序有沒有不停分配內(nèi)存,
卻沒有釋放(指自己開發(fā)的程序)。另外看一下系統(tǒng)對/tmp的swap交換情況。使用工
具sar 和iostat 都可以看到。關于sar和iostat的用法, 可以看man即可。
118 Q: 有一用MOTIF 寫的程序,運行之后不能顯示中文(亂碼),由于顯示的信息是
       不固定的,故不能使用資源文件.懷疑程序中與創(chuàng)建字體時使用了以下的函數(shù)
       有關,但注釋掉后也一樣:
           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");
運行環(huán)境是ULTRA 60 ,Solaris 2.6 ,安裝了中文環(huán)境。編譯環(huán)境是SUN C++ 4.0 。
還懷疑與LANG 相關,曾試過設置為zh ,chinese 等也不行,請教此問題如何解決?
A: 實際上,關于選擇字體和字符集可以看;這個資料,使
   用系統(tǒng)提供的標準工具來從中間找到系統(tǒng)中存在的字體和字體的名稱。這個資料在
   Answer Book 的System Administration Collection 中。 實際上,上面的問題不
   出現(xiàn)在字體的選擇上面, 而是在MOTIF中在選擇框的使用設置中還要設置一次字體
119 Q: 請問SUN的E250以上機器支持“雙機熱備+磁盤陣列”的使用方式嗎?Ultra系
       列的機器是否也能支持呢?
    A: SUN的E250以上機器支持“雙機熱備+磁盤陣列”的使用方式,可以使用
       SunCluster軟件實現(xiàn);Netrat系列電信服務器也支持;Ultra系列的機器,不
       在支持的列表中。但是,“雙機熱備+磁盤陣列”的具體含義應該搞清楚。推
       薦的文檔在sun cluster collection 中。
120 Q: 我在一個JAVA程序中打開50個SOCKET端口,結(jié)果出現(xiàn)異常:
       java.net.SocketException:Too many open files
       請問如何解決此問題?謝謝!另外,請問在一個JAVA進程中可以同時啟動的線
       程數(shù)是多少?最大線程數(shù)受什么限制?能否達到240個線程?謝謝!如上問題
       如果可以通過修改配置來解決的話,會有什么樣的負面影響?
    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: 我想把一個HP平臺上運行的B SHELL 腳本在SOLARIS 2。6上運行,但是出現(xià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`




本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/1696/showart_1002065.html
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP