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. hibernate学习(3)

    0 列表功能实现 1 表与表之间关系回顾 (1)一对多(客户和联系人) (2)多对多(用户和角色) 2 hibernate 一对多操作 (1)一对多映射配置 (2)一对多级联保存 (3)一对多级联删除 ...

  2. 03-dotnet core创建区域[Areas]及后台搭建

    熟悉MVC的人都知道从MVC4开始引入了区域的机制,区域的创建可以协助你在架构较大的项目中,让独立性较高的部分功能作为一个单独的子MVC系统,降低网站与网站之间的耦合度,也可以通过area切割,让多个 ...

  3. Visual Studio for Mac 安装

    有一周时间没有更新博客了,最近这段时间真是苦不堪言,上周四晚上,一杯水将我的MBP报废掉了,开机状态,键盘进水,当场就关机了,很担心当时爆炸了,幸好还只是关机,然后就...没有然后了.第二天插电源可以 ...

  4. asp.net 锚点

    可以使用锚点,但这里可使用灵活处理 首先获取需要滚动到的位置的id,如,可以设置一个元素(,注:要在form里),另外在form的任意位置设置 代码如下: 注:a标签里不要有内容,在回传的地方调用 代 ...

  5. 如何实现vue-cli搭建的前端项目的自动打包

    实现vue-cli + webpack +vue项目的自动打包: 后台java代码: public class OpenDirectory { public static void main(Stri ...

  6. Solr单机版安装

    感谢 shliuzw 的分享,原文地址http://blog.csdn.net/liuzhenwen/article/details/4060922 感谢 upxiaofeng 的分享,原文地址 ht ...

  7. LeetCode OJ:Binary Search Tree Iterator(二叉搜索树迭代器)

    Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the ro ...

  8. ps6-图层基础与操作技巧

    1.图层的新建.复制与删除 ctrl+j:复制图层,可以用复制选区作为新图层 Shift+Ctrl+Alt+e:在新的空白图层将下面所有的图层合并为一个图层. 2.选择复制与链接图层 在移动图层时,按 ...

  9. shell_script_查询主机名、ip地址 、DNS地址

    #!/bin/bashhostnameip=`/sbin/ifconfig eth0|grep "inet addr:"|sed 's/Bcast.*$//'g |awk -F & ...

  10. SVN管理多个项目版本库 (windows,linux 通用)

    SVN管理多个项目版本库: . 安装SVN服务器软件,路径: C:\Program Files\Subversion . 在D盘创建svn根目录D:\SVN-CM . 在D:\SVN-CM下创建SVN ...