Solaris新手必读-121个问题解答

  发布时间:2008-09-08 19:10:58   作者:佚名   我要评论
Solaris新手必读 -121个问题解答让你从菜鸟到高手 1. Q: Solaris 的系统配置文件一般在什么地方? A: 可以查看/etc/system文件,里面有一些solaris启动时默认加载的选项,包括 共享内存大小等的设置, 2. Q: 在solaris中,用户默认的Shell在什么文件中规定?
(福利推荐:【腾讯云】服务器最新限时优惠活动,云服务器1核2G仅99元/年、2核4G仅768元/3年,立即抢购>>>:9i0i.cn/qcloud

(福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

73 Q: 经实验,两台Sun工作站之间通过网络发Syslog日志,也不支持汉字,该问题可
能是syslogd的问题。
A: 估计是由于syslogd在望上传输时丢掉了字节的最高位.

74 Q: 如果需要ID:105181-15的patch,请问ID:105181-19可以代替吗?ID毫最好两位
是不是patch的版本号,如果是版本号有没有前项兼容性?
A: 可以, 后两位表示同一patch的版本号.

75 Q: 以下代码在Forte C++下导致编译错误,请问如何解决?

template<typename p1, typename p2>;
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<int, int>;( i, j);
}
A: 请下载新的patch更新Forte C++

76 Q: 请问:如何设置工作站的最大客户端数?现有一台测试用机,使用人较多,经
常出现"无法得到pty"的提示。
A: 在/etc/system ,可以用参数 maxusers 设置,最大2048,如果这里没有设置,默
认为与系统内存容量相同(以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:打开失败:无此文件或目录
被杀掉

(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 中系统管理员手册 I 有使用说明.
answerbook 的文档不是html格式,需要一个服务器程序转换, 察看本机http进
程看有没有下面这个:

# ps -ef |grep http
# /usr/lib/ab2/dweb/sunos5/bin/dwhttpd /usr/lib/ab2/dweb/data

79 Q: 在 solaris 2.5.1 上 把 系统时间 改为 2004 年,无问题,然后把时间再改回
来后,整个UNIX 死机,请SUN工程师答复. 具体操作为: 将操作系统时间设为
2004年3月1日,然后再将操作系统时间改回当前的时间,则系统的cpu资源被两个
进程dtwm,dtfile严重占用,X Window反应非常缓慢,在低配置的系统上导致系统
不可操作.同时显示 "Warning:selected failed;error code 22.
A: 在窗口环境下或多用户模式下来回切换时间,会导致不可预测的结果,所以,
如果当真要执行此类操作,请在单用户模式下进行.

80 Q: shell 文件中如何从文件中读参数?
A: cat yourfile`

81 Q: 如何分析网络负载,在SUN上面有没有相应的工具
A: netstat -i

82 Q: 请问目前SUN E250,E450,E3500支持的CPU主频和缓存分别是多少?您能将这
些配置列表发给我吗?
A: docs.sun.com 有 硬件的answerbook ,可以参考一下。
现在支持的CPU到400M, 480M 产品已有.but still ha ve 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 ha ve understood you :
If you want sa ve 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

请问此问题是怎麽回事?如何解决?
A: 权限问题, 检查一下 /dev/kbd 读写权限

86 Q: 我希望在一台ultra机器为以下网络配置路由
子网:10.1.0.0
掩码:255.255.0.0
网关: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 a void other problem,find them at: sunsolve.sun.com

88 Q: 在CSH下我输入以下命令?
$setenv IWA VE 'pwd'
$echo $IWA VE
结果显示为:pwd
在我的理解中应该是将pwd的输出(如/tmp)赋值给变量IWA VE,所以我想象的
输出是/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目录,同时可以删除<home>;/.dtprofile文件, 然后使用
用户口令登录即可.外检查/usr/dt/bin/dtsessoin的使用权限.正确的权限应
当是-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上,内核是32位还是64位?
(3)在其上安装的Oracle 8是安装的32位版本还是64位版本?
A: Solaris8 的内核是64位的, 但是,它同时带有32位程序的解释器,也就是说32位
的程序也可以在Solaris8上面运行。事实上Solaris8上面有一些系统命令就是
32位的程序,如link等。所有的Solaris8都是64位的,但是都带有32位的解释
器。(就现在的情况而言,32位的解释器是必 须的)。在Solairs 8上面运行
的应用程序可以是64位,也可以是32位的,包括Oracle 8在内

92 Q: 很感谢你的答复。原来不能创建用户的原因应该是文件系统已满,我删除了一
些用户账号后,创建正常。现在的问题是c0d0t0s0文件系统的容量太小,现在
已经达到100%,如何扩展这个文件系统,是否只有重装系统这一个办法?
A: 在系统安装时,各个分区划分的有些不太合理。/ 目录和 /usr 太小
/export/home和/tmp 太大。实际上在安装时,比较合理的办法是只设置 / 和
/tmp,/tmp最多 500M即可。然后在 / 上面建立/usr,/opt 和/export/home。
现在补救的办法是利用软link的办法:首先将一些在/或/usr中不太是系统直接
使用的目录(一定不可以包含/usr/sbin,/sbin, /etc,等等)转移到有空间的分
区上面,然后使用ln建立软连接。关于ln的使用可以man.这种办法是不得已而
为之。不是很好把握,搞不好就会死机,并且启动不起来。所以在进行此项活
动时,首先要备份数据,以免发生以上情况时丢失。如果您在下午下班的时间
可以抽出一点时间,最好还是将系统重新安装一遍的好。因为,每一个目录都
有一定的用意,一些软件的安装不是地方会让人感到很别扭。而使用软连接又
会降低系统的运行速度。

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. Lea ve 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
http://sunlibray 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 ha ve 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: 我们有一个产品在移植到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 <hostname>; :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.

相关文章

最新评论

?


http://www.vxiaotou.com