歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> Unix教程

新手必讀(solaris基礎和常用知識三)


  新手必讀(solaris基礎和常用知識)
                   作者:boycw 轉載時間:2002-12-25
  
  101 Q: 我們有一個產品在移植到SOLARIS的過程中出現了大量難以理解的問題,請給
  我們現場支援一下,非常感謝!使用Forte Develop6編譯C++程序的時候出現
  以下信息:
  "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 編譯器要求被編譯的文件以兩個新行結束,請在相關頭文件末尾加上新行。
  
  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,出現以
  下錯誤信息:
  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 好像會把漢字拆分成兩個字節,並去掉高位
  如何解決?
  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: 我的工作站的交換分區分的太小了,除重裝系統外,是否有其它辦法將空間調
  整一下。
  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文件,發現裡面有非法字符^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的問題。我們在安裝一些軟件時,經常需要先安裝一
  些Patch,有一事不明,向您請教一下,比如某個軟件需要Patch : 107546-02,
  現在我的機器上已經安裝107546-08,是不是就不用再安裝107546-02了Patch
  後面的那部分是什麼意思?是不是大的數字可以包含小的數字的功能了? 同一
  個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的網站上了解到
  SunNet已經被合並入到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域內容刪除,變成無密碼。然後重新
  啟動主機,以無密碼的root登陸後,重新設置root口令。具體步驟如下:
  1.把你的solaris光盤放進cdrom
  2.鍵入stop+a
  3.當出現'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數據表?有時候NIS客戶端和NIS服務器端有
  時會出現不一致的情況.NIS服務器和NIS slave 服務器也會出現這種情況。
  A: 你可以用yppush和 ypxfr 來做這種工作,更常見的方法是把它們寫進cron,定
  期更新,具體步驟請查閱Answerbook.
  
  
  115 Q: 為了將工作站設為從DHCP動態分配IP,並且將主機名由"unknown"改為原名
  修改了/etc/init.d/rootusr,將dhcpinfo後面三行(不是四行)注釋掉;
  hostname=`/sb
Copyright © Linux教程網 All Rights Reserved