<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Programming Gems (on GemStone)</title>
	<atom:link href="http://programminggems.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://programminggems.wordpress.com</link>
	<description>James's comments on programming GemStone/S, Seaside, and Smalltalk</description>
	<lastBuildDate>Tue, 18 Jun 2013 16:55:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='programminggems.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Programming Gems (on GemStone)</title>
		<link>http://programminggems.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://programminggems.wordpress.com/osd.xml" title="Programming Gems (on GemStone)" />
	<atom:link rel='hub' href='http://programminggems.wordpress.com/?pushpress=hub'/>
		<item>
		<title>GemStone/S product and team move to a dedicated company</title>
		<link>http://programminggems.wordpress.com/2013/05/02/gemtalksystems/</link>
		<comments>http://programminggems.wordpress.com/2013/05/02/gemtalksystems/#comments</comments>
		<pubDate>Thu, 02 May 2013 17:27:31 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1441</guid>
		<description><![CDATA[Great news! The GemStone/S team is becoming an independent company after 3 years as part of VMware. The core engineering team, including me, along with Norm Green and Dan Ware, have formed GemTalk Systems. For more information, visit our company web site at http://gemtalksystems.com. At GemTalk Systems, we&#8217;re the people who built the product. We&#8217;re [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1441&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Great news! The GemStone/S team is becoming an independent company after 3 years as part of VMware. The core engineering team, including me, along with Norm Green and Dan Ware, have formed GemTalk Systems.</p>
<p>For more information, visit our company web site at <a href="http://gemtalksystems.com/">http://gemtalksystems.com</a>.</p>
<p>At GemTalk Systems, we&#8217;re the people who built the product. We&#8217;re excited to become a company with a dedicated focus on Smalltalk, GemStone/S and allied initiatives. You&#8217;ll see an increase in innovation on the product, and customers will see a seamless transition in support.</p>
<p>GemTalk will be at the STIC conference (Phoenix in June). Plan to visit us there!</p>
<p>Our email addresses are changing, too. They are all in the form of first.last@gemtalksystems.com. But the old email addresses will continue to work for a few months.</p>
<p>If you have questions about this exciting transition, feel free to <a href="mailto:james.foster@gemtalksystems.com">contact me</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1441/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1441&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2013/05/02/gemtalksystems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>Sample cleanup scripts</title>
		<link>http://programminggems.wordpress.com/2013/03/04/sample-cleanup-scripts/</link>
		<comments>http://programminggems.wordpress.com/2013/03/04/sample-cleanup-scripts/#comments</comments>
		<pubDate>Tue, 05 Mar 2013 00:49:11 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1437</guid>
		<description><![CDATA[A GemStone/S 64 Bit system needs to have various maintenance tasks performed regularly. One of these is managing log file, backups, and transaction logs. I recently put together a basic Linux VM that has GemStone/S 64 Bit installed, but little more (the last link here). One of the non-Smalltalk things that I sometimes struggle with [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1437&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A GemStone/S 64 Bit system needs to have various maintenance tasks performed regularly. One of these is managing log file, backups, and transaction logs. I recently put together a basic Linux VM that has GemStone/S 64 Bit installed, but little more (the last link <a href="http://seaside.gemstone.com/jade/">here</a>). One of the non-Smalltalk things that I sometimes struggle with is figuring out which file can be deleted. The following demonstrates some bash scripting that seems to address a few of my questions. It starts by deleting all but the most recent two log files for pcmon, pagemanager, and symbolgem. It then does some garbage collection activity and a full backup. It then deletes all but the most recent two backups. Finally, if there are two backups in the last two days, it deletes all transaction logs more than two days old. This does not do as much error checking as should be done in a serious production environment (such as try restoring the backup, apply transaction logs, etc., before deleting things), but it demonstrates some of the things that can be done in bash to do date-specific cleanup.</p>
<pre>#!/bin/bash
# cleanup log files
cd /opt/gemstone/log
(ls -t *pcmon.log | head -n 2; ls *pcmon.log) | \
    sort | uniq -u | xargs rm
(ls -t *pagemanager.log | head -n 2; ls *pagemanager.log) | \
    sort | uniq -u | xargs rm
(ls -t *symbolgem.log | head -n 2; ls *symbolgem.log) | \
    sort | uniq -u | xargs rm
# do backup
topaz -l -T 50000 &lt;&lt; EOF
output push backup.out
errorCount
send SystemRepository markForCollection
send SystemRepository reclaimAll
send SystemRepository startNewLog
run
SystemRepository fullBackupCompressedTo: 
 '/opt/gemstone/backups/backup-' , 
 (DateTime now asSeconds // 60) printString.
%
logout
errorCount
exit
EOF
# cleanup backups
cd /opt/gemstone/backups
(ls -t backup* | head -n 2; ls backup*) | sort | uniq -u | xargs rm
if [ "2" -le "`find . -mtime -2 -name 'backup*' | wc -l`" ]; then 
 cd /opt/gemstone/data
 find . -mtime +2 -name 'tranlog*' | xargs rm
fi</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1437/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1437&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2013/03/04/sample-cleanup-scripts/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>FastCGI on Mac OS X 10.8 (Mountain Lion)</title>
		<link>http://programminggems.wordpress.com/2013/03/04/fastcgi-on-mac-os-x-10-8-mountain-lion/</link>
		<comments>http://programminggems.wordpress.com/2013/03/04/fastcgi-on-mac-os-x-10-8-mountain-lion/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 19:42:40 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1369</guid>
		<description><![CDATA[While the strict definition of GLASS (GemStone, Linux, Apache, Seaside, and Smalltalk) specifies a particular technology for each layer of the stack, other technologies can be used for the OS (e.g., Mac OS X), the web server (e.g., lighttpd or nginx), and the web framework (e.g., AidaWeb). I&#8217;ve been running GemStone/S 64 Bit on Mac [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1369&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>While the strict definition of <a href="http://seaside.gemstone.com/">GLASS</a> (GemStone, Linux, Apache, Seaside, and Smalltalk) specifies a particular technology for each layer of the stack, other technologies can be used for the OS (e.g., <a href="http://seaside.gemstone.com/downloads.html">Mac OS X</a>), the web server (e.g., <a href="http://miguel.leugim.com.mx/index.php/2008/09/27/gemstones-and-fastcgi-with-lighttpd/">lighttpd</a> or <a href="https://github.com/noha/virtual-gemstone">nginx</a>), and the web framework (e.g., <a href="http://www.aidaweb.si/gemstone-glass.html">AidaWeb</a>). I&#8217;ve been running GemStone/S 64 Bit on Mac OS X for some time and have had a local (laptop) configuration much like the tradition Linux setup with FastCGI routing requests to three gems that receive and process Seaside requests. This worked well at the beginning when Mac OS X included FastCGI (as part of its built-in support for Ruby on Rails). This has changed in the later releases; starting with 10.7 (Lion) and continuing with 10.8 (Mountain Lion), FastCGI is no longer included in the operating system. This has broken my setup.</p>
<p>GLASS uses FastCGI to route requests to long-running server processes (typically a Topaz process) that remains logged in to the GemStone database. The Topaz processes can run on a different host from the web server (Apache or whatever), using the &#8216;ExternalServer&#8217; (discussed <a href="http://itkia.com/external-fastcgi-with-apache/">here</a> and <a href="http://whocares.de/fastcgiexternalserver-demystified/all/1/">here</a>). While <a href="http://www.fastcgi.com/drupal/">FastCGI</a> is sometimes thought to be out-of-date, it is more accurate to <a href="http://www.fastcgi.com/drupal/">say</a> that &#8220;There is not much development on FastCGI because it is a <i>very</i> stable protocol / application.&#8221; Apache now provides a fast cgi module (<a href="http://httpd.apache.org/mod_fcgid/">here</a>), that is commonly described as a replacement to mod_fastcgi, but it doesn&#8217;t support the external server configuration used by GLASS.</p>
<p>Getting GLASS to work on Mac OS X 10.8 requires jumping through some hoops, but now that I&#8217;ve done it I&#8217;ll describe the steps I took (please feel free to suggest alternatives in the comments).</p>
<p>I used the App Store application to find and install Xcode (4.6), then installed the command line tools (from Xcode Preferences-&gt;Downloads or from <a href="https://developer.apple.com/downloads/index.action">Apple</a>). Next, I installed the latest <a href="http://www.macports.org/install.php">MacPorts</a>. Then, from a Terminal I entered the following command:</p>
<pre>sudo port install mod_fastcgi</pre>
<p>This did a full Apache build, but also created the needed modules. Instead of running the MacPorts build of Apache, I copied the new module to the expected directory:</p>
<pre>sudo cp /opt/local/apache2/modules/mod_fastcgi.so \<br />    /usr/libexec/apache2/mod_fastcgi.so</pre>
<p>Then I was able to run my usual setup with FastCGI on Mac OS X 10.8!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1369/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1369/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1369&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2013/03/04/fastcgi-on-mac-os-x-10-8-mountain-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Topaz on Windows</title>
		<link>http://programminggems.wordpress.com/2012/11/28/using-topaz-on-windows/</link>
		<comments>http://programminggems.wordpress.com/2012/11/28/using-topaz-on-windows/#comments</comments>
		<pubDate>Wed, 28 Nov 2012 22:47:53 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1367</guid>
		<description><![CDATA[While there are a variety of ways of interacting with GemStone/S 64 Bit, the most basic way is to use Topaz, the command-line GemStone C Interface (GCI) client that has been part of GemStone since the beginning. While GemStone/S 64 Bit as a server is not available for Microsoft Windows, Topaz is available as a [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1367&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>While there are a variety of ways of interacting with GemStone/S 64 Bit, the most basic way is to use <a href="http://community.gemstone.com/download/attachments/6816350/GS64-Topaz-3.0.pdf?version=1">Topaz</a>, the command-line GemStone C Interface (GCI) client that has been part of GemStone since the beginning. While GemStone/S 64 Bit as a server is not available for Microsoft Windows, Topaz is available as a Windows client application that can be used to connect to a Unix/Linux/Mac server. Using Topaz is very helpful in debugging connectivity problems since it removes the variables associated with other client applications (such as GBS, GemTools, Jade, etc.). That is, if you are having trouble connecting with GemTools, we are likely to ask you to try to connect using Topaz.</p>
<p>Fortunately, it is relatively easy to run Topaz on Windows. Open a web browser on <a href="http://seaside.gemstone.com/downloads/x86.Windows_NT/">http://seaside.gemstone.com/downloads/x86.Windows_NT/</a> and download <a href="http://seaside.gemstone.com/downloads/x86.Windows_NT/GemBuilderC3.1.0.1-x86.Windows_NT.zip">GemBuilderC3.1.0.1-x86.Windows_NT.zip</a> (this assumes that you are connecting to a 3.1.0.1 server). Unzip this into a convenient location on your Windows machine (e.g., C:\gemstone\). Open a command shell (Start, All Programs, Accessories, Command Prompt), navigate to the &#8216;bin&#8217; directory created by unzipping the download, and start &#8216;topaz&#8217;. At this point you can enter the usual Topaz commands and try to login to your server. Following is a copy of the screen when I used Topaz on Windows to login to my database:</p>
<pre style="padding-left:30px;">C:\GemStone\GemBuilderC3.1.0.1-x86.Windows_NT\bin&gt;<strong>topaz</strong>
 _____________________________________________________________________________
| GemStone/S64 Object-Oriented Data Management System                         |
| Copyright (C) VMware, Inc. 1986-2012                                        |
| All rights reserved.                                                        |
+-----------------------------------------------------------------------------+
| PROGRAM: topaz, Linear GemStone Interface (Remote Session)                  |
| VERSION: 3.1.0.1, Fri Aug 24 10:24:31 2012                                  |
| BUILD: gss64_3_1_0_x_branch-28937                                           |
| BUILT FOR: Pentium/Windows_NT                                               |
| MODE: 32 bit                                                                |
| RUNNING ON: 1-CPU jfoster-xpvm: Intel CPU, Windows NT 5.1 build 2600 Service|
| Pack 3                                                                      |
| PROCESS ID: 828 DATE: 11/28/2012 11:19:36 Pacific Standard Time             |
|_____________________________________________________________________________|
neither topazini.tpz nor $HOME\topazini.tpz were found
topaz&gt; <strong>set user DataCurator pass swordfish</strong>
topaz&gt; <strong>set gemstone <em>jfoster0</em></strong>
topaz&gt; <strong>set gemnet !tcp@<em>10.118.32.15</em>#netldi:<em>10460</em>#task!gemnetobject</strong>
topaz&gt; <strong>login</strong>
[Info]: libssl-3.1.0.1-32.dll: loaded
[11/28/2012 11:20:47.435 Pacific Standard Time]
 gci login: currSession 1 rpc gem processId 30480 OOB keep-alive interval 0
successful login
topaz 1&gt; <strong>run</strong>
<strong>100 factorial printString</strong>
<strong>%</strong>
93326215443944152681699238856266700490715968264381621468592963895217599993229915
608941463976156518286253697920827223758251185210916864000000000000000000000000
topaz 1&gt; <strong>logout</strong>
topaz&gt; <strong>exit</strong></pre>
<pre style="padding-left:30px;">C:\GemStone\GemBuilderC3.1.0.1-x86.Windows_NT\bin&gt;</pre>
<p>The things I typed are in bold. The things you need to change are in italics. Specifically, you need to provide the name of your stone (perhaps it is &#8216;seaside&#8217;), the IP address (or hostname if you have an entry in your hosts file) and port number (or service name if you have an entry in your services file) for your NetLDI that will start your gem.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1367/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1367/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1367&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2012/11/28/using-topaz-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>Slides from ESUG 2012 &#8230;</title>
		<link>http://programminggems.wordpress.com/2012/09/19/slides-from-esug-2012/</link>
		<comments>http://programminggems.wordpress.com/2012/09/19/slides-from-esug-2012/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 01:20:58 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1365</guid>
		<description><![CDATA[&#8230; are available here. My presentation was Smalltalk in the Cloud and included a demo of pushing an Aida application (using Pharo/Cog) to a public cloud.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1365&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&#8230; are available <a href="http://www.slideshare.net/esug/smalltalk-in-the-cloud">here</a>. My presentation was Smalltalk in the Cloud and included a demo of pushing an Aida application (using Pharo/Cog) to a public cloud.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1365/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1365/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1365&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2012/09/19/slides-from-esug-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding a Simple Runtime and Framework to Cloud Foundry (2)</title>
		<link>http://programminggems.wordpress.com/2012/08/29/adding-a-simple-runtime-and-framework-to-cloud-foundry-2/</link>
		<comments>http://programminggems.wordpress.com/2012/08/29/adding-a-simple-runtime-and-framework-to-cloud-foundry-2/#comments</comments>
		<pubDate>Thu, 30 Aug 2012 04:59:35 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1350</guid>
		<description><![CDATA[Some time ago I described the steps I used to add Perl as a simple runtime and framework to Cloud Foundry. Since then many changes have taken place in Cloud Foundry and those steps no longer work. I now have something that works as of 30 August 2012. To see the changes go to my [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1350&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Some time ago I <a href="http://programminggems.wordpress.com/2012/02/07/adding-a-runtime-and-framework-to-the-new-cloud-foundry/">described</a> the steps I used to add Perl as a simple runtime and framework to Cloud Foundry. Since then many changes have taken place in Cloud Foundry and those steps no longer work.</p>
<p>I now have something that works as of 30 August 2012. To see the changes go to my <a href="https://github.com/jgfoster">github</a> <a href="https://github.com/jgfoster/vcap">repository</a> and view the changes to  <a href="https://github.com/jgfoster/vcap/compare/920f44bee41af1de95eca4476cbef7fa36842c56...perl">vcap</a>, <a href="https://github.com/jgfoster/vcap-staging/compare/d2de03eb7aa01c4d2f0616b37924792da0b5ffdc...perl">vcap-staging</a>, <a href="https://github.com/jgfoster/stager/compare/3903fca8fb39e65d60ca564be3273b29d1053f6e...perl">stager</a>, and <a href="https://github.com/jgfoster/cloud_controller/compare/f2c60333b84d221f3b35d3482819244cab562bb3...perl">cloud_controller</a>. Note that the recent refactoring of Cloud Foundry means that instead of isolating changes to one repository, we now make changes to four repositories.</p>
<p>Of course, there may be more efficient ways of doing this, but this is what I&#8217;ve found to work for me today!</p>
<p>Update 1: It wasn&#8217;t much work to update the earlier work on <a href="http://programminggems.wordpress.com/2012/02/17/adding-smalltalk-to-cloud-foundry/">Cog/Aida</a>. It involved similar changes to <a href="https://github.com/jgfoster/vcap/compare/2b0db4462f4085e7910088f6c420f6099f9d46f7...jgfoster:aida">vcap</a>, <a href="https://github.com/jgfoster/vcap-staging/compare/d2de03eb7aa01c4d2f0616b37924792da0b5ffdc...jgfoster:aida">vcap-staging</a>, <a href="https://github.com/jgfoster/stager/compare/3903fca8fb39e65d60ca564be3273b29d1053f6e...jgfoster:aida">stager</a>, and <a href="https://github.com/jgfoster/cloud_controller/compare/415ab80eb7698f94718c69815c4bd8466e10435c...jgfoster:aida">cloud_controller</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1350/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1350&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2012/08/29/adding-a-simple-runtime-and-framework-to-cloud-foundry-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>Smalltalk with James Robertson discussing Cloud Foundry</title>
		<link>http://programminggems.wordpress.com/2012/04/23/smalltalk-with-james-robertson-discussing-could-foundry/</link>
		<comments>http://programminggems.wordpress.com/2012/04/23/smalltalk-with-james-robertson-discussing-could-foundry/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 15:55:43 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1343</guid>
		<description><![CDATA[James Robertson and I discussed Cloud Foundry on his podcast.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1343&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>James Robertson and I discussed Cloud Foundry on his <a href="http://www.jarober.com/blog/blogView?showComments=true&amp;printTitle=IM_74:_Cloud_Foundry,_Part_1&amp;entry=3512561159">podcast</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1343/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1343/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1343&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2012/04/23/smalltalk-with-james-robertson-discussing-could-foundry/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>Enhancements to SMJobBless</title>
		<link>http://programminggems.wordpress.com/2012/04/18/enhancements-to-smjobbless/</link>
		<comments>http://programminggems.wordpress.com/2012/04/18/enhancements-to-smjobbless/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 20:09:58 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1340</guid>
		<description><![CDATA[As part of a project to simplify running GemStone/S 64 Bit on the Macintosh, I need to be able to modify the OS kernel settings to allow for shared memory. The changes need to be made as root and the typical way to do it is using sudo from a command shell. This requires using [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1340&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>As part of a project to simplify running GemStone/S 64 Bit on the Macintosh, I need to be able to modify the OS kernel settings to allow for shared memory. The changes need to be made as root and the typical way to do it is using sudo from a command shell. This requires using the command line interface as well as making various calculations, all of which is somewhat familiar to an experienced GemStone DBA but is not very nice as an initial experience with GemStone, particularly for Mac users who have come to expect a better user experience.</p>
<p>The currently-approved way to do privileged operations on the Mac is to create a &#8220;helper tool&#8221; (a small C application) that does the minimal task. A client application (running as a regular user) then can install the tool and (with appropriate authorizations) &#8220;bless&#8221; it so that launchd can start it as root when it is needed. Apple provides an example of how to install a helper tool (SMJobBless), but the sample helper does not actually do anything in the way of providing a service to the sample application. It seems that there are a number of requests on the web for a more complete sample, and so rather than moving straight to my application I started by enhancing the sample app. You can find the result on <a href="https://github.com/jgfoster/SMJobBless">github</a>.</p>
<p>Communication is done using Unix domain sockets. That is, rather than listening on a port, the server listens on a file. This allows a safer naming scheme that avoids overlap better than port numbers. It also limits requests to clients on the same machine. Socket programming is reasonable straightforward, but somewhat tedious. Because it is stream-based, one can&#8217;t be sure that an entire message has been received so there needs to be code that figures out how many bytes to expect and then waits till they come. Of course, you shouldn&#8217;t wait forever, so there are timing issues as well.</p>
<p>If you are building a Mac application that needs a helper tool, then take a look and let us know what is missing&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1340/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1340&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2012/04/18/enhancements-to-smjobbless/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>GemStone in Cloud Foundry on github</title>
		<link>http://programminggems.wordpress.com/2012/04/16/gemstone-in-cloud-foundry/</link>
		<comments>http://programminggems.wordpress.com/2012/04/16/gemstone-in-cloud-foundry/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 17:52:17 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1336</guid>
		<description><![CDATA[I have consolidated and updated my changes to Cloud Foundry to accomodate GemStone/S 64 Bit and have the changes on github. You can use that code rather than the recent series of posts that are now a bit outdated. I will be making additional updates as I add multi-machine capabilities to reflect some of the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1336&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I have consolidated and updated my changes to Cloud Foundry to accomodate GemStone/S 64 Bit and have the changes on <a href="https://github.com/jgfoster/">github</a>. You can use that code rather than the recent series of posts that are now a bit outdated. I will be making additional updates as I add multi-machine capabilities to reflect some of the things learned in preparing for last month&#8217;s STIC presentation. Stay tuned!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1336/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1336/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1336&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2012/04/16/gemstone-in-cloud-foundry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
		<item>
		<title>Configuring Shared Memory</title>
		<link>http://programminggems.wordpress.com/2012/04/06/configuring-shared-memory/</link>
		<comments>http://programminggems.wordpress.com/2012/04/06/configuring-shared-memory/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 00:21:42 +0000</pubDate>
		<dc:creator>James Foster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://programminggems.wordpress.com/?p=1330</guid>
		<description><![CDATA[One of the most common problem people have installing and starting GemStone/S is getting shared memory configured properly. This post will discuss shared memory in general and GemStone&#8217;s use of shared memory in particular. One of the features of modern operating systems is that each operating system process runs in its own address space and [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1330&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>One of the most common problem people have installing and starting GemStone/S is getting shared memory configured properly. This post will discuss shared memory in general and GemStone&#8217;s use of shared memory in particular.</p>
<p>One of the features of modern operating systems is that each operating system process runs in its own address space and (with help from the hardware) the process is not permitted to read or write outside its assigned area. This protection makes it much less likely that a misbehaving application will harm other applications or even crash your whole machine (as was common on personal computers during the era prior to Windows XP and Mac OS X). This protection comes with the overhead that if two processes want to share data they typically need to communicate through the operating system (typically using TCP/IP, as if they were on separate machines). Processes that want to share a large amount of data are allowed to request a chunk of memory from the operating system that can be shared. Because this is not common, most operating systems are configured to provide only a limited amount of memory for this use and without adjustments to those settings GemStone cannot run.</p>
<p>Each machine where a GemStone process is running will have a Shared Page Cache (SPC) that holds copies of 16 KB pages from the file system extents that make up the repository. The SPC is a chunk of shared memory allocated by a SPC &#8220;monitor&#8221; and to which other processes attach. When the stone starts it forks a process to be the SPC monitor and then waits for the SPC to become available. If the SPC does not appear within a set time then the stone reports an error and dies. This error will be similar to the following:</p>
<pre><span style="color:#800000;">The stone was unable to start a cache page server on host '&lt;stone's host&gt;'. </span>
<span style="color:#800000;">Reason: The cache monitor connect failed. </span>
<span style="color:#800000;">Monitor process (9999) did not start.</span></pre>
<p>The SPC monitor log (a file next to the stone log whose name ends with &#8216;pcmon.log&#8217;) will have the following:</p>
<pre><span style="color:#800000;">| GemStone could not retrieve the IPC identifier associated with the memory |</span>
<span style="color:#800000;">| key 9999999. shmget() error = errno=22,EINVAL, Invalid argument (programmer</span>
<span style="color:#800000;">| error). |</span>
<span style="color:#800000;">| |</span>
<span style="color:#800000;"> GemStone could not attach to the shared page cache.</span>
<span style="color:#800000;">|</span>
<span style="color:#800000;"> [SpcMon trace]: ... cache creation failed ...</span>
<span style="color:#800000;"> [SpcMon trace]: ... if the errno is (EINVAL) it is likely because the</span>
<span style="color:#800000;"> cache size is less than the operating system imposed</span>
<span style="color:#800000;"> minimum or greater than the operating system maximum.</span></pre>
<p>As suggested in the error message, the cache size is likely greater than the operating system maximum. If this is the first error you get after installing GemStone then it is likely that you have not configured the operating system for adequate shared memory. To see the existing limits, you can ask for a listing of the inter-process communication statistics:</p>
<pre><span style="color:#800000;">ipcs -l</span></pre>
<p>This provides a list similar to the following (from my Ubuntu 10.04 desktop machine at work):</p>
<pre><span style="color:#800000;">------ Shared Memory Limits --------</span>
<span style="color:#800000;">max number of segments = 4096</span>
<span style="color:#800000;">max seg size (kbytes) = 4592442</span>
<span style="color:#800000;">max total shared memory (kbytes) = 4592440</span>
<span style="color:#800000;">min seg size (bytes) = 1</span></pre>
<p>This machine is configured to make 4 GB of RAM available to be used as shared memory, and the maximum segment is also 4 GB. We can also query the current settings with the following command:</p>
<pre><span style="color:#800000;">sysctl -a 2&gt; /dev/null | grep kernel.shm</span></pre>
<p>On my machine this reports the following:</p>
<pre><span style="color:#800000;">kernel.shmmax = 4702660608</span>
<span style="color:#800000;">kernel.shmall = 1148110</span>
<span style="color:#800000;">kernel.shmmni = 4096</span></pre>
<p>These numbers mean the same thing as shown above, but the first two lines use different values. While <span style="color:#800000;">ipcs</span> reports both the max segment size and the max overall shared memory as kbytes, <span style="color:#800000;">sysctl</span> reports the max segment size (<span style="color:#800000;">kernel.shmmax</span>) as bytes and the max overall shared memory (<span style="color:#800000;">kernel.shmall</span>) as 4 KB pages.</p>
<p>These settings are configured at boot time by reading /etc/sysctl.conf and applying defaults if no values are provided. To see the configured values, enter the following:</p>
<pre><span style="color:#800000;">grep kernel.shm /etc/sysctl.conf</span></pre>
<p>In my case I see the following lines:</p>
<pre><span style="color:#800000;">kernel.shmmax = 4702660608</span>
<span style="color:#800000;">kernel.shmall = 1148110</span></pre>
<p>If you edit <span style="color:#800000;">/etc/sysctl.conf</span> (as root using sudo) and reboot your machine then the new values should take effect. If you want to make changes without rebooting your machine, use something like the following:</p>
<pre><span style="color:#800000;">sudo sysctl -w kernel.shmmax=4702660608</span></pre>
<p>Once you have things properly configured then the SPC monitor should be able to allocation a SPC and the stone should start. To see the memory use, you can enter the following</p>
<pre><span style="color:#800000;">ipcs</span></pre>
<p>On my machine the output includes the following:</p>
<pre><span style="color:#800000;">------ Shared Memory Segments --------</span>
<span style="color:#800000;">key shmid owner perms bytes nattch status </span>
<span style="color:#800000;">...</span>
<span style="color:#800000;">0x00000000 1409046 jfoster 600 393216 2 dest </span>
<span style="color:#800000;">0xe50206db 8683543 jfoster 660 529203200 8 locked</span>
<span style="color:#800000;">...</span></pre>
<p>There are a number of segments of 384 KB that are marked to be destroyed (dest), and one segment of about 500 MB. My configuration file includes the following:</p>
<pre><span style="color:#800000;">SHR_PAGE_CACHE_SIZE_KB = 500000;</span></pre>
<p>The pcmon.log file shows that the number of pages requested:</p>
<pre><span style="color:#800000;">Number of pages 31250.</span></pre>
<p>Since each page is 16 KB, this would request 512000000 bytes for pages. It turns out that there are other data structures that need to be shared, including the statistics captured by statmonitor, and the memory requested will be slightly larger than the configured amount. This means that you should set <span style="color:#800000;">shmmax</span> and <span style="color:#800000;">shmall</span> to be <em>larger</em> than your <span style="color:#800000;">SHR_PAGE_CACHE_SIZE_KB</span> setting (or ask for less than the configured maximum).</p>
<p>The GemStone/S 64 Bit Install Guide has a good discussion of how to calculate shared memory needs, but at present it contains an error in that the <span style="color:#800000;">shmmax</span> setting is incorrectly shown as being the same as the <span style="color:#800000;">shmall</span> setting. Remember that <span style="color:#800000;">shmmax</span> is in bytes and <span style="color:#800000;">shmall</span> is in pages (typically 4 KB).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/programminggems.wordpress.com/1330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/programminggems.wordpress.com/1330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=programminggems.wordpress.com&#038;blog=4742635&#038;post=1330&#038;subd=programminggems&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://programminggems.wordpress.com/2012/04/06/configuring-shared-memory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/631f05ac3a6ed798c66034d408aceeaf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">James Foster</media:title>
		</media:content>
	</item>
	</channel>
</rss>
