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了解的不深,所以我也不太敢去修改系统中的服务. 
    
    暂时就记录这么多.



本文转自leipei博客园博客,原文链接:http://www.cnblogs.com/leipei2352/archive/2011/07/31/2123183.html,如需转载请自行联系原作者

目录
相关文章
|
8月前
|
人工智能 自然语言处理 安全
2025年数字人平台综合排名解析:从技术性能到使用成本的全方位评估
在AI重塑内容创作的今天,必火AI数字人平台凭借全链路智能工作流脱颖而出。本文基于三个月实测,从克隆精度、多语言支持到成本效率,全面解析其技术优势与落地价值,为创作者与企业选型提供权威参考。
544 4
|
传感器 安全 中间件
深入浅出:SOME/IP协议中的服务发现机制解析
深入浅出:SOME/IP协议中的服务发现机制解析
1345 1
|
5月前
|
BI
春节复工后,2026年1688店铺想突围,这份操作运营指南请收好!
春节后1688运营必做清单:分三阶段——急救重启(发货清零、视觉焕新)、赛道布局(定位选品、数据诊断)、流量抢跑(搜索优化、老客召回)。聚焦金冠培育、新品破零、层级提升,踩准平台节奏,抢占开年红利!
|
23天前
|
人工智能 JSON 监控
阿里云开发者实践:用结构化数据驱动大模型可见度监控系统设计
黄小宇开展个人GEO实验,设计轻量级监控系统,通过结构化JSON(含score、混淆标识、引用源等)量化大模型对“黄小宇”实体的识别效果,实现“发布→监测→分析→迭代”闭环,助力AI时代个人名片可见度提升。(239字)
|
23天前
|
人工智能 安全 API
MetaMessage,開啟了API革命!
MetaMessage是AI时代新型结构化数据协议,自描述、自约束、自示例,支持JSONC注释语法(如`// mm: type=email; desc=邮箱`),实现跨语言精准交互、零损耗Schema传递与实时API契约验证,彻底告别过时文档与解析歧义。(239字)
78 1
|
4月前
|
人工智能 Linux API
零基础用OpenClaw实现公众号AI自动发文:阿里云/本地部署+Skill配置+避坑大全,效率提升90%
2026年,AI驱动内容自动化已经成为自媒体与企业运营的标配,而OpenClaw(Clawdbot)凭借极强的插件扩展能力、本地可控、全平台部署的优势,成为公众号自动发文、智能写稿、一键排版的最强工具。通过一套完整的Skill插件,用户只需要一句指令,就能让AI完成选题、写作、配图、排版、上传图片、生成草稿、推送预览的全流程,将原本2小时的工作压缩到10分钟以内,效率提升90%以上。
1564 7
nrm的使用
nrm的使用
1274 121
|
网络协议 5G 网络虚拟化
WiFI网速慢的原因都在这里了,3招教你WiFi慢的烦恼!
WiFI网速慢的原因都在这里了,3招教你WiFi慢的烦恼!
2815 2
|
存储 数据管理 数据安全/隐私保护
云存储:云计算储存
云存储是基于互联网的分布式数据存储服务,允许用户远程存储、访问和管理数据。它通过多台虚拟服务器提供存储空间,支持多种服务模式如对象存储、块存储等,广泛应用于文件共享、数据备份、在线办公等领域,市场规模持续扩大,技术不断进步,未来将更加智能、安全和灵活。
6025 9

热门文章

最新文章