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. TCP的三个接收队列

    之前对于TCP接收过程中的三个队列的关系之前没搞清楚. 这几天,在同事邱的帮助下,终于把关系理清了,故特此做个笔记. 一.在软中断中加入数据包 tcp_v4_rcv()函数是tcp层收包的入口. in ...

  2. Vue v-on v-model 组合使用

    v-on vue可以使用v-on指令来监听事件,方便与用户进行交互.我们不需要修改DOM中的数据,所有的操作都由Vue来实现,你编写的代码只需要关注底层逻辑.这也是Vue强大的地方之一 <!DO ...

  3. jspxcms笔记三

    首页 index.html site :站点对象栏目 cover.html list.html node :栏目对象, text :正文详细 info.html node :栏目对象, info :文 ...

  4. 解析PHP中intval()等int转换时的意外异常情况

    <?php$a = 9.45*100;var_dump($a);var_dump(intval($a));$a = 945*1.00;var_dump($a);var_dump(intval($ ...

  5. 为WPF和Silverlight的Grid添加边框线

    http://www.cnblogs.com/chenxizhang/archive/2011/09/22/2185414.html

  6. J2EE配置tomcat

  7. 后勤LO采购数据源增强

    EIS采购数据源增强 1.       2LIS_02_HRD增强 1.1.         在标准数据源上增加字段 事务代码:LBWE 激活数据源字段 激活数据源 1.2.  在结构MC02M_0H ...

  8. 【Oracle】异常信息的加工处理

    引言     很多时候,我们调用oracle存储过程都会发生各种各样的异常信息,例如ORA-12899值过大,ORA-01400不能插入空值等.虽然说这类异常是前端没控制到位的缘故,但是现实很难100 ...

  9. bzoj 4299 Codechef FRBSUM

    定义一个集合的神秘数为不能表示成这个集合的某个子集和的最小正整数,给一个数列,多次求区间神秘数 $n \leq 100000$ sol: 考虑这个神秘数的性质,可以发现,如果神秘数是 $x$,那么 $ ...

  10. UVALive - 4126 Password Suspects (AC自动机+状压dp)

    给你m个字符串,让你构造一个字符串,包含所有的m个子串,问有多少种构造方法.如果答案不超过42,则按字典序输出所有可行解. 由于m很小,所以可以考虑状压. 首先对全部m个子串构造出AC自动机,每个节点 ...