免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1382 | 回复: 0
打印 上一主题 下一主题

§1 Solaris 系统管理简介-1 运行状态的种类和关机命令的区别 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-06 16:32 |只看该作者 |倒序浏览

§1    Solaris 系统管理简介
§1.1 系统管理员的职责
★熟悉shell
ü        
常用的shell命令
ü        
常用的Bourne shell命令
ü        
常用的C shell命令
ü        
常用的Korn shell命令

★用户和组管理
ü        
添加用户
ü        
删除用户
ü        
更改用户信息
ü        
创建删除组

★角色管理
ü        
针对特殊任务授权超级用户权限
ü        
创建修改删除角色

★文件系统管理
ü        
文件系统的类型
ü        
加载移除文件系统
ü        
文件系统一致性检查
ü        
备份恢复文件和文件系统
ü        
创建cache文件系统

★设备管理
ü        
理解设备自动配置
ü        
使用DVD-ROM设备
ü        
使用磁带
ü        
格式化操盘
ü        
磁盘使用监控
ü        
服务访问技巧
ü        
设置双向modem.

★管理系统
ü        
查找系统信息
ü        
创建本地邮件别名
ü        
配置其他的交换空间
ü        
管理时间和日期
★打印管理
ü        
安装打印服务器和客户端
ü        
使用打印命令

★认识文件访问问题
ü        
通过查找path来坚定问题
ü        
通过权限和所有来解决问题
ü        
通过网络定位问题

本书不包含安装系统软件,安装第3方软件,配置管理网络服务,配置邮件服务,添加删除硬件,安全管理和账号,系统监控和网络性能等.


      §1.2 超级用户
超级用户的UID是0,su到超级用户的log在: /var/adm/sulog, 如果需要使用环境变量,使用su


      §1.3 用户之间通信
ü        
登陆时的信息显示: /etc/motd
ü        
发送消息给单个用户: write ,要在线的才可以发送
       比如: bash-2.03# write meil
meil is logged on more than one place.
You are connected to "pts/2".
Other locations are:
pts/3
good Afternoon
bash-2.03#
ü        
发送消息给所有用户    wall
ü        
发送消息给网络用户    rwall
ü        
Email

      §1.4 启动关闭系统
需要关键的情况如下:
·        
Turning off system power.
·        
Installing a new release.
·        
Preparing for a power outage.
·        
Adding hardware to a system.
·        
Performing maintenance on a
file system.
§1.5选择初始状态

  
   
   Table 1. System Init States
   
  
  
   
   Init State
   
   
   Function
   
  


  
  0
  
  
  Power-down state.
  


  
  S, or s
  
  
  Single-user state. All file systems
  mounted.
  


  
  1
  
  
  Administrative state. All file systems
  mounted and user logins allowed.
  


  
  2
  
  
  Multiuser state (resources not exported).
  All daemons are running except the NFS server daemons.
  


  
  3
  
  
  Multiuser state. NFS resource-sharing
  available.
  


  
  4
  
  
  Alternative multiuser state (currently
  unused).
  


  
  
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  
file:///E:/DOCUME%7E1/sz081474/LOCALS%7E1/Temp/msohtml1/01/clip_image001.gif
5
  
  
  Power-down state. Shut down the operating
  system so that it is safe to turn off power to the system. If possible, turn
  off power on systems that support this feature.
  


  
  6
  
  
  Reboot. Shut down the system to init
  state 0 and then reboot to the multiuser state defined in the inittab
  file.
  



/etc/inittab定义的重要内容如下:
·        
The default run level for the
system.
·        
The processes to start,
monitor, and restart if they terminate.
·        
Actions to take when the system
enters a new run level.
它的字段如下:

  
   
   Field
   
   
   Description
   
  


  
  id
  
  
  A unique identifier for the entry.
  


  
  rstate
  
  
  A list of run levels to which this entry applies.
  


  
  action
  
  
  How the process specified in the process field is to be
  run. Possible values include initdefault, sysinit, boot, bootwait, wait, and
  respawn.
  


  
  process
  
  
  The command to execute.
  


比如:
bash-2.03# vi /etc/inittab
"/etc/inittab" 17 lines, 1081
characters
ap::sysinit:/sbin/autopush -f /etc/iu.ap
ap::sysinit:/sbin/soconfig -f
/etc/sock2path
fs::sysinit:/sbin/rcS sysinit           >/dev/msglog 2/dev/msglog
is:3:initdefault:
p3:s1234:powerfail:/usr/sbin/shutdown -y
-i5 -g0 >/dev/msglog 2/dev/msglog
sS:s:wait:/sbin/rcS                     >/dev/msglog
2/dev/msglog
s0:0:wait:/sbin/rc0                     >/dev/msglog
2/dev/msglog
s1:1:respawn:/sbin/rc1                  >/dev/msglog 2/dev/msglog
s2:23:wait:/sbin/rc2                    >/dev/msglog
2/dev/msglog
s3:3:wait:/sbin/rc3                     >/dev/msglog
2/dev/msglog
s5:5:wait:/sbin/rc5                     >/dev/msglog
2/dev/msglog
s6:6:wait:/sbin/rc6                     >/dev/msglog
2/dev/msglog
fw:0:wait:/sbin/uadmin 2 0              >/dev/msglog
2/dev/msglog
of:5:wait:/sbin/uadmin 2 6              >/dev/msglog 2/dev/msglog
rb:6:wait:/sbin/uadmin 2 1              >/dev/msglog
2/dev/msglog
sc:234:respawn:/usr/lib/saf/sac -t 300
co:234:respawn:/usr/lib/saf/ttymon -g -h -p
"`uname -n` console login: " -T sun -d /dev/console -l console -m
ldterm,ttcompat
      
       init的执行脚本sbin中,
bash-2.03# ls /sbin/rc*
/sbin/rc0
/sbin/rc1  /sbin/rc2  /sbin/rc3
/sbin/rc5  /sbin/rc6  /sbin/rcS
       控制文件在/etc/init.d中,它们连接到/etc/rc*.d,
其下面的文件K开头的表示kill, S开头的表示start

The /sbin/rc0 Script
·        
Stop system services and
daemons.
·        
Terminate all running
processes.
·        
Unmount all file systems.
The /sbin/rc1
Script
·        
Stop system services and
daemons.
·        
Terminate all running
processes.
·        
Unmount all file systems.
·        
Bring the system up in
single-user mode.
The /sbin/rc2 script
·        
Mount all local file systems.
·        
Enable disk quotas if at least
one file system was mounted with the quota option.
·        
Save editor temporary files in /usr/preserve.
·        
Remove any files in the /tmp
directory.
·        
When boot -r is used,
create device entries in /dev for new disks.
·        
Configure system accounting.
·        
Configure default router.
·        
Set NIS domain and ifconfig netmask.
·        
Reboot the system from the
installation media or a boot server if either /.PREINSTALL or /AUTOINSTALL
exists.
·        
Start inetd and rpcbind
and named, if appropriate.
·        
Start Kerberos client-side
daemon, kerbd.
·        
Start NIS
daemons (ypbind) and NIS+ daemons (rpc.nisd),
depending on whether the system is configured for NIS
or NIS+ and
whether the system is a client or a server.
·        
Start keyserv, statd,
lockd, xntpd, and utmpd.
·        
Mount all NFS entries.
·        
Start cscd
(nameservice cache daemon).
·        
Start automount, cron,
LP print service, sendmail, utmpd, and vold daemons.
The /sbin/rc3 Script
·        
Clean up sharetab.
·        
Start nfsd.
·        
Start mountd.
·        
If the system is a boot server,
start rarpd, rpc.bootparamd, and rpld.
·        
Start snmpdx (Solstice
Enterprise Agent process).

The /sbin/rc5 and /sbin/rc6 Scripts
·        
Kill all active processes.
·        
Unmount the file systems.
The /sbin/rcS script
·        
Establish a minimal network.
·        
Mount /usr if
necessary.
·        
Set the system name.
·        
Check the root and /usr
file systems.
·        
Mount pseudofile systems (/proc
and /dev/fd).
·        
Rebuild the device entries for
reconfiguration boots.
·        
Check and mount other file
systems to be mounted in single-user mode.

查看系统的运行级别:
In the following example, the system named paperbark
is at the default multiuser run level (3), the date and time of the last run
level change is May 2 08:34, the process termination status is 3,
the number of times at this run level since the last reboot is 0, and
the previous run level is S.
paperbark% who -r   .       run-level 3  May  2 08:34     3      0  S
Daemon的定义:
注意时不需用户输入的
A daemon is a special
type of program that, once activated, starts itself and carries out a specific
task without any need for user input. Daemons typically are used to handle
jobs, such as printing, mail, and communication, that have been queued.

改变运行状态,可以使用telinit or init, 建议使用telinit.

关机命令的选择.
·        
/usr/sbin/shutdown
·        
/etc/telinit and /sbin/init
·        
/usr/sbin/halt
·        
/usr/sbin/reboot
·        
/usr/sbin/uadmin
Shutdown用于多用户环境,会通知所有用户,然后进入单用户模式.
Telinit和init用于关闭单用户环境或者改变运行级别.
Halt用于立即停机,不通知其他用户.不执行rc shutdown脚本,一般不推荐使用
Reboot 同上,同时重启.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/21908/showart_375615.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP