17. Q: 一台Sun Ultra80工作站安装SunOS 5.6失败,请问其原因以及如何避免? A: 硬件环境为Ultra-80/2CPU(450M)/1harddisk(18G)/2G Memory,从网络启动安 装SunOS 5.6。安装过程中途中断并出现以下提示: 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’都无法使系统启动,提示如下:
Can not open Kernel/unix input filename [Kernel/unix]:
只有重新从网络启动。这是由于CPU硬件结构与Solaris系统不兼容造成的, 需要补丁。这个问题不仅仅是在Ultra80的机器上,如果Ultra60使用了SUN的 新推出的高速CPU(400M以上,一般为450M)且操作系统为Solaris 2.6或者 Solaris 2.5.1,也会出现类似问题。如果工作站使用的是这种高速CPU,在 随新机器一起的附件中会有一本手册:Installing Solaris 2.5.1 or Solaris 2.6 Software on 419+ MHz Systems,其中详细描述了如何解决这 个问题(在zh-6页)。另外,附件中还有一张补丁光盘,名字叫做: Operating Environment Installation CD May 1999,此光盘专门用于解决 此问题.
ufsrestore用于恢复使用ufsdump命令备份的文件系统。命令格式为: /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 执行该操作需要指定所要恢复的文件在备份文件中的位置。由于备份文件从卷1开始, 所以可以指定从卷1开始搜索。恢复整个文件系统下例将一个老的文件系统(/opt)移 到一个新的磁盘分区(/dev/rdsk/c0t3d0s5)中。首先,卸载老的文件系统并实施备 份: #umount /opt #fsck /opt #ufsdump 0uf /dev/rmt/0 /opt 其次,生成新的文件系统,将其安装到一个临时目录(/mnt),并实施恢复: #newfs /dev/rdsk/c0t3d0s5 #fsck /dev/rdsk/c0t3d0s5 #mount /dev/dsk/c0t3d0s5 /mnt #cd /mnt #ufsrestore rvf /dev/rmt/0 #rm restoresymtable 最后,卸载新的文件系统,用fsck检查其一致性。 #cd / umount /mnt #fsck /dev/rdsk/c0t3d0s5
选择性备份,备份指定的文件和目录;
tar
系统备份:tar -cvf 目标文件名/设备名 备份文件,例如: tar -cvf backup.tar * 命令将当前目录下的所有文件(包括各级子目录)都打包在backup.tar文件中。 tar -cvf /dev/rmt/0 * 命令将当前目录下的所有文件(包括各级子目录)都打包到磁带上。查看tar文件的内 容:tar tvf 目标文件名/设备名,例如: tar -tvf backup.tar tar -tvf /dev/rmt/0 将tar文件中的内容恢复到指定目录中去:tar xvf 目标文件名/设备名 [目录名],例 如: tar -xvf backup.tar /home tar -xvf /dev/rmt/0 /home 如果不指定目录名则表示当前目录。
22. Q: 一个GUI程序,在换个不同的SUN环境时界面就变的难看了,主要是字体影响 (还有其它影响么?)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.
35 Q: How can I get a Workshop6's licence? A: get a new one from and install it again. URL is http:///forte/cplusplus/buy.html cp licence-file install_dir/SUNWspro/licencse_dir/sunpro.lic,node
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 上有完整的文档,可以参考一下.
58 Q: Sun solaris7系统中有一下几种SHELL,sh,csh,ksh,另外还有一个jsh. 我的问题是:jsh是什麽SHELL?另外有bash SHELL吗? A: jsh 就是 sh, 只不过是激活了job control 模式. 但现在 sh 本身就有job control 功能,所以只用 sh 就可以了. bash 是 sh 的增强, 如果你的系统没 有这个shell, 可以到 下载. ls /bin/*sh 可以看到系统所有存在的shell.
61 Q: 我在安装Solaris 8时启用了DHCP,现在我的主机名是unknown,在启动时工作 站启用DHCP并分配IP,主机名也自动改为unknow。请问怎样改主机名? A: DHCP in Solaris8 1. # touch /etc/dhcp.hme0,hme0:请用相应的网卡设备名; 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.创建/etc/defaultdomain,内容为huawei.com.cn 4.创建/etc/nodename,内容为你的机器名 5.创建/etc/dnsservers:129.9.111.100 10.15.1.3
62 Q: 我用msgget建一消息队列: ret = msgget(IPC_PRIVATE, (0660)|IPC_CREAT); 在一个线程用msgsnd发消息,另一个msgrcv收: ulReturnCode = msgsnd( QueueID, pBufferAddr, 8 ,IPC_NOWAIT); 当消息队列中的消息个数等于40时(每个消息尺寸为8字节),msgsnd函数返 回-1,errno= 11,请问是什么原因。是消息队列满吗?怎样调整系统参数,使 消息队列能大些。 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, 其他参数最大值都是 2 billion.
63 Q: license server 如何启动? A: run /opt/SUNWste/bin/lmgrd.ste 可启动 license server
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:打开失败:无此文件或目录 被杀掉
(Server is my program) Can you tell me how to settle it?
A: you should set this envirnment variable: LD_LIBRARY_PATH
82 Q: 请问目前SUN E250,E450,E3500支持的CPU主频和缓存分别是多少?您能将这 些配置列表发给我吗? A: docs.sun.com 有 硬件的answerbook ,可以参考一下。 现在支持的CPU到400M, 480M 产品已有.but still have not released
83 Q: mt -f /dev/rmt/0 有个参数: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: 具体问题是:有一个进程不停的向该文件增加内容,同时另外一个进程建立了 与该文件的管道,从该文件中读取一行记录进行处理。然后删除该行记录。因 此需要保持该文件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转换一文件,却不成功,提示信息如下:(我用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
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 结果显示为:pwd 在我的理解中应该是将pwd的输出(如/tmp)赋值给变量IWAVE,所以我想象的 输出是/tmp A: use ` instead ' apparently,they are different. read some unix books for reference
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.
93 Q: 求助--请教一个多线程编程问题。关于我们发现的问题具体现象如下: 函数 void* A(void *pInput) { char szBuf[30000]; //this buffer maybe larger than 30,000 ... ... } 在多线程程序中,该函数在main中运行(此时相当于在主线程中运行)正常。 如果使用pthread_create创建一个线程,以A作为线程入口函数,用内存测试工 具purify可以观察到该线程运行过程中出现Beyond Stack Read、Beyond Stack Write错误。如果把szBuf改为堆中分配的内存,则无此问题。据此,我们判断 是线程的栈空间溢出造成该问题。按资料描述,主线程的缺省栈空间大小为8M ,子线程缺省栈空间为2M;我们使用pthread_attr_setstack函数将子线程的栈 空间设置为8M,但仍未解决问题。后又将线程属 性设置为 PTHREAD_SCOPE_SYSTEM, 问题仍然存在。函数A以静态库方式由第三方提供, 我们现需要使之在一个子线程中运行,因此希望能够提供主线程与子线程差异 的资料,除堆栈空间、调度方式外,是否还有其他差别,造成以上错误的发生 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分区吗?在一块硬盘上分了两个solaris分 区,一个是active的系统安装分区,另一个是后来用fdisk创建的,请问怎样把 第二个分区加入到solaris系统中使用。谢谢。 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上,可以动态改变分区大小吗? 我的工作站划分分区不合理, 根分区太小,已经满了,可以使用工具动态改变吗? 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编译器如何实现结构成员按字节对齐,类似于其他编译器的#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 under workshop directory.
97 Q: 为什么SUN的本地界面有时候会出现死掉的情况,此时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: 系统不能启动, 任何二级目录都没有了,但用户下,所有命令都不能用,怎么 安装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
"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 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.
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.
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 "" ,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.
120 Q: 我在一个JAVA程序中打开50个SOCKET端口,结果出现异常: java.net.SocketException:Too many open files 请问如何解决此问题?谢谢!另外,请问在一个JAVA进程中可以同时启动的线 程数是多少?最大线程数受什么限制?能否达到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.