zoukankan      html  css  js  c++  java
  • Less known Solaris features: svccfg editprop (ZT)

    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
  • 相关阅读:
    问题描述:判断一个整数 n 是否为 2 的幂次方
    C#的关键字Explicit 和 Implicit
    .NET写入文件操作
    C# Main函数详解
    SpringBoot增加过滤XSS脚本攻击
    Hutool工具包导出Excel文件异常 You need to add dependency of poi-ooxml to your project
    微信H5表单点击输入框提示防欺诈盗号,请勿支付或输入qq密码
    RedisTemplate执行lua脚本在Redis集群模式下报错EvalSha is not supported in cluster environment.
    SpringBoot使用RedisTemplate+Lua脚本实现Redis分布式锁
    SpringBoot使用Thymeleaf打成jar包部署找不到页面
  • 原文地址:https://www.cnblogs.com/cqubityj/p/3508466.html
Copyright © 2011-2022 走看看