<?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>Solaris Blog &#187; Useful Solaris commands</title>
	<atom:link href="http://solaris.reys.net/articles/useful-commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://solaris.reys.net</link>
	<description>Tips and tricks on DTrace, ZFS, Zones and Solaris administration</description>
	<lastBuildDate>Sun, 08 Jan 2012 13:47:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>inetadm &#8211; changing service properties</title>
		<link>http://solaris.reys.net/inetadm-changing-service-properties/</link>
		<comments>http://solaris.reys.net/inetadm-changing-service-properties/#comments</comments>
		<pubDate>Sat, 02 May 2009 02:43:40 +0000</pubDate>
		<dc:creator>Gleb Reys</dc:creator>
				<category><![CDATA[Useful Solaris commands]]></category>
		<category><![CDATA[inetadm]]></category>

		<guid isPermaLink="false">http://solaris.simplyunix.com/?p=121</guid>
		<description><![CDATA[Today I&#8217;ve met a problem which I easily solved with the help of inetadm, and here&#8217;s the entry explaining what happened. When trying to FTP some files off my laptop, I&#8217;ve noticed FTP client failing to parse the ls -l output due to Russian weekdays used in listing. It was obvious that such FTP daemon [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve met a problem which I easily solved with the help of <strong>inetadm</strong>, and here&#8217;s the entry explaining what happened.</p>
<p>When trying to FTP some files off my laptop, I&#8217;ve noticed FTP client failing to parse the <strong>ls -l</strong> output due to Russian weekdays used in listing. It was obvious that such FTP daemon behavior was due to one of its options, which specifically made sure the daemon inherited all the environment variables. Luckily such a behavior was easy to change with <strong>inetadm</strong>:</p>
<p><span id="more-121"></span>To list all the options of a given service, use a command similar to this:</p>
<pre>solaris# <strong>inetadm -l svc:/network/ftp:default</strong>
SCOPE    NAME=VALUE
name="ftp"
endpoint_type="stream"
proto="tcp6"
isrpc=FALSE
wait=FALSE
exec="/usr/sbin/in.ftpd -a"
user="root"
default  bind_addr=""
default  bind_fail_max=-1
default  bind_fail_interval=-1
default  max_con_rate=-1
default  max_copies=-1
default  con_rate_offline=-1
default  failrate_cnt=40
default  failrate_interval=60
default  inherit_env=TRUE
default  tcp_trace=FALSE
default  tcp_wrappers=FALSE</pre>
<p>As you can see, there was an inherit_env variable, set to TRUE by default. All I had to do was to switch it off:</p>
<pre>solaris# <strong>inetadm -m svc:/network/ftp:default inherit_env=FALSE</strong></pre>
<p>After this FTP daemon has stopped inheriting environment variables, and, accordingly, switched to using C (English) locale for displaying weekdays in ls listings.</p>
<p>Using similar command line, you can alter any options of any service which is under inetadm control.</p>
]]></content:encoded>
			<wfw:commentRss>http://solaris.reys.net/inetadm-changing-service-properties/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What would we do without crle?</title>
		<link>http://solaris.reys.net/using-crle/</link>
		<comments>http://solaris.reys.net/using-crle/#comments</comments>
		<pubDate>Fri, 01 May 2009 21:16:29 +0000</pubDate>
		<dc:creator>Gleb Reys</dc:creator>
				<category><![CDATA[Useful Solaris commands]]></category>

		<guid isPermaLink="false">http://solaris.simplyunix.com/?p=14</guid>
		<description><![CDATA[While compiling some of the stuff I use in 64bit lately, I&#8217;ve had another chance to use the wonderful crle tool and to acknowledge once again just how easier it made my life. Here&#8217;s what you can read from man crle: The crle utility provides for the creation and display of a runtime linking configuration [...]]]></description>
			<content:encoded><![CDATA[<p>While compiling some of the stuff I use in 64bit lately, I&#8217;ve had another chance to use the wonderful crle tool and to acknowledge once again just how easier it made my life.</p>
<p>Here&#8217;s what you can read from <strong>man crle</strong>:</p>
<blockquote><p>The crle utility provides for the creation and display of  a<br />
runtime  linking  configuration file. The configuration file<br />
is read and interpreted by the runtime  linker,  ld.so.1(1),<br />
during process start-up.</p></blockquote>
<p>The tool does exactly that &#8211; it specifies where <strong>ld </strong>should look first for the necessary libraries as you start any executable.</p>
<p><span id="more-14"></span>What would we do without this tool? The answer&#8217;s simple:</p>
<ol>
<li>we&#8217;d have to specify libraries directories implicitly every time we compile something &#8211; using -L and -R parameters.</li>
<li>we&#8217;d probably have to use the good old LD_LIBRARY_PATH environment variable, which again specifies where libraries should first be looked at.</li>
</ol>
<p>Not only it&#8217;s not cool because you have to waste time, but if you want someone else to use the program you&#8217;d get compiled using the tricks above, this someone would have to follow your steps and do the same &#8211; set LD_LIBRARY_PATH to the same values.</p>
<p>But with <strong>crle </strong> it&#8217;s much easier:</p>
<p>to look at the current list of directories used by ld just do this:</p>
<div>
<pre>solaris$ <strong>crle</strong>
Default configuration file (/var/ld/ld.config) not found
Default Library Path (ELF):   /lib:/usr/lib  (system default)
Trusted Directories (ELF):    /lib/secure:/usr/lib/secure  (system default)</pre>
</div>
<p>and for 64-bit objects, do it like this:</p>
<pre><code>solaris$ <strong>crle -64</strong>
Configuration file [version 4]: /var/ld/64/ld.config
Default Library Path (ELF):   /lib/64:/usr/lib/64:/usr/sfw/lib/64
Trusted Directories (ELF):    /lib/secure/64:/usr/lib/secure/64  (system default</code>
<pre>Command line:</pre>
<pre>crle -64 -c /var/ld/64/ld.config -l /lib/64:/usr/lib/64:/usr/sfw/lib/64</pre>
</pre>
<p>As you can see, adding more directories is quite easy. For instance, if I want to add another library directory of my own, /export/soft/lib/64, this command would help me:</p>
<pre><span style="font-family: -webkit-monospace;">solaris$ <strong>crle -64 -c /var/ld/64/ld.config -l /lib/64:/usr/lib/64:/usr/sfw/lib/64:/export/soft/lib/64</strong></span></pre>
]]></content:encoded>
			<wfw:commentRss>http://solaris.reys.net/using-crle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

