Tag Archives: solaris

Solaris someuser cron not running

Keep running into this problem. Getting cron failures in /var/cron/log:

someuser 4151 c Mon Feb 29 12:35:00 1993
! bad user (someuser) Mon Feb 29 12:35:00 1993

Inevitably, the user has locked themselves (or a malicious someone) out of the server.

Check /etc/shadow for *LK* on the user.

passwd -u someuser to unlock.

Solaris 10 DNS Oops! WTF?! Oh Yeah!

When building Solaris 10 servers in bulk.. That is 1 or more at a time. I usually don’t enable any sort of name resolution until later.

That’s the problem. When later rolls around, I’ve forgotten that I hadn’t enabled anything.

This would be fine and dandy if nslookup or host would let me know that my /etc/nsswitch.conf is only looking at files. It ignores that and goes strictly with what is in /etc/resolv.conf seemingly. So if that’s broke or incorrect it will, at least, tell you that.

Anyway, the system I have come up with to quickly check if nsswitch.conf is setup for DNS is to ssh to a know hostname. If this fails, it usually means you need to copy nsswitch.dns over nsswitch.conf.

Another gotcha that gets me.

Solaris 10 Change IP/Network/Hostname

I seem to be searching and using the same google result a bunch lately. So here it is:

Changing the IP on Solaris 10 requires editing two files:

1. /etc/hosts
2. /etc/inet/ipnodes
3. /etc/netmasks (if subnet mask needs changing)

If you are changing network address, you will need to change the router address in the file:
1. /etc/defaultrouter

Changing the hostname now only requires editing these files:

1. /etc/hosts
2. /etc/nodename
3. /etc/hostname.”interface name”
hostname “hostname” (change until you can reboot)

Thanks to shiv729 at devshed.

Original forum post:

Simple Zone Construction

bash-3.00# zoneadm list -iv
0 global running /
11 foo running /export/zones/foo
13 bar running /export/zones/bar
bash-3.00# zonecfg -z fubar
fubar: No such zone configured
Use ‘create’ to begin configuring a new zone.

zonecfg:fubar> create
zonecfg:fubar> set zonepath=/export/zones/fubar
zonecfg:fubar> set autoboot=true
zonecfg:fubar> add net
zonecfg:fubar:net> set physical=eth0
zonecfg:fubar:net> set address=
zonecfg:fubar:net> end
zonecfg:fubar> add attr
zonecfg:fubar:attr> set name=comment
zonecfg:fubar:attr> set type=string
zonecfg:fubar:attr> set value=”FOOBED”
zonecfg:fubar:attr> end
zonecfg:fubar> verify
zonecfg:fubar> commit
zonecfg:fubar> exit

bash-3.00# zoneadm -z fubar install

Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <2434> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <980> packages on the zone.
Initialized <980> packages on zone.
Zone is initialized.
Installation of these packages generated warnings:
The file contains a log of the zone installation.

bash-3.00# zoneadm -z fubar boot

bash-3.00# zlogin -C fubar

Solaris 10: Zones

This is the first part in a series of notes taken regarding new(ish) Solaris 10 technologies. Other items I have notes on are ZFS and new service administration.

Zones, Containers, Domains and Partition (According to Sun):

Zone: chroot’d virtual machine. Some resources are shared, for example, the kernel or /usr/lib.
More info below.

Container: Zone with resource controls in place. At this time, limited to number of CPUs.
See “Resource Pools”

Domain: Grouping of hardware in enterprise class Sun servers

Partition: Segregation of domain grouped hardware.

Non-Global Zones (NGZ) can either be Sparse Root Model (/lib, /platform, /sbin, and /usr are linked from the Global Zone) or the Whole Root Model

Monitoring Zones:
prstat -Z show cpu/mem utilization on zones (including Global
rcapstat monitor memory caps
poolcfg -dc info get info on pools
zoneadm list -iv list zones and show status
zonecfg -z info show info on a zone

Resource Allocation (Resource Capping Daemon):
pooladm -e save active pool config in /etc/pooladm.conf
pooladm -x removes all user configured pools
projadd and projmod to limit memory

Zone creation and destruction:
zonecfg -z to configure zones
zoneadm -z uninstall uninstalls a zone (configuration is left intact)
zonecfg -z delete removes zone configuration completely (make backups)
zoneadm -z install install zone (copy files)

Zone Interaction (From the Global Zone):
zlogin -C virtual serial console
zlogin -S send command to zone w/o login
zoneadm -z boot boot the zone
zoneadm -z [halt | reboot]

Miscellaneous Zone Stuff:
/etc/zones contains data on all configured zones
Dynamic resource pools allow limiting of resources a zone can use
~. disconnect from virtual console (may blow you completely out)
~~. to disconnect from virtual console (use this if the above doesn’t work correctly)
NGZ’s cannot be an NFS Server currently.

Some of the resource management comments may seem to contradict each other. I will clarify these statements as I implement resource controls.