http://www.c0t0d0s0.org/archives/7675-Less-known-Solaris-features-svccfg-editprop.html

Sometimes small features are really helpful. Nevertheless they are often relatively unknown. One of the examples is svccfg editprop (it's in Solaris for quite a while know, but it got more comfortable by showing less information in the recent time, in earlier times the tool showed almost everything ... useful or not).


Let's assume you want to change the IP number of the DNS server. You could use the normal svccfg –s dns/client setprop config/nameserver = net_address: 192.168.1.1 command. However sometimes you don't know the correct property to change.
In my example the server starts with the following value for the name server property:

root@template:~# svcprop  svc:/network/dns/client:default | grep "config/nameserver"
config/nameserver net_address 192.168.1.2

Of course, with the information i used in this command it's faster to use the direct svccfg method shown before, however I just use it here to show you the effect of the following command.

Instead of using the command to change the property mentioned above, you can use svccfg -s svc:/network/dns/client:default editprop . With this command you can change the properties of the SMF service /network/dns/client. However you don't have to memorize the properties. The command shows it to you and gives you a mechanism to alter the properties. It fires up an vi (or whatever you've configured your EDITOR environment variable) and displays the following data in it.

##
## Change property values by removing the leading '#' from the
## appropriate lines and editing the values. svccfg subcommands
## such as delprop can also be added to the script.
## ## Property group "config"
## The following properties are defined in the selected instance
## (svc:/network/dns/client:default) ##
## The value used to construct the "nameserver" directive in resolv.conf(4).
##
# setprop config/nameserver = net_address: 192.168.1.2 ## The following properties inherit from the parent service
## (svc:/network/dns/client) # setprop config/value_authorization = astring: solaris.smf.value.name-service.dns.client ## Uncomment to apply these changes to this instance.
# refresh

When you want to to change some properties just remove the # of the line you want to change, change the value of the property and remove the # in front of the last line containing # refresh.

The file should look like that (i'm omitting the lines with double-#).

setprop config/nameserver = net_address: 192.168.1.1
# setprop config/value_authorization = astring: solaris.smf.value.name-service.dns.client
refresh

As soon as you savequit the editor, the SMF is updated and refreshed.

root@template:~# svcprop  svc:/network/dns/client:default | grep "config/nameserver"
config/nameserver net_address 192.168.1.1

Really useful when you can't remember the necessary magic incantations for SMF configuration via setprop

Less known Solaris features: svccfg editprop (ZT)的更多相关文章

  1. Solaris Tips: Repairing the Boot Archive (ZT)

    http://www.seedsofgenius.net/solaris/solaris-tips-repairing-the-boot-archive 注意以下是系统盘非镜像情况下的操作,如果系统盘 ...

  2. Unix/Linux环境C编程入门教程(1) Solaris 11 64bit环境搭建

    Unix/Linux版本众多,我们推荐Unix/Linux初学者选用几款典型的Unix/Linux操作系统进行学习. 本文就带大家来安装Solaris 11 64位并且配置好C/C++开发环境 本文所 ...

  3. Unix/Linux周边环境C编程新手教程(1) Solaris 11 64bit环境结构

    Unix/Linux许多的版本号.我们推荐Unix/Linux刚開始学习的人选用几款典型的Unix/Linux操作系统进行学习. 本文就带大家来安装Solaris 11 64位而且配置好C/C++开发 ...

  4. Solaris 11 配置IP地址

    查看ipipadm show-addr 删除IP地址ipadm delete-addr net0/v4 配置IP地址ipadm create-addr –T static –a local=10.90 ...

  5. solaris下安装oracle 11g与11g rac

    1.To Find Swap, RAM, and OS Version 对于 Solaris 操作系统,查看 Swap, RAM, and OS Version 的方法: swap -l /usr/s ...

  6. Solaris 11配置IPS安装系统包(类似linux中的yum源)

    参考:http://blog.chinaunix.net/uid-8860-id-3777457.html 一. 概述: Solaris 11被称为第一个云操作系统,因此在很多方面体现了云系统的一些特 ...

  7. Configuring Transitive IPMP on Solaris 11

    http://www.tokiwinter.com/configuring-transitive-ipmp-on-solaris-11/ We all know the pain of configu ...

  8. Solaris与Windows Active Directory集成

    通过Solaris与Active Directory的集成,Solaris可以使用Windows 2003 R2/ 2008 Active Directory来进行用户登录验证.以下是简要配置过程. ...

  9. Java 8 New Features

    What's New in JDK 8 https://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html Java Pla ...

随机推荐

  1. MVC 嵌套页面Html.Partial

    return View()相关简介 在asp.net mvc中返回View时使用的是ViewResult,它继承自ViewResultBase 同时它还有个兄弟PartialViewResult.一个 ...

  2. window.onload=function(){}和$(function(){})的区别

    1.执行的个数的不同: window.onload()只会执行最后一个,些多个也会被最后一个覆盖. $(function(){})可以写多个,也会执行多个,按照从上至下的顺讯执行 2.执行时间上的不同 ...

  3. 安全的 ActiveMQ

    本章知识点 ActiveMQ 鉴权 ActiveMQ 授权 怎么创建一个自定义安全插件 使用基于证书的安全保证 简介 安全地访问消息代理以及它的 destinations 是公众关注的焦点.因此,Ac ...

  4. [Alfred]为Baidu Weather Workflow更新图标

    Alfred workflow:百度天气,修改更新图标显示: 下载:https://github.com/BobSte/weather-workflow 原始代码是php脚本,为其增加了一个取图片的函 ...

  5. Windows 10 Certified with Oracle E-Business Suite

    Microsoft Windows 10 (32-bit and 64-bit) is certified as a desktop client operating system for end-u ...

  6. (转) Android Service完全解析,关于服务你所需知道的一切(上)

    相信大多数朋友对Service这个名词都不会陌生,没错,一个老练的Android程序员如果连Service都没听说过的话,那确实也太逊了.Service作为Android四大组件之一,在每一个应用程序 ...

  7. 《Effective C++》——条款08:别让异常逃离析构函数

    考虑如下代码: class Widget{ public: ... ~Widget(){...}//假设这个可能吐出一个异常 }; void doSomething() { std::vector&l ...

  8. signal 信号具体含义解释~

    ) SIGHUP 本信号在用户终端连接(正常或非正常)结束时发出,通常是在终端的控 制进程结束时, 通知同一session内的各个作业,这时它们与控制终端不再关联. ) SIGINT 程序终止(int ...

  9. js改变select的选中项不触发select的change事件

    // test var selectEl = document.querySelector('select') var buttonEl = document.querySelector('butto ...

  10. Thinkphp 自定义404页面

    一. 手册->调试->异常处理 在公共config.php 中加入: 'TMPL_EXCEPTION_FILE' => '/Public/404.html', //访问不存在的跳转 ...