Showing posts with label svccfg. Show all posts
Showing posts with label svccfg. Show all posts

Thursday, December 12, 2013

Solaris 11- Configuring Nsswitch.conf

##Configuring nsswitch.conf
The next step is to configure the svc:/system/name-service/switch service .

solaris:~$ svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/default = files
svc:/system/name-service/switch> setprop config/host = "files dns"
svc:/system/name-service/switch> setprop config/ipnode = astring: "files dns"
svc:/system/name-service/switch> exit
solaris:~$ svcadm refresh name-service/switch
solaris:~$ svcadm restart name-service/switch

Now examine the /etc/nsswitch.conf to confirm it worked:


Solaris 11 - How to change the hostname of the server?

1 - To check the current environment properties:
root@solaris:~# svccfg -s system/identity:node listprop config
config                 application        
config/enable_mapping boolean     true
config/nodename       astring     solaris
config/loopback       astring     solaris
2 - Set the new hostname
root@solaris:~# svccfg -s system/identity:node setprop config/nodename="my-host-name"
root@solaris:~# svccfg -s system/identity:node setprop config/loopback="my-host-name"
3- Refresh the properties:
root@solaris:~# svccfg -s system/identity:node refresh
4 - Restart the service:
root@solaris:~# svcadm restart system/identity:node
5 - verify that the changes took place:
root@solaris:~# svccfg -s system/identity:node listprop config
config                 application       
config/enable_mapping boolean     true
config/nodename       astring     my-host-name
config/loopback       astring     my-host-name
root@solaris:~# hostname

my-host-name

Friday, November 8, 2013

How-to for simple SysAdmin tasks which gets performed differently on Solaris 11

The previous behavior of modifying a configuration file to configure naming services no longer works. 

How a system will get information on hosts, users? 

On Solaris 10 - Update /etc/nsswitch.conf

On Solaris 11 

#svccfg -s svc:/system/name-service/switch:default


How a system will be able to resolve the hostname resolution with DNS?

On Solaris 10 - Update /etc/resolv.conf

On Solaris 11

# svccg
svc:> select /network/dns/client
svc:/network/dns/client> setprop config/options = "ndots:2,retrans:3,retry:1"
svc:/network/dns/client> listprop config/options
config/options astring     ndots:2,retrans:3,retry:1
# svcadm refresh dns/client

How to change the hostname of the system?
On Solaris 10- Update /etc/nodename

On Solaris 11

# svccfg -s svc:/system/identity:node setprop config/nodename = astring: nodename
# svcadm refresh svc:/system/identity:node

# svcadm restart svc:/system/identity:node

How to change or configure Locale and the timezone?



Solaris 11 -changing locale
# svccfg -s svc:/system/environment:init setprop environment/LANG = astring: fr_FR.UTF-8# svcadm refresh svc:/system/environment


Solaris 11- For changing Timezone

# svccfg -s timezone:default setprop timezone/localtime= astring: US/Mountain

# svcadm refresh timezone:default

How to set default route on Solaris 10 vs 11?
On Solaris 10,
You need to update /etc/defaultrouter

Oracle Solaris 11, you can persistently set the default route for a system,
route -p add default ip-address