<?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>Systalent</title>
	<atom:link href="http://www.systalent.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.systalent.com</link>
	<description>Systems and software talents !</description>
	<lastBuildDate>Tue, 10 Jan 2012 09:31:26 +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>Dealing with ORA-12169 (service name too long) with Oracle Instant Client on Mac OS X</title>
		<link>http://www.systalent.com/blog/dealing-with-ora-12169-service-name-too-long-with-oracle-instant-client-on-mac-os-x</link>
		<comments>http://www.systalent.com/blog/dealing-with-ora-12169-service-name-too-long-with-oracle-instant-client-on-mac-os-x#comments</comments>
		<pubDate>Thu, 22 Sep 2011 13:42:42 +0000</pubDate>
		<dc:creator>stadmin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.systalent.com/?p=236</guid>
		<description><![CDATA[Running Oracle Instant Client and related SQL*Plus on Mac OS X, with tnsnames.ora created and environment variables setup correctly was causing this error repeatedly, not allowing login into the database via &#8220;sqlplus&#8221; from a terminal/command line. ORA-12169: TNS:Net service name given as connect identifier is too long The tnsnames.ora file was good, and there was [...]]]></description>
			<content:encoded><![CDATA[<p>Running Oracle Instant Client and related SQL*Plus on Mac OS X, with tnsnames.ora created and environment variables setup correctly was causing this error repeatedly, not allowing login into the database via &#8220;sqlplus&#8221; from a terminal/command line.</p>
<pre style="padding-left: 30px;">ORA-12169: TNS:Net service name given as connect identifier is too long</pre>
<p>The tnsnames.ora file was good, and there was nothing unusual about the &#8220;service_name&#8221; used in the TNS entries.  So this error was a bit surprising.</p>
<p>The reason was simple, the tnsnames.ora file had Windows encoding (CR/LF) instead of Unix/Linux encoding (just LF).  Just saving the tnsnames.ora file in *nix format solved the problem !</p>
<p>Hope that this information is useful to others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systalent.com/blog/dealing-with-ora-12169-service-name-too-long-with-oracle-instant-client-on-mac-os-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ensuring only one instance of shell script execution</title>
		<link>http://www.systalent.com/blog/ensuring-only-one-instance-of-shell-script-execution</link>
		<comments>http://www.systalent.com/blog/ensuring-only-one-instance-of-shell-script-execution#comments</comments>
		<pubDate>Wed, 25 May 2011 22:16:49 +0000</pubDate>
		<dc:creator>stadmin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.systalent.com/?p=211</guid>
		<description><![CDATA[Shell scripts are often used as the glue to put various pieces together, and in automation of tasks (especially in the *nix world).  Whether it is to ensure that any failures in processes are notified to support teams, or to marry ETL processes from tools like AbInitio or Informatica to perl code, shell scripts play [...]]]></description>
			<content:encoded><![CDATA[<p>Shell scripts are often used as the glue to put various pieces together, and in automation of tasks (especially in the *nix world).  Whether it is to ensure that any failures in processes are notified to support teams, or to marry ETL processes from tools like AbInitio or Informatica to perl code, shell scripts play an important and routine role, especially in *nix environments like Linux.</p>
<p>One of the common requirements in the shell scripting world is to ensure that two copies of the same script does not run at the same time. Whether kicked off accidentally, or because the earlier invocation took abnormally long to complete, in most cases the requirement is to have only one copy of a script executing at any given time.  If a new copy gets kicked off, it should notice that another copy is running, and exit.  It is also a requirement that the script be able to survive unplanned events like server restarts.</p>
<p><span id="more-211"></span></p>
<p>Here is a Linux based version we have been using, that has been enhanced to use the &#8220;parent process id&#8221; also, as compared to the simple technique of just using the &#8220;process id&#8221; alone (which can generate false positives).</p>
<pre># lock file location
export LOCK_FILE=/var/run/my_process_name.lock

# check if another copy is running
if [[ -a $LOCK_FILE ]]; then
	pid=$(cat $LOCK_FILE | awk '{print $1}')
	ppid=$(cat $LOCK_FILE | awk '{print $2}')
	# validate contents of previous lock file
	vpid=${pid:-"0"}
	vppid=${ppid:-"0"}
	if (( $vpid &lt; 2 || $vppid &lt; 2 )); then
		echo "Corrupt lock file $LOCK_FILE ... Exiting"
		cp -f $LOCK_FILE ${LOCK_FILE}.`date +%Y%m%d%H%M%S`
		exit
	fi
	# check if ppid matches pid
	ps -f -p $pid --no-headers | grep $ppid &gt;/dev/null 2&gt;&amp;1
	if [[ $? -eq 0 ]]; then
		echo "Another copy of script running with process id $pid"
		exit
	else
		echo "Bogus lock file found, removing"
		rm -f $LOCK_FILE &gt;/dev/null
	fi
fi
pid=$$
ps -f -p $pid --no-headers | awk '{print $2,$3}' &gt; $LOCK_FILE
echo "Starting with process id $pid"</pre>
<p>This piece of code needs to go at the beginning of what ever script you want to prevent from having multiple copies running simultaneously.  If you are not in Linux, minor tweaks may be needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.systalent.com/blog/ensuring-only-one-instance-of-shell-script-execution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to Systalent !</title>
		<link>http://www.systalent.com/main_page/welcome-to-systalent</link>
		<comments>http://www.systalent.com/main_page/welcome-to-systalent#comments</comments>
		<pubDate>Sun, 22 May 2011 20:30:13 +0000</pubDate>
		<dc:creator>stadmin</dc:creator>
				<category><![CDATA[Main Page]]></category>

		<guid isPermaLink="false">http://systalent.com/wordpress/?p=13</guid>
		<description><![CDATA[Welcome to Systalent ! Systalent is a software and systems solution provider based at Kochi, in the state of Kerala on the southern tip of India. Our primary activity is to provide offshore development and support services to our customers.]]></description>
			<content:encoded><![CDATA[<h1>Welcome to Systalent !</h1>
<p><span class="header-desc">Systems and Software Talents&#8230;</span></p>
<p><strong>Systalent is a software and systems solution provider based at Kochi, in the state of Kerala on the southern tip of India. Our primary activity is to provide offshore development and support services to our customers.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.systalent.com/main_page/welcome-to-systalent/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

