Go to main content

Managing System Services in Oracle® Solaris 11.4

Exit Print View

Updated: Febuary 2019
 
 

Deleting Property Groups, Properties, and Property Values

The following commands delete property values, properties, and property groups:

svccfg setprop

Delete all values of a property.

svccfg delpropvalue

Delete all values of the specified property that match the specified pattern.

svccfg delprop

Delete a property.

svccfg delpg

Delete a property group.

svccfg delcust

Delete administrative customizations.

Remember to use the svccfg refresh command or svcadm refresh command to commit configuration changes into the running snapshot.

Deleting Administrative Configuration

Configuration modifications made by using svccfg commands or libscf calls modify only the admin layer of the service configuration repository. See Repository Layers for information about layers. When you delete configuration that is only defined in the admin layer and does not exist in any other layer, that configuration is gone. Commands that display configuration no longer show the deleted configuration, even when you use the -l option to show all layers of the service configuration repository. See Deleting Non-Administrative Configuration for information about deleting configuration that exists in other layers.

Example 36  Deleting All Values of a Property

Use the setprop subcommand as described in Setting Property Values. To delete all values of a property, do not specify any type or value. The values are deleted, but the property still exists.

$ svccfg -s my-svc:default setprop config/vendor =
$ svccfg -s my-svc:default listprop config/vendor
config/vendor   astring
Example 37  Deleting All Matching Values of a Property

Use the delpropvalue subcommand to delete all values of the named property that match the given pattern.

$ svccfg -s my-svc:default setprop config/tool = astring: \(hammer tongs wrench\)
$ svccfg -s my-svc:default listprop config
config           application        
config/customer astring     acustomer
config/vendor   astring     "vendora" "vendorb"
config/tool     astring     "hammer tongs wrench"
$ svccfg -s my-svc:default delpropvalue config/vendor '*b'
$ svccfg -s my-svc:default delpropvalue config/tool 'tong*'
$ svccfg -s my-svc:default listprop config
config           application        
config/customer astring     acustomer
config/vendor   astring     vendora
config/tool     astring     "hammer tongs wrench"
$ # config/tool is a single value that is a value set
$ svccfg -s my-svc:default delpropvalue config/tool '*tong*'
$ svccfg -s my-svc:default listprop config
config           application        
config/customer astring     acustomer
config/vendor   astring     vendora
config/tool     astring
Example 38  Deleting a Property

Use the delprop subcommand to delete the named property of the selected service or service instance.

$ svccfg -s my-svc:default delprop config/tool
$ svccfg -s my-svc:default listprop config
config           application        
config/customer astring     acustomer
config/vendor   astring     vendora
Example 39  Deleting a Property Group

The delpg and delprop subcommands both can delete a property group. The delpg subcommand deletes the named property group of the selected service or service instance. The delprop subcommand deletes the named property group if no property is named.

$ svccfg -s my-svc:default delpg config
$ svccfg -s my-svc:default listprop config
$
Example 40  Deleting Customizations

The delcust subcommand deletes administrative customizations on the selected service or service instance. Before you use the delcust subcommand, use the listcust subcommand with the same pattern or option to see what will be deleted. If a pattern is given, the pattern must match a property or property group.

$ svccfg -s my-svc:default listcust
config                             application admin                  
config/customer                   astring     admin                 acustomer
config/vendor                     astring     admin                 "vendora" "vendorb"
config/tool                       astring     admin                 "hammer tongs wrench"
$ svccfg -s my-svc:default listcust '*tool'
config/tool                       astring     admin                 "hammer tongs wrench"
$ svccfg -s my-svc:default delcust '*tool'
 Deleting customizations for property: config/tool
$ svccfg -s my-svc:default listcust '*tool'
$ svccfg -s my-svc:default listcust
config                             application admin                  
config/customer                   astring     admin                 acustomer
config/vendor                     astring     admin                 "vendora" "vendorb"

Deleting Non-Administrative Configuration

Configuration that exists in the sysconfig-profile, node-profile, site-profile, enterprise-profile, system-profile, and manifest layers of the service configuration repository is defined in service manifests and profile files. See Repository Layers for information about layers. SMF keeps the service configuration repository in sync with file system content. Any configuration that is defined in a manifest or profile file in a standard location still exists on the file system after administrative customization, including after being deleted, and is still stored in the service configuration repository. Configuration that is defined in a manifest or profile is said to have bundle support. When you delete configuration that has bundle support, the information is not deleted from the file system but is masked so that it is not seen in the normal view. See the smf(7) man page for a description of masked entities.

Deleting configuration that has bundle support is an administrative customization. In this case, the delcust subcommand unmasks the configuration, rather than deleting anything. Use the listcust -M subcommand to view masked configuration. Use the delcust -M subcommand to unmask configuration, or undo the deletion or masking of the configuration.

Example 41  Deleting Configuration that has Bundle Support

In Deleting Administrative Configuration, the config property group of the my-svc service only existed in the admin layer. The config property group did not exist in any manifest or profile. When those properties were deleted, they were gone from the system. This example shows the different result when you delete configuration that has bundle support.

The property is defined in the service manifest:

$ svccfg -s pkg/server listprop -l all pkg/inst_root
pkg/inst_root astring     admin               /export/ipsrepos/Solaris11
pkg/inst_root astring     manifest            /var/pkgrepo
$ svccfg -s pkg/server delprop pkg/inst_root

After deletion, the property is not displayed by using listprop with no options. Because the property has bundle support, the property still exists in the service configuration repository and can be displayed by using the -l or -M options with the listprop subcommand.

$ svccfg -s pkg/server listprop pkg/inst_root
$ svccfg -s pkg/server listprop -l all pkg/inst_root
pkg/inst_root astring     admin        MASKED /export/ipsrepos/Solaris11
pkg/inst_root astring     manifest     MASKED /var/pkgrepo
$ svccfg -s pkg/server listcust -M
pkg/inst_root astring     admin        MASKED /export/ipsrepos/Solaris11
Example 42  Unmasking Configuration

When you unmask the property, both customizations are gone:

  • The property is no longer masked or hidden.

  • The property no longer has its customized value.

$ svccfg -s pkg/server delcust -M
 Deleting customizations for property: pkg/inst_root
$ svccfg -s pkg/server listprop -l all pkg/inst_root
pkg/inst_root astring     manifest            /var/pkgrepo
$ svccfg -s pkg/server listprop pkg/inst_root
pkg/inst_root astring     /var/pkgrepo