<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Running UNIX</title>
	<atom:link href="http://www.runningunix.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.runningunix.com</link>
	<description>UNIX/Solaris tips, tricks, and advice</description>
	<lastBuildDate>Thu, 18 Oct 2012 05:31:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Backing out Patches from an Unbootable Server</title>
		<link>http://www.runningunix.com/2009/06/backing-out-patches-from-an-unbootable-server/</link>
		<comments>http://www.runningunix.com/2009/06/backing-out-patches-from-an-unbootable-server/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 16:52:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[patching]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[patchrm]]></category>
		<category><![CDATA[unbootable]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=251</guid>
		<description><![CDATA[Sometimes when patching gets interrupted &#8211; by a user, power outage, hardware failure, etc, you can end up with incomplete or mis-installed patches. If these patches are important ones &#8211; like kernel patches, your system may not even boot from disk. Many times this will cause an endless reboot cycle of kernel panics. Of course [...]]]></description>
				<content:encoded><![CDATA[<p>Sometimes when patching gets interrupted &#8211; by a user, power outage, hardware failure, etc, you can end up with incomplete or mis-installed patches. If these patches are important ones &#8211; like kernel patches, your system may not even boot from disk. Many times this will cause an endless reboot cycle of kernel panics.</p>
<p>Of course you could have prevented this by breaking your root mirror before installing the patches, or by using LiveUpgrade. But I know sometimes we just don&#8217;t do these things, for various reasons.</p>
<p>One solution to this is to boot from the network into single-user mode, mount your root disk, and back out the patch or patches on disk, hopefully repairing the damage and returning you to a bootable state. Of course this is assuming you have a jumpstart server on your network as well. NOTE: I tested this with a Solaris 10 06/06 boot image on the jumpstart server &#8211; I haven&#8217;t tested earlier versions)</p>
<p>Where I am, all the root disks are mirrored with SVM. An procedure I&#8217;d used in the past was to boot from the network, run patchrm on the first disk in the mirror to back out the patch, and then disable the mirror, so the second disk would not be used when rebooted. Then re-mirror later. This was rather tedious and error-prone, especially with multiple metadevices, soft partitions, etc. I found a new way to accomplish this task: keep the mirror intact and back out the patches while booted from the network. Our systems also use zones, and their zonepaths are on soft partitions. This procedure will also back out the patches from the zones. Here is the exact procedure:<br />
<code><br />
1. Boot from network into single-user mode<br />
	ok> boot net -s<br />
2. Mount root file system READ ONLY from the first disk in the mirror:<br />
	# mount -o ro /dev/dsk/c1t0d0s0 /mnt<br />
3. Copy the SVM configuration to the running OS:<br />
	# cp /mnt/kernel/drv/md.conf /kernel/drv/md.conf<br />
4. Unmount the root disk<br />
	# umount /mnt<br />
5. Update the SVM driver to load the new configuration (ignore error messages)<br />
	# update_drv -f md<br />
6. Set up metadevices in configuration<br />
	# metainit -r<br />
7. Run metasync on root mirror metadevice<br />
	# metasync d10<br />
8. Mount root metadevice on /mnt<br />
	# mount /dev/md/dsk/d10 /mnt<br />
9. If the system has zones, run metasync on the metadevice containing the soft partitions, and mount all zone root file systems<br />
	# metasync d40<br />
	# mount /dev/md/dsk/d53 /mnt/zones/zonepath1<br />
	# mount /dev/md/dsk/d56 /mnt/zones/zonepath2<br />
10. Rollback the failed patch.<br />
	# patchrm -R /mnt $patch 2>&#038;1 | tee -a /mnt/backout.log<br />
11. umount /mnt and reboot server<br />
</code></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F06%2Fbacking-out-patches-from-an-unbootable-server%2F&amp;title=Backing%20out%20Patches%20from%20an%20Unbootable%20Server" id="wpa2a_2"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/06/backing-out-patches-from-an-unbootable-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solaris Patching Strategy &amp; Tools</title>
		<link>http://www.runningunix.com/2009/03/patching-strategy/</link>
		<comments>http://www.runningunix.com/2009/03/patching-strategy/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 03:01:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=213</guid>
		<description><![CDATA[There are many strategies for patching your servers. I&#8217;ve worked in environments where we followed the &#8220;if it ain&#8217;t broke, don&#8217;t patch&#8221; philosophy, and 10 years ago this seemed reasonable in Solaris. Other environments try to apply every patch available from their vendors. I think the best approach is of course somewhere in between. Sun [...]]]></description>
				<content:encoded><![CDATA[<p>There are many strategies for patching your servers. I&#8217;ve worked in environments where we followed the &#8220;if it ain&#8217;t broke, don&#8217;t patch&#8221; philosophy, and 10 years ago this seemed reasonable in Solaris. Other environments try to apply every patch available from their vendors. I think the best approach is of course somewhere in between.</p>
<p>Sun makes available several patch bundles that many customers use for patching. The most popular bundle is the Recommended patch cluster for your Solaris version. This patch cluster provides the latest revisions of any patch that addresses a Sun Alert, which is any fix for security, data corruption or system availability. This is well-tested combination of patches, known to be stable and compatible.</p>
<p>A second patch cluster is also available from Sun &#8211; the Sun Alert patch cluster. This cluster is similar to the recommended cluster, but with one difference. It contains the <strong>minimum</strong> revision of any patch that addresses a Sun Alert. Applying this cluster will fix all Sun Alert issues, while introducing the least amount of change to your systems.</p>
<p>Once you have more that 50 servers, it can take months to completely patch them, depending on maintenance windows and uptime requirements. Sometimes it&#8217;s difficult to know if a particular server is patched yet or not, or when the last patching took place. One trick I learned a while back was to create a nearly-empty Solaris package, with only a text file, containing the patch level installed. This package is installed or updated with each patch cycle so you know exactly which set of patches is installed at any time.</p>
<p>Sun has come up with several patch management tools over the years, some better than others (PatchDiag, PatchCheck, PatchPro, smpatch). The most recent uses the &#8220;Patch Update Manager&#8221; in Solaris 10 or the xVM Ops Center product. If you&#8217;re looking for something low cost (free), then it might be worth looking at <a href="http://www.par.univie.ac.at/solaris/pca/">Patch Check Advanced</a>. This tool analyzes your system, automatically downloads and installs patches fairly easily. It&#8217;s a great tool.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F03%2Fpatching-strategy%2F&amp;title=Solaris%20Patching%20Strategy%20%26%20Tools" id="wpa2a_4"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/03/patching-strategy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oracle Dynamic SGA in Solaris Zones</title>
		<link>http://www.runningunix.com/2009/02/oracle-dynamic-sga-in-solaris-zones/</link>
		<comments>http://www.runningunix.com/2009/02/oracle-dynamic-sga-in-solaris-zones/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 05:17:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[performance]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[dism]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sga]]></category>
		<category><![CDATA[shared memory]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=238</guid>
		<description><![CDATA[Since 9i, Oracle has included a feature to dynamically resize the SGA of the database when needed, without the need to restart the database. It utilizes Solaris &#8220;Dynamic Intimate Shared Memory&#8221; (DISM) to accomplish this. DISM provides dynamically resizable shared memory. Any process that uses a DISM segment can lock and unlock parts of a [...]]]></description>
				<content:encoded><![CDATA[<p>Since 9i, Oracle has included a feature to dynamically resize the SGA of the database when needed, without the need to restart the database. It utilizes Solaris &#8220;Dynamic Intimate Shared Memory&#8221; (DISM) to accomplish this.</p>
<p>DISM provides dynamically resizable shared memory. Any process that uses a DISM segment can lock and unlock parts of a memory segment, and by doing so, the application can dynamically adjust to the addition (or removal) of physical memory from a server.</p>
<p>In the initial releases of Solaris 10, DISM was unavailable within Solaris Zones, because the ability for processes to lock memory segments was not available. If you do try to run Oracle with DISM in Zones before 11/06, you&#8217;ll see completely awful database performance (I&#8217;ve seen it). The fix for this was to disable DISM in Oracle, by setting the Oracle parameters sga_max_size and sga_target to the same value, so the SGA would not resize at all.</p>
<p>Solaris 10 update 3 (11/06) introduced a new zone privilege: proc_lock_memory, which gives processes within the zone the ability to lock memory segments. So DISM will now work if this privilege is enabled. To enable it, just turn it on in the zone config and reboot the zone:</p>
<blockquote><p>
# zonecfg -z oraclezone<br />
zonecfg:oraclezone> set limitpriv=default,proc_lock_memory<br />
zonecfg:oraclezone> commit<br />
zonecfg:oraclezone> exit<br />
# zoneadm -z oraclezone reboot
</p></blockquote>
<p>If you see an error after the &#8220;set limitpriv&#8221; line when you try, make sure you have Solaris 11/06 or later (or the patched equivilant).</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F02%2Foracle-dynamic-sga-in-solaris-zones%2F&amp;title=Oracle%20Dynamic%20SGA%20in%20Solaris%20Zones" id="wpa2a_6"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/02/oracle-dynamic-sga-in-solaris-zones/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cleaning out /var in Solaris</title>
		<link>http://www.runningunix.com/2009/02/cleaning-out-var-in-solaris/</link>
		<comments>http://www.runningunix.com/2009/02/cleaning-out-var-in-solaris/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 04:59:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[space]]></category>
		<category><![CDATA[var]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=234</guid>
		<description><![CDATA[Since your Solaris 10 installation, your data in the /var file system will grow each time you apply a patch. Depending on your patching strategy, over time you could find yourself running out of space, if you use a dedicated /var partition. This, in addition to mail, and logging from all kinds of applications can [...]]]></description>
				<content:encoded><![CDATA[<p>Since your Solaris 10 installation, your data in the /var file system will grow each time you apply a patch. Depending on your patching strategy, over time you could find yourself running out of space, if you use a dedicated /var partition. This, in addition to mail, and logging from all kinds of applications can worsen the problem.</p>
<p>I&#8217;d say the best strategy is to increase the size of /var. If you&#8217;re using the standard UFS file system with no volume management, this means backing up, re-creating the partition, and restoring the data. If you do have some sort of volume management, sometimes the answer is a simple metattach/growfs or vxresize command.</p>
<p>If you want another option, just to get your by until you have the time to increase /var, there is another easy method. When patchadd adds any patch to the system, the files being replaced get saved off in case you need to remove the patch later, restoring these files. These files are compressed and stored in /var/sadm/pkg/
<pkgname>/save/<PatchID> and in /var/sadm/pkg/
<pkgname>/save/pspool/
<pkgname>/save/<PatchID>.  The files are called undo.Z.</p>
<p>Note: It is completely safe to delete these .Z files, as long as you are sure you will never need to back out its associated patch! Doing this can free up significant space.</p>
<p>I&#8217;ve even done things like this in a pinch: (the shotgun approach)</p>
<blockquote><p>#find /var -name undo.Z -exec rm {} \;
</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F02%2Fcleaning-out-var-in-solaris%2F&amp;title=Cleaning%20out%20%2Fvar%20in%20Solaris" id="wpa2a_8"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/02/cleaning-out-var-in-solaris/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Link-based IPMP setup with VCS</title>
		<link>http://www.runningunix.com/2009/01/link-based-ipmp-setup-with-vcs/</link>
		<comments>http://www.runningunix.com/2009/01/link-based-ipmp-setup-with-vcs/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 11:15:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[network]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[vcs]]></category>
		<category><![CDATA[ipmp]]></category>
		<category><![CDATA[redundant]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=89</guid>
		<description><![CDATA[With Solaris 10 came a nice feature &#8211; Link-based IP Multipathing (IPMP). It determines NIC availability solely on the NIC driver reporting the physical link status &#8211; UP or DOWN. Previous versions used &#8220;probe-based&#8221; IPMP, where connectivity is tested by pinging something on the network from each interface. While probe-based is actually a more thorough [...]]]></description>
				<content:encoded><![CDATA[<p>With Solaris 10 came a nice feature &#8211; Link-based IP Multipathing (IPMP). It determines NIC availability solely on the NIC driver reporting the physical link status &#8211; UP or DOWN. Previous versions used &#8220;probe-based&#8221; IPMP, where connectivity is tested by pinging something on the network from each interface. While probe-based is actually a more thorough test (tests network layer 3 as well as 2), it is much more cumbersome to configure, and you need an extra IP address for each interface for &#8220;test&#8221; addresses. IMO Link-based IPMP is sufficient for most applications.</p>
<p></p>
<p>For some reason, configuring link-based IPMP in VCS is somewhat tricky, and the documentation doesn&#8217;t seem to help much. It seems all the default values for VCS are for probe-based IPMP only.</p>
<p>To achieve link-based IPMP, here&#8217;s how I&#8217;ve configured my MultiNICB resource:<br />
<div id="attachment_216" class="wp-caption alignnone" style="width: 488px"><a href="http://www.runningunix.com/wp-content/uploads/2009/01/multinicb.jpg"><img src="http://www.runningunix.com/wp-content/uploads/2009/01/multinicb.jpg" alt="Link-based IPMP MultiNICB properties" title="multinicb" width="478" height="558" class="size-full wp-image-216" /></a><p class="wp-caption-text">Link-based IPMP MultiNICB properties</p></div><br />
These are the values you must change from the defaults:</p>
<p><strong>UseMpathd: 1</strong><br />
Tells VCS to use mpathd for network link status<br />
<strong>MpathCommand: /usr/lib/inet/in.mpathd -a</strong><br />
The default, /usr/sbin/in.mpathd is just incorrect &#8211; it doesn&#8217;t live there.<br />
<strong>ConfigCheck: 0</strong><br />
If you leave this at 1, it will overwrite your /etc/hostname.xxx files with probe-based IPMP configuration<br />
<strong>Device: (your IPMP interfaces here)</strong><br />
The &#8220;interface alias&#8221; for each device is not needed, leave them blank.<br />
<strong>IgnoreStatus: 0</strong><br />
You want VCS to NOT ignore link status, since this is how link-based IPMP works.<br />
<strong>GroupName: <blank></strong><br />
Do not use your IPMP group name here, it&#8217;s not needed. VCS is not monitoring the group, mpathd is.</p>
<p>Here&#8217;s how it looks in main.cf:</p>
<blockquote><p>
        MultiNICB csgmultinic (<br />
                UseMpathd = 1<br />
                MpathdCommand = &#8220;/usr/lib/inet/in.mpathd -a&#8221;<br />
                ConfigCheck = 0<br />
                Device = { ce0 = &#8220;&#8221;, ce4 = &#8220;&#8221; }<br />
                IgnoreLinkStatus = 0<br />
                )
</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F01%2Flink-based-ipmp-setup-with-vcs%2F&amp;title=Link-based%20IPMP%20setup%20with%20VCS" id="wpa2a_10"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/01/link-based-ipmp-setup-with-vcs/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Changing timeouts on SMF services</title>
		<link>http://www.runningunix.com/2009/01/changing-timeouts-on-smf-services/</link>
		<comments>http://www.runningunix.com/2009/01/changing-timeouts-on-smf-services/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 18:23:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[psncollector]]></category>
		<category><![CDATA[smf]]></category>
		<category><![CDATA[timeout]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=209</guid>
		<description><![CDATA[I&#8217;ve run into an issue where the default timeout value (120 seconds) was not long enough for the start methods to run for my system services. In particular, the psncollector service. The psncollector service runs a &#8216;prtfru -x&#8217; command, which can take several minutes to complete on a large server like an E2900. With the [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve run into an issue where the default timeout value (120 seconds) was not long enough for the start methods to run for my system services. In particular, the psncollector service.</p>
<p>The psncollector service runs a &#8216;prtfru -x&#8217; command, which can take several minutes to complete on a large server like an E2900. With the 120 second timeout, the start method fails:</p>
<blockquote><p>
# svcs -x<br />
svc:/application/psncollector:default (Product Serial Number Collector)<br />
 State: maintenance since Sun 25 Jan 2009 10:01:34 AM PST<br />
Reason: Start method failed repeatedly, last died on Killed (9).<br />
   See: http://sun.com/msg/SMF-8000-KS<br />
   See: /var/svc/log/application-psncollector:default.log<br />
Impact: This service is not running.</p>
<p># tail /var/svc/log/application-psncollector:default.log<br />
[ Jan 25 08:59:51 Executing start method ("/lib/svc/method/svc-psncollector") ]<br />
Using /var/run<br />
[ Jan 25 09:02:01 Method or service exit timed out.  Killing contract 48 ]<br />
[ Jan 25 09:02:05 Method or service exit timed out.  Killing contract 48 ]<br />
[ Jan 25 09:02:18 Method "start" failed due to signal KILL ]
</p></blockquote>
<p>The easy fix was to increase the service start timeout value:</p>
<blockquote><p>
# svccfg -s psncollector setprop start/timeout_seconds=480<br />
# svccfg -s psncollector setprop restart/timeout_seconds=480<br />
# svcadm refresh psncollector<br />
# svcadm clear psncollector
</p></blockquote>
<p>Once cleared, the service started up, taking its usual 3+ minutes.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F01%2Fchanging-timeouts-on-smf-services%2F&amp;title=Changing%20timeouts%20on%20SMF%20services" id="wpa2a_12"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/01/changing-timeouts-on-smf-services/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What is Load Average in Solaris?</title>
		<link>http://www.runningunix.com/2009/01/what-is-load-average-in-solaris/</link>
		<comments>http://www.runningunix.com/2009/01/what-is-load-average-in-solaris/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 13:50:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[calculation]]></category>
		<category><![CDATA[cpu]]></category>
		<category><![CDATA[load average]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=190</guid>
		<description><![CDATA[What is load average? I&#8217;ve heard all kinds of vague explanations over the years, and it bothers me to continue hearing all the absolutely wrong descriptions of the term and what are &#8220;high&#8221; values for this number. I&#8217;ve heard things like &#8220;anything higher than 3X your number of CPUs is bad&#8221;, or &#8220;as long as [...]]]></description>
				<content:encoded><![CDATA[<p>What is load average? I&#8217;ve heard all kinds of vague explanations over the years, and it bothers me to continue hearing all the absolutely wrong descriptions of the term and what are &#8220;high&#8221; values for this number. I&#8217;ve heard things like &#8220;anything higher than 3X your number of CPUs is bad&#8221;, or &#8220;as long as it&#8217;s under 10 everything should be fine.&#8221; Not so.</p>
<p></p>
<p>Some of the misconceptions come from other UNIX and Linux OS&#8217;s, which measure the value differently. So an incorrect definition doesn&#8217;t necessarily demonstrate a lack of knowledge, but some amount <a href="http://www.teamquest.com/resources/gunther/display/5/">ignorance to the way Solaris does it.</a> Linux for example, also includes in its calculation the threads waiting for I/O, not just threads waiting for CPU.</p>
<p>In previous versions of Solaris (2.3-2.9), load average was a simple calculation. It was the average number of runnable and running threads. In other words, it was the number of threads running on the CPUs, plus the number of threads in the run queue, waiting for CPUs, averaged over time.</p>
<p>In Solaris 10, load average is calculated slightly differently than in previous versions.</p>
<blockquote><p>The calculation is made by summing high-resolution user time, system time, and thread wait time, then processing this total to generate averages with exponential decay.
</p></blockquote>
<p>This calculation is slightly more comprehensive (and complex), because it takes into account CPU latency &#8211; the time taken to move a thread from the run queue onto a CPU. However, the older way of calculating this will yield almost identical results, so either definition I&#8217;d call &#8220;correct&#8221;. I still use the older definition because it is just easier to understand.</p>
<p>So what is a &#8220;high&#8221; number for load average? Well, first it depends on how many CPUs you have on your system, since the calculations do not take that into account. If you have one CPU, then a load average of 1.0 would mean you are, on average, consuming exactly 100% of that one CPU over the measurement period. If your number climbs above 1.0, then you have threads in the run queue at some point, waiting for CPU time. Solaris actually handles CPU saturation very well, so this may not mean your performance will degrade; it just means your CPU is well-used.</p>
<p>On the other hand, if you have 8 CPUs and a load average of 32, you may be seeing a performance degradation, as your system is somewhat CPU-bound. Each CPU is, on average, 100% utilized by running threads, and there are, on average, 24 more threads in the run queue. Depending on the application, this may be acceptable &#8211; it just depends on the expected response-time or expected processing time for your application.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F01%2Fwhat-is-load-average-in-solaris%2F&amp;title=What%20is%20Load%20Average%20in%20Solaris%3F" id="wpa2a_14"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/01/what-is-load-average-in-solaris/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Restoring File Permissions in Solaris</title>
		<link>http://www.runningunix.com/2009/01/restoring-file-permissions-in-solaris/</link>
		<comments>http://www.runningunix.com/2009/01/restoring-file-permissions-in-solaris/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 18:00:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[file permissions]]></category>
		<category><![CDATA[oops]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=177</guid>
		<description><![CDATA[Have you ever done something like this accidentally? # chmod -R 777 /usr ^C^C^C Oops &#8211; You just changed some files in /usr to 777 before you were able to cancel. You don&#8217;t know how many or which files were affected. pkgchk can save you here. In Solaris, there is a software &#8220;registry&#8221; file, /var/sadm/install/contents, [...]]]></description>
				<content:encoded><![CDATA[<p>Have you ever done something like this accidentally? </p>
<blockquote><p>
# chmod -R 777 /usr<br />
^C^C^C
</p></blockquote>
<p>Oops &#8211; You just changed some files in /usr to 777 before you were able to cancel. You don&#8217;t know how many or which files were affected. pkgchk can save you here.</p>
<p>In Solaris, there is a software &#8220;registry&#8221; file, /var/sadm/install/contents, which gives us information on every file installed on the system, or at least every file associated with a Solaris package. This file includes information about file permissions, owner and group information, file size and checksum.  Here&#8217;s an excerpt from the contents file:</p>
<blockquote><p>/etc/opt/SUNWexplo/t3files.txt f none 0444 root bin 123 11760 1208943439 SUNWexplu<br />
/etc/opt/SUNWexplo/t3input.txt e build 0400 root bin 590 45160 1208943439 SUNWexplu<br />
/etc/opt/SUNWexplo/tapeinput.txt e build 0400 root bin 885 6403 1208943439 SUNWexplu<br />
/etc/opt/SUNWexplo/xscfinput.txt e build 0400 root bin 758 60717 1208943439 SUNWexplu<br />
/etc/pam.conf e pamconf 0644 root sys 3103 17166 1219679093 SUNWcsr<br />
/etc/passwd e passwd 0644 root sys 672 56039 1219679093 SUNWcsr<br />
/etc/patch d none 0755 root sys SUNWppror<br />
/etc/patch/patch.conf v preserve 0644 root sys 365 31670 1186005379 SUNWppror<br />
/etc/patch/secret.conf v preserve 0600 root sys 207 17050 1186005379 SUNWppror<br />
/etc/path_to_inst v preserve 0444 root root 26 2566 1106347450 SUNWcsd<br />
/etc/power.conf e powerconf 0644 root sys 488 40965 1106350205 SUNWpmr<br />
/etc/printers.conf e preserve 0644 root sys 162 13902 1106350198 SUNWpcr<br />
/etc/profile e etcprofile 0644 root sys 712 51625 1219679093 SUNWcsr
</p></blockquote>
<p>The pkgchck command can be used to fix the file attributes (owner and group) of any or all package-installed files.</p>
<blockquote><p>
# pkgchk -f
</p></blockquote>
<p>This command would check every file listed in /var/sadm/install/contents, and if needed, change the owner and permissions of the files on the system to match the registry. Yes, this is sort of a shotgun approach, and you may not want to invoke changes this widely across the system. </p>
<p>In my example, only /usr was affected, so you can narrow down the criteria with a find command:</p>
<blockquote><p>
# find /usr -perm 777 -exec pkgchk -f -p {} \;
</p></blockquote>
<p>Or if you only changed one file, and now want it to change it back to whatever it was, just tell pkgchk to only work on the file you specify:</p>
<blockquote><p>
# pkgchk -f -p /etc/crypto/kcf.conf
</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F01%2Frestoring-file-permissions-in-solaris%2F&amp;title=Restoring%20File%20Permissions%20in%20Solaris" id="wpa2a_16"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/01/restoring-file-permissions-in-solaris/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Silencing/Automating Solaris Package Installs</title>
		<link>http://www.runningunix.com/2009/01/silencingautomating-solaris-package-installs/</link>
		<comments>http://www.runningunix.com/2009/01/silencingautomating-solaris-package-installs/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 05:09:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[pkgadd]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=156</guid>
		<description><![CDATA[If you&#8217;ve ever been faced with the chore of installing many packages across many hosts, you&#8217;ve either 1) spent all day hitting the &#8216;Y&#8217; key on your keyboard to pkgadd&#8217;s questions, 2) gotten someone else to hit the &#8216;Y&#8217; key all day, or 3) you&#8217;ve given pkgadd the proper information so it can proceed without [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;ve ever been faced with the chore of installing many packages across many hosts, you&#8217;ve either 1) spent all day hitting the &#8216;Y&#8217; key on your keyboard to pkgadd&#8217;s questions, 2) gotten someone else to hit the &#8216;Y&#8217; key all day, or 3) you&#8217;ve given pkgadd the proper information so it can proceed without your input.</p>
<p>pkgadd takes a -n argument, that tells it to operate in non-interactive mode. However, this alone will not let you install much of anything, because if the pkgadd command <em>needs</em> any input from the user, it will just exit and your package will not be installed. To give pkgadd the information to act on its own and install your package, you have to provide the -a option and specify an &#8220;installation administration file&#8221;.</p>
<p></p>
<p>This &#8220;admin&#8221; file contains all the parameters pkgadd will need to operate. The default file exists in /var/sadm/install/admin/default. Copy it to your home directory and take a look at it.</p>
<blockquote><p>
<code>mail=<br />
instance=unique<br />
partial=ask<br />
runlevel=ask<br />
idepend=ask<br />
rdepend=ask<br />
space=ask<br />
setuid=ask<br />
conflict=ask<br />
action=ask<br />
networktimeout=60<br />
networkretries=3<br />
authentication=quit<br />
keystore=/var/sadm/security<br />
proxy=<br />
basedir=default</code>
</p></blockquote>
<p>You can get information on all of the parameters in the file with:</p>
<blockquote><p><code># man -s 4 admin</code>
</p></blockquote>
<p>What I usually do, to forcefully install the packages without asking anything, is just replace all the occurences of &#8220;ask&#8221; to &#8220;nocheck&#8221;. This will take the default file, and create a new one, changing ask to nocheck.</p>
<blockquote><p>
<code># sed 's/ask/nocheck/' < /var/sadm/install/admin/default > /home/user/admin.file</code>
</p></blockquote>
<p>Now you can do your pkginstall without any questions being asked:</p>
<blockquote><p><code># pkgadd -n -a admin.file SUNWblah</code></p></blockquote>
<p>Another handy parameter in the admin file, especially when you are installing packages across multiple hosts, is the &#8220;mail&#8221; parameter. When you set this with your email, you will be notified when the package installs on each system.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F01%2Fsilencingautomating-solaris-package-installs%2F&amp;title=Silencing%2FAutomating%20Solaris%20Package%20Installs" id="wpa2a_18"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/01/silencingautomating-solaris-package-installs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris Security Tip: inetd Connection Logging</title>
		<link>http://www.runningunix.com/2009/01/solaris-security-tip-inetd-connection-logging/</link>
		<comments>http://www.runningunix.com/2009/01/solaris-security-tip-inetd-connection-logging/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 05:30:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[auditing]]></category>
		<category><![CDATA[inetd]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.runningunix.com/?p=151</guid>
		<description><![CDATA[It&#8217;s maybe not the first thing I&#8217;d do to lock down a server, but this is a worthwhile bit to change if you use any inetd services (ftp, telnet, remsh, finger, talk, etc). In addition to the OS-related inetd services mentioned, many applications will add their own, broadening your exposure to vulnerabilities across different vendor [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s maybe not the first thing I&#8217;d do to lock down a server, but this is a worthwhile bit to change if you use any inetd services (ftp, telnet, remsh, finger, talk, etc). In addition to the OS-related inetd services mentioned, many applications will add their own, broadening your exposure to vulnerabilities across different vendor products.</p>
<p>When any type of network connection is made to your servers, it&#8217;s important to know the source of the connection &#8211; where that connection originated. Yes, many hackers will use a proxy or bounce host or hosts to hide their true IP, but at least this information can give you a place to start if you needed to track them. This becomes even more useful in company-internal incidents where users are less able to hide.</p>
<p>TCP Wrappers has been around for ages. It&#8217;s a mechanism to allow or deny access to any inetd service, based upon the connecting IP address or host name. It used to be a more difficult to use &#8211; one had to download source, compile, install, configure, etc. But these days it&#8217;s built into many inetd variants, including Solaris.</p>
<p>Just for connection logging, we don&#8217;t necessarily need to set up TCP Wrappers to deny/allow hosts to connect based on IP or host name, so we&#8217;ll skip that part. If you want to go the extra mile and set this up, you configure the hosts.allow and hosts.deny files in /etc. Google around, it&#8217;s easy to find a howto.</p>
<p>With the SMF-based inetd in Solaris 10, it&#8217;s easy to turn on TCP wrappers for just one service or all services at once. If you just wanted to enable wrappers/logging for the FTP service, you&#8217;d change the properties of the FTP inetd service with inetadm:</p>
<blockquote><p># inetadm -m ftp tcp_wrappers=true</p></blockquote>
<p>Or, to change the default value for ALL inetd services, you&#8217;d use the -M option:</p>
<blockquote><p># inetadm -M tcp_wrappers=true</p></blockquote>
<p>When this change is made, a log entry will be made, usually in /var/log/syslog, unless you&#8217;ve changed your syslog configuration:</p>
<blockquote><p>Jan 13 08:56:52 waters vnetd[26111]: [ID 927837 daemon.info] connect from rocky<br />
Jan 13 09:00:26 waters in.rshd[28426]: [ID 927837 daemon.info] connect from hungryhippo<br />
Jan 13 09:17:25 waters in.rshd[8174]: [ID 927837 daemon.info] connect from penta<br />
Jan 13 09:24:19 waters in.telnetd[12414]: [ID 927837 daemon.info] connect from 192.168.151.95<br />
Jan 13 09:35:17 waters in.ftpd[23954]: [ID 927837 daemon.info] connect from mercury</p></blockquote>
<p>In Solaris 8, you&#8217;d accomplish this same goal by altering your inetd start script, /etc/init.d/inetsvc:<br />
just add the -t option to the last line:</p>
<blockquote><p>/usr/sbin/inetd -s -t &amp;</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.runningunix.com%2F2009%2F01%2Fsolaris-security-tip-inetd-connection-logging%2F&amp;title=Solaris%20Security%20Tip%3A%20inetd%20Connection%20Logging" id="wpa2a_20"><img src="http://www.runningunix.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.runningunix.com/2009/01/solaris-security-tip-inetd-connection-logging/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
