Showing posts with label solaris. Show all posts
Showing posts with label solaris. Show all posts

Warning - Invalid account: 'sys' not allowed to execute cronjobs

In Solaris 11

error when try to enable / set cronjob for a user.
root@abc:/etc/cron.d# crontab -e sys
Warning - Invalid account: 'sys' not allowed to execute cronjobs

Pls check if the account has been locked, unlock it as below and retry
root@abc:/var/adm/sa# grep sys /etc/shadow
sys:*LK*NP:6445::::::

root@abc:/var/adm/sa# passwd -u sys
WARNING: changing account in reserved uid range: sys.
passwd: password information changed for sys


Solaris 11 set hostname

In Solaris 11 you will need few steps in order to set server hostname.

Check what was the current hostname
$ svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     abc
config/loopback             astring     abc

Set new hostname
$ svccfg -s system/identity:node setprop config/nodename="emp1"

Refresh and restart the system/identity:node service
$ svcadm refresh system/identity:node
$ svcadm restart system/identity:node

Verify changes
$ svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     emp1
config/loopback             astring     emp1

$ hostname
emp1

Add in hosts file too
root@conoemp1 # cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
10.10.10.1    emp1 emp1.com


Solaris 11.2 setting up IPS repo

Setting up IPS (Package Repository)

Show current repo location and the publisher name. assuming that you already created 2 separate IPS for base repo and SRU.
root@cdmu1 # pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F file:///var/share/pkg/SRU/
solaris                     origin   online F file:///var/share/pkg/repositories/

root@cdmu1 # pkgrepo info -s /var/share/pkg/SRU
PUBLISHER PACKAGES STATUS           UPDATED
solaris   221      online           2014-09-27T04:28:07.951747Z

root@cdmu1 # pkgrepo info -s /var/share/pkg/repositories
PUBLISHER PACKAGES STATUS           UPDATED
solaris   4870     online           2014-06-25T03:55:23.627994Z

Option1: Share the repo via NFS

root@cdmu1 # zfs share -o share.nfs=on rpool/VARSHARE/pkg/repositories%ipsrepo
root@cdmu1 # cat /etc/dfs/sharetab
-       IPC$    smb     -       Remote IPC
/var/share/pkg/repositories     ipsrepo nfs     sec=sys,rw

root@cdmu1 # dfshares
RESOURCE                                  SERVER ACCESS    TRANSPORT
  cdmu1:/var/share/pkg/repositories     cdmu1  -         -
root@cdmu1 # dfshares cdmu1
RESOURCE                                  SERVER ACCESS    TRANSPORT
  cdmu1:/var/share/pkg/repositories     cdmu1  -         -
To un-share
root@cdmu1 # dfshares
RESOURCE                                  SERVER ACCESS    TRANSPORT
  cdmu1:/var/share/pkg/repositories     cdmu1  -         -
root@cdmu1 # zfs unshare /var/share/pkg/repositories

Option2: setup Depot server that uses HTTP

Please double check on the listening port before proceeding. Default is using TCP80
We will multiple depot server that listens on different port.
root@cdmu1 # svcadm enable system-repository

root@cdmu1 # netstat -an | grep -i listen  | grep *.80
root@cdmu1 # svccfg -s pkg/server add solaris
root@cdmu1 # svccfg -s pkg/server:solaris setprop pkg/inst_root=/var/share/pkg/repositories
root@cdmu1 # svccfg -s pkg/server:solaris setprop pkg/readonly=true
root@cdmu1 # svccfg -s pkg/server:solaris setprop pkg/port=80
root@cdmu1 # svcprop -p pkg/inst_root application/pkg/server:solaris
/var/share/pkg/repositories
root@cdmu1 # svcadm enable application/pkg/server:solaris
root@cdmu1 # svcadm restart application/pkg/server:solaris
root@cdmu1 # netstat -an | grep -i listen  | grep *.80
      *.80                 *.*                  0      0  128000      0 LISTEN

root@cdmu1 # netstat -an | grep -i listen  | grep *.81
root@cdmu1 # svccfg -s pkg/server add SRU
root@cdmu1 # svccfg -s pkg/server:SRU setprop pkg/inst_root=/var/share/pkg/SRU
root@cdmu1 # svccfg -s pkg/server:SRU setprop pkg/readonly=true
root@cdmu1 # svccfg -s pkg/server:SRU setprop pkg/port=81
root@cdmu1 # svcprop -p pkg/inst_root application/pkg/server:SRU
/var/share/pkg/SRU
root@cdmu1 # svcadm enable application/pkg/server:SRU
root@cdmu1 # svcadm restart application/pkg/server:SRU
root@cdmu1 # netstat -an | grep -i listen  | grep *.81
      *.81                 *.*                  0      0  128000      0 LISTEN

Try to load the localhost IP with port 80 and 81

On the client

Point to the repo server IP and the publisher name
root@dbsu1:~# pkg set-publisher -G '*' -M '*' -g http://172.30.8.35:80/ solaris
root@dbsu1:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://172.30.8.35:80/


Solaris LDOM Dynamic Resource Allocation

Memory and CPU Dynamic Reconfiguration



Control Domain # ldm set-memory
Control Domain # ldm add-memory
Control Domain # ldm remove-memory
Control Domain # ldm set-vcpu
Control Domain # ldm add-vcpu
Control Domain # ldm remove-vcpu

Example:

Control Domain # ldm set-memory 16g domainA
Control Domain # ldm set-vcpu 4 domainA

Installing Java Development Kit (JDK) in Solaris SPARC

For Solaris on SPARC 64bit

To enable 64bit JDK on SPARC, you will need to install 2 components in sequence below.
Download below 2 item from Oracle website.

Java SE Development Kit 6u21             84.90 MB            jdk-6u21-solaris-sparc.sh                           <-32bit>
Java SE Development Kit 6u21             11.64 MB            jdk-6u21-solaris-sparcv9.sh        <- 64bit="">

First, you need to install the jdk-6u21-solaris-sparc.sh (32bit) version:
$ chmod u+x jdk-6u21-solaris-sparc.sh
$ ./jdk-6u21-solaris-sparc.sh

It will extract to a folder in current directory named as below:
$ ls -l jdk1.6.0_21

Second, you need to install the jdk-6u21-solaris-sparcv9.sh (64bit) version:
$ chmod u+x jdk-6u21-solaris-sparcv9.sh
$ ./jdk-6u21-solaris-sparcv9.sh

This will install the 64bit library into below:
$ cd jdk1.6.0_21/jre/lib
$ ll -d ./sparc*
drwxr-xr-x   9 root     root          55 Dec  8 14:15 ./sparc
drwxr-xr-x   8 root     root          48 Dec  8 14:16 ./sparcv9

Now mv it to a common folder and do a symbolic link:
$ mv jdk1.6.0_21 /usr/bin/
$ ln -s jdk1.6.0_21 java6

Show version

$ /usr/bin/java6/bin/java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Server VM (build 17.0-b17, mixed mode)

Solaris 11.2 set PROJECT share memory value "project.max-shm-memory"

prctl

show current value
$ id -p oracle
uid=501(oracle) gid=100(oinstall) projid=100(group.oinstall)
$ prctl -n project.max-shm-memory -i project group.oinstall

Show current user value
$ su - oracle
$ prctl -n project.max-shm-memory -i process $$

Add project
$ projadd user.oracle
$ projadd group.oinstall

Set value on-the-fly
$ prctl -n project.max-shm-memory -v 40gb -r -i project group.oinstall
$ prctl -n project.max-sem-ids -v 256 -r -i project group.oinstall

Set persistent
$ projmod -sK "project.max-shm-memory=(privileged,40G,deny)" group.oinstall

projmod

rename an existing project name (from user.oracle to group.oinstall)
$ projmod -l group.oinstall user.oracle

to remove a value, use -r and -K
$ projects -l default
default
        projid : 3
        comment: ""
        users  : (none)
        groups : (none)
        attribs: project.max-shm-memory=(privileged,103079215104,deny)
                 project.max.shm-memory=(privileged,15G,deny)

$ projmod -r -K project.max-shm-memory default
$ projects -l default
default
        projid : 3
        comment: ""
        users  : (none)
        groups : (none)
        attribs: project.max.shm-memory=(privileged,15G,deny)
        attribs: project.max-shm-memory=(privileged,42949672960,deny)

$ projmod -r -K project.max.shm-memory default
$ projects -l default
default
        projid : 3
        comment: ""
        users  : (none)
        groups : (none)
        attribs:


Solaris 11.2 LDOM auto-boot ?

How to make sure the LDOM was set to auto-boot when the physical machine reboots?

show current auto-boot status
$ eeprom | grep auto-boot

Set auto-boot

$ auto-boot?=true

Solaris 11.2 Setup DNS client


# svccfg -s dns/client setprop config/nameserver = net_address: 192.168.1.1
# svccfg -s dns/client setprop config/domain = astring: “myhost.org”
# svccfg -s name-service/switch setprop config/host = astring: \“files dns\”
# svcadm refresh name-service/switch
# svcadm refresh dns/client

Alternatively, you can just edit the /etc/resolv.conf and /etc/nsswitch.conf manually, and import them back to SMF.

# nscfg import -f svc:/system/name-service/switch:default
# nscfg import -f svc:/network/dns/client:default
# svcadm refresh dns/client

Solaris 11.2 Show link aggregation mode


If normal link aggregate
# dladm show-aggr
LINK    MODE      POLICY   ADDRPOLICY     LACPACTIVITY   LACPTIMER
aggr0   standard  L4       auto           on             short

If DLMP

# dladm show-aggr
LINK    MODE       POLICY  ADDRPOLICY      LACPACTIVITY   LACPTIMER
aggr0   haonly     --      ----            ---            ----

Subnetmask in HEX



Overview of common subnets and masks

Mask Hosts  Usable Netmask          Hex Mask
/30  4      2      255.255.255.252  fffffffc  this is 1/64 of a Class C net
/29  8      6      255.255.255.248  fffffff8  this is 1/32 of a Class C net
/28  16     14     255.255.255.240  fffffff0  this is 1/16 of a Class C net
/27  32     30     255.255.255.224  ffffffe0  this is 1/8 of a Class C net
/26  64     62     255.255.255.192  ffffffc0  this is 1/4 of a Class C net
/24  256    254    255.255.255.0    ffffff00  this is a Class C net
/23  512    510    255.255.254.0    fffffe00  these are 2 Class C net
/22  1024   1022   255.255.252.0    fffffc00  these are 4 Class C net
/21  2048   2046   255.255.248.0    fffff800  these are 8 Class C net
/20  4096   4094   255.255.240.0    fffff000  these are 16 Class C net
/19  8192   8190   255.255.224.0    ffffe000  these are 32 Class C net
/18  16384  16382  255.255.192.0    ffffc000  these are 64 Class C net
/17  32768  32766  255.255.128.0    ffff8000  these are 128 Class C net
/16  65536  65534  255.255.0.0      ffff0000  these are 256 Class C net = Class B net