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

  发布时间:2008-09-08 19:10:58   作者:佚名   我要评论
Solaris新手必读 -121个问题解答让你从菜鸟到高手 1. Q: Solaris 的系统配置文件一般在什么地方? A: 可以查看/etc/system文件,里面有一些solaris启动时默认加载的选项,包括 共享内存大小等的设置, 2. Q: 在solaris中,用户默认的Shell在什么文件中规定?

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 <filename>; -m <size in million>;
#swap -a <filename>;
Note: the <filename>; 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
a vailiable 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 ha ve 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/sols ... ork/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 sla ve 服务器也会出现这种情况。
A: 你可以用yppush和 ypxfr 来做这种工作,更常见的方法是把它们写进cron,定
期更新,具体步骤请查阅Answerbook.


115 Q: 为了将工作站设为从DHCP动态分配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文件进行修改,恢复正常状态。
A: 请找一个SOLARIS的安装启动盘,使用以下方法可以修改rootusr文件,步骤如
下:
1.把你的solaris光盘放进cdrom
2.键入stop+a
3.当出现'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

抓包发现是dhcp服务器offer的IP地址10.11.105.147被decline了。手工运行
dhcpagent,提示4999端口被使用了。以前此工作站曾配置为固定IP:
10.11.105.147,但现在已改为10.11.105.247并重启过多次。请问,可能是什
么原因导致dhcp失败??

A: 导致问题出现的原因是,由于客户机在申请原来的被保留分配的IP时,服务器
发现这个IP不能够被使用(已经有其它机器使用了这个IP地址)。使客户机申
请失败,并且使其中的某些进程不能正常退出,继续占用了端口4999而使后面
的申请不能进行。办法是找到占用端口4999的进程,杀掉即可。找到这个进程
的办法是,这个申请进程是带有dhcp字样的。
# ps -e | grep dhcp
会出现一到两个进程号。验证这些进程是否占用了4999是看进程打开的文件:
# /usr/proc/bin/pfiles #pid
早到进程然后杀掉。这样就可以继续启动Client 端的dhcp申请。注意,修改
服务器的设置使新的申请可以成功。

相关文章

最新评论