免费注册 查看新帖 |

Chinaunix

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

Solaris 中系统服务的管理 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-22 11:29 |只看该作者 |倒序浏览
Solaris 中系统服务的管理

  







  Solaris系统,跟windows类似,也是有服务概念的.最常用的服务,有ssh,telnet.在windows中,服务的管理是通过运行services.msc,进入系统服务管理界面中管理的.在Solaris底下,也有类似工具.

1.服务查看
    svcs可以查看系统中的服务.加上-a开关后,可以查看被disable了的服务,即被禁止启动了的服务.
----------------------------------------------------------------
bash-3.00# svcs -a | less
STATE          STIME    FMRI
legacy_run     15:00:58 lrc:/etc/rc3_d/S52imq
legacy_run     15:00:58 lrc:/etc/rc3_d/S80mipagent
legacy_run     15:00:58 lrc:/etc/rc3_d/S84appserv
disabled       15:00:21 svc:/system/metainit:default
disabled       15:00:21 svc:/system/device/mpxio-upgrade:default
disabled       15:00:22 svc:/network/ipsec/ike:default

    关于服务状态,从man smf中了解到,Solaris系统中的服务有以下状态:
     UNINITIALIZED    This is the initial state for  all  service
                      instances.  Instances  are moved to mainte-
                      nance, offline, or a  disabled  state  upon
                      evaluation   by   svc.startd(1M)   or   the
                      appropriate restarter.

     OFFLINE          The instance is enabled, but not  yet  run-
                      ning or available to run. If restarter exe-
                      cution of the service start method  or  the
                      equivalent   method   is   successful,  the
                      instance  moves  to   the   online   state.
                      Failures   might  lead  to  a  degraded  or
                      maintenance  state.  Administrative  action
                      can lead to the uninitialized state.

     ONLINE           The instance is enabled and running  or  is
                      available  to  run.  The specific nature of
                      the  online  state   is   application-model
                      specific  and  is  defined by the restarter
                      responsible  for  the   service   instance.
                      Online  is the expected operating state for
                      a  properly  configured  service  with  all
                      dependencies  satisfied.  Failures  of  the
                      instance can lead to a degraded or  mainte-
                      nance  state. Failures of services on which
                      the instance depends can lead to offline or
                      degraded states.

     DEGRADED         The instance  is  enabled  and  running  or
                      available to run. The instance, however, is
                      functioning at a limited capacity  in  com-
                      parison  to  normal  operation. Failures of
                      the instance can lead  to  the  maintenance
                      state.  Failures  of  services on which the
                      instance depends can  lead  to  offline  or
                      degraded  states.  Restoration  of capacity
                      should result in a transition to the online
                      state.

     MAINTENANCE      The instance is enabled, but  not  able  to
                      run.  Administrative  action is required to
                      restore the instance to offline and  subse-
                      quent  states.  The maintenance state might
                      be a temporarily reached state if an admin-
                      istrative operation is underway.

     DISABLED         The instance is disabled. Enabling the ser-
                      vice results in a transition to the offline
                      state and eventually to  the  online  state
                      with all dependencies satisfied.

     LEGACY-RUN       This state  represents  a  legacy  instance
                      that  is not managed by the service manage-
                      ment facility. Instances in this state have
                      been  started  at  some point, but might or
                      might not be running. Instances can only be
                      observed  using  the  facility  and are not
                      transferred into other states.

----------------------------------------------------------------
2.服务起停
    svcadm用来对服务进行起停禁用管理.
用法:svcadm [-v] [命令 [参数 ...]]

        svcadm enable [-rst] <服务> ... - 启用服务并使服务联机
        svcadm disable [-st] <服务> ... - 禁用服务并使服务脱机
        svcadm restart <服务> ...               - 重新启动指定的服务
        svcadm refresh <服务> ...               - 重新读取服务配置
        svcadm mark [-It] <状态> <服务> ...     - 设置维护状态
        svcadm clear <服务> ...         - 清除维护状态
        svcadm milestone [-d] <里程碑>  - 进入服务里程碑
   
3.服务配置与修改
    可以通过svccfg来修改系统的服务,不过由于对Solaris了解的不深,所以我也不太敢去修改系统中的服务.
   
    暂时就记录这么多.

论坛徽章:
0
2 [报告]
发表于 2011-12-22 16:47 |只看该作者
学习了

论坛徽章:
0
3 [报告]
发表于 2011-12-26 12:10 |只看该作者
谢谢楼主了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP