<?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>Mostly useless &#187; Programming</title>
	<atom:link href="http://www.mostly-useless.com/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mostly-useless.com/blog</link>
	<description>There is much pleasure to be gained from useless knowledge (Bertrand Russell)</description>
	<lastBuildDate>Wed, 09 Mar 2011 10:22:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Why is forever</title>
		<link>http://www.mostly-useless.com/blog/2009/11/24/why-is-forever/</link>
		<comments>http://www.mostly-useless.com/blog/2009/11/24/why-is-forever/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 17:20:46 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Lifestyle]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/?p=412</guid>
		<description><![CDATA[Part of my job is to select technical people to be hired in the company.  Few months ago I happened to interview a guy for a developer position.  This guy has a degree in chemistry but his career then oscillated between system administration and programming in the java world. After a while talking about his [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-415  aligncenter" title="A diamond is forever" src="http://www.mostly-useless.com/blog/wp-content/uploads/2009/11/j0410091.png" alt="A diamond is forever" width="480" height="360" /></p>
<p style="text-align: left;">Part of my job is to select technical people to be hired in the company.  Few months ago I happened to interview a guy for a developer position.  This guy has a degree in chemistry but his career then oscillated between system administration and programming in the java world.<span id="more-412"></span></p>
<p style="text-align: left;">After a while talking about his experience he said that, being in his 30s, he was looking for some stability.  In particular, he said, he was frightened by how quickly our knowledge can become obsolete in the programming world.  For example in 5 years Java could become obsolete because everybody could move to the next big thing (.net, he said), making Java skills useless and forcing you to learn everything from scratch.  He added that system administration and programming skills in the open source world will last longer.</p>
<p style="text-align: left;">On one hand I agree: open source skills will last longer.  In the open source world we never have to push the new thing just to force everybody to buy the new version.  We&#8217;re not at the mercy of some company&#8217;s agenda.  We grow software incrementally, evolving technology on top of the existing good old stuff, with continuous innovation and experimentation patch after patch and using Darwinism to select stuff that works and re-use it forever.</p>
<p style="text-align: left;">On the other hand I think this guy doesn&#8217;t understand what programming is really about, on a deeper level. In our world technologies evolve very quickly.  Every day new emerging technologies provide better ways to do the same thing and even in the evolutionary open source world, we have to keep up with the fast-pace advancement.</p>
<p style="text-align: left;">That&#8217;s why good schools won&#8217;t teach you a specific programming language or a specific application or operating system.  Good schools won&#8217;t teach you the technology of the day.  They will teach you how to learn new stuff quickly, how to be your own self-teacher.  They will prepare you for a whole life of research and study.</p>
<p style="text-align: left;">As Jeff Atwood once wrote &#8220;<strong>how</strong> lasts about five years, but <strong>why</strong> is forever&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2009/11/24/why-is-forever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ten years with Open Source</title>
		<link>http://www.mostly-useless.com/blog/2008/02/09/ten-years-with-open-source/</link>
		<comments>http://www.mostly-useless.com/blog/2008/02/09/ten-years-with-open-source/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 00:00:45 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technlogy]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2008/02/09/ten-years-with-open-source/</guid>
		<description><![CDATA[Exactly ten years ago, on Feb 9th 1998, Bruce Perens and Eric Raymond began the Open Source movement. It was just a different way to explain what had been already happening for quite a few years, and make it understandable for the business world. And it worked very well. Building on the ground-breaking work of [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><img src="http://www.mostly-useless.com/blog/wp-content/uploads/2008/02/opensource-480.png" alt="Opensource logo" /></p>
<p>Exactly ten years ago, on Feb 9th 1998, Bruce Perens and Eric Raymond began the Open Source movement.  It was just a different way to explain what had been already happening for quite a few years, and make it understandable for the business world.  And it worked very well.</p>
<p>Building on the ground-breaking work of great leaders like Richard Stallman and Linus Torvalds, we laid out the software technology that leads many markets of today&#8217;s world, entering the mainstream.  When I say we it&#8217;s because I have been an active contributor of this community and an advocate of the open source concept since the beginning.<span id="more-277"></span></p>
<p>Nowadays I use open source for everything, my parents use Linux on their desktop, my friends are eager to buy an Asus EEE and major governments have state funded programs to adopt or develop open source.   Several open source companies are making billions and almost everybody is saving huge money just by using it.</p>
<p>The idea spread even out of the software world, generating parallel incarnations in the culture generation and distribution area.  Try to imagine a world without open source: no Firefox, no Open Office, no MySQL, no OLTP project, no Asus EEE, no Creative Commons, no Wikipedia, no peer-to-peer.   Lately, all the biggest innovations in the software world came from the open source community are were possible because of it.  There are still are some areas where Open Source has to work in order to go truly mainstream, for example Desktop  applications, but we can clearly see it&#8217;s going to happen sooner or later.</p>
<p>Thanks to Linus, Richard, Bruce, Eric, Larry, Guido, to friends at Ferrara Linux Users Group,  and to everybody who helped and believed in this amazing challenge.  Where will we stand in 2018?   I can&#8217;t wait to see that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2008/02/09/ten-years-with-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python makes you fly</title>
		<link>http://www.mostly-useless.com/blog/2007/12/07/python-makes-you-fly/</link>
		<comments>http://www.mostly-useless.com/blog/2007/12/07/python-makes-you-fly/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 20:30:16 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Comic]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Xkcd]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2007/12/07/python-makes-you-fly/</guid>
		<description><![CDATA[I know how it feels&#8230;]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://www.mostly-useless.com/blog/wp-content/uploads/2007/12/python.png" alt="Python according to xkcd" /></p>
<p>I know how it feels&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2007/12/07/python-makes-you-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android, Google &amp; Italian laws</title>
		<link>http://www.mostly-useless.com/blog/2007/11/18/android-google-italian-laws/</link>
		<comments>http://www.mostly-useless.com/blog/2007/11/18/android-google-italian-laws/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 18:50:57 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Bureocracy]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Italy]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2007/11/18/android-google-italian-laws/</guid>
		<description><![CDATA[Google led the creation of Open Handset Alliance, a consortium involving a number of telco and manufacturers . As its first act the Alliance released Android, an open source operating system for mobiles complete of SDK and API. The SDK includes a working emulator and half a dozen example applications. The idea to establish an [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://www.mostly-useless.com/blog/wp-content/uploads/2007/11/oha.jpg" alt="Open Handset Alliance" /></p>
<p>Google led the creation of <a href="http://www.openhandsetalliance.com/">Open Handset Alliance</a>, a consortium involving a number of <a href="http://www.openhandsetalliance.com/oha_members.html">telco and manufacturers</a> .  As its first act the Alliance released <a href="http://code.google.com/android/">Android</a>, an open source operating system for mobiles complete of SDK and API.  The SDK includes a working emulator and half a dozen example applications.  The idea to establish an open platform for mobile developers is very good but not particularly new: <a href="http://www.openmoko.org/">project Openmoko </a>has been working to a similar concept for several months and went as far as to release a developer version of the handset.<span id="more-236"></span></p>
<p>Currently there are several competing platforms with a significant presence on the market: <a href="http://developer.symbian.com/main/tools/appcode/">Symbian</a> OS, Microsoft <a href="http://msdn2.microsoft.com/en-us/windowsmobile/">Windows Mobile</a>, Apple <a href="http://developer.apple.com/iphone/devcenter/">iPhone</a>, Motorola <a href="http://www.motorola.com/content.jsp?globalObjectId=8411">MotoMAGX</a>, Qualcomm <a href="http://brew.qualcomm.com/brew/">BREW</a> and RIM <a href="http://na.blackberry.com/eng/developers/">Blackberry</a> to name a few.  Trying to build a business on top of mobile applications is very difficult because you have to make several different versions of your application and the market is very fluid.  Now, with the huge money and pressure that Google can inject into the field there&#8217;s a chance they can impose a common platform.</p>
<p>They chose to build on top of several open source technologies: Linux, OpenGL, SQLite and <a href="http://webkit.org/">Webkit</a>.  The latter is particularly interesting because it&#8217;s a rendering engine derived from the <a href="http://www.kde.org/">KDE</a> project (and going to be merged back into konqueror) and already powers the iPhone, <a href="http://www.s60.com/">s60</a> and <a href="http://www.apple.com/safari/">Safari</a>.  This could become the rendering engine widely used both on the web and on mobile handsets.</p>
<p>To bootstrap the project and quickly build a critical mass of third party developers, Google issued a <a href="http://code.google.com/android/adc.html">contest</a> with a 10 million dollar prize for the best applications that will be developed in the next few months.  There are a few <a href="http://code.google.com/android/adc_faq.html">countries not allowed</a> to participate to the contest.  As usual there are countries forbidden by US laws (Cuba, Iran, Syria, North Korea, Sudan, and Myanmar) and on top of that there are countries excluded because of local restrictions: Quebec and&#8230; Italy!</p>
<p>So Telecom Italia is one of the members of Open Handset Alliance, but Italians can&#8217;t participate to the challenge.   Great. How is this possible?  Simple: in Italy contests are regulated by a very strict law requiring that issuers create accurate documentation, put the prize in a protected guarantee fund and seek permission of the Ministry of Economy.   Google probably found that going through all of this was not worthwhile.  Italian bureaucracy and over-legislation at work.   Do you remember <a href="http://www.mostly-useless.com/blog/2006/07/11/italian-laws/">my last post</a> on this topic?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2007/11/18/android-google-italian-laws/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One laptop per child</title>
		<link>http://www.mostly-useless.com/blog/2007/06/10/one-laptop-per-child/</link>
		<comments>http://www.mostly-useless.com/blog/2007/06/10/one-laptop-per-child/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 19:20:12 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rantsnraves]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2007/06/10/one-laptop-per-child/</guid>
		<description><![CDATA[This weekend I&#8217;ve been to PyCon Uno, the first italian conference dedicated to the Python programming language. It&#8217;s been very interesting, in particular Alex Martelli&#8216;s keynote on managing the tech development and a presentation on sqlalchemy, but this post is not about the conference. Marco Pesenti Gritti&#8217;s final keynote was about One Laptop Per Child, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mostly-useless.com/blog/wp-content/uploads/2007/06/olpc.jpg" alt="OLPC XO" /></p>
<p>This weekend I&#8217;ve been to <a href="http://www.pycon.it/">PyCon Uno</a>, the first italian conference dedicated to the <a href="http://www.python.org">Python</a> programming language.  It&#8217;s been very interesting, in particular <a href="http://www.aleax.it/">Alex Martelli</a>&#8216;s keynote on managing the tech development and a presentation on <a href="http://www.sqlalchemy.org/">sqlalchemy</a>, but this post is not about the conference.</p>
<p>Marco Pesenti Gritti&#8217;s final keynote was about <a href="http://www.laptop.org/">One Laptop Per Child</a>, a project to bring a low cost computer to children in those third world countries where the benefits of worldwide information and education technology would be otherwise impossible.  With the help of <a href="http://www.un.org/">UN</a> and <a href="http://www.mit.edu">MIT</a>, they are trying to build a 100$ book-size laptop with a 1200&#215;900 colour display and consuming just about 2W.  It&#8217;s going to be developed using open source software only, and to use Python and GTK+ to develop a revolutionary environment that discards the desktop/office metaphor and puts emphasis on children activities. Several states already joined the project and did preliminary testing on some of their schools.</p>
<p>I think they did a very good job and hope this is going to be a great success.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2007/06/10/one-laptop-per-child/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sunset of the personal computer industry</title>
		<link>http://www.mostly-useless.com/blog/2007/06/02/sunset-of-the-personal-computer-industry/</link>
		<comments>http://www.mostly-useless.com/blog/2007/06/02/sunset-of-the-personal-computer-industry/#comments</comments>
		<pubDate>Sat, 02 Jun 2007 13:33:58 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rantsnraves]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2007/06/02/sunset-of-the-personal-computer-industry/</guid>
		<description><![CDATA[Is there anybody out there who doesn&#8217;t know who Steve Jobs and Bill Gates are? Everybody and his brother know that they are the leaders of Apple and Microsoft and have been dominating the personal computer industry for the last 30 years. In all of this time, they&#8217;ve been very careful to appear together very [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.mostly-useless.com/blog/wp-content/uploads/2007/06/gates_and_jobs.jpg" alt="Gates and Jobs" /></p>
<p>Is there anybody out there who doesn&#8217;t know who Steve Jobs and Bill Gates are?  Everybody and his brother know that they are the leaders of Apple and Microsoft and have been dominating the personal computer industry for the last 30 years.  In all of this time, they&#8217;ve been very careful to appear together very rarely, but last Wednesday they shared the stage at the <a href="http://d.wsj.com/">D: All things Digital</a> conference. They chatted about how the industry evolved during their kingdom and talked about how they think our digital future is going to be.  A warm and friendly chat, like a get together for long-standing friends who finally relax and nostalgically recall the common past.  But wait, look at the picture, is that a real smile?<span id="more-193"></span></p>
<p>They&#8217;ve been enemies so far, trying to extend their business by attacking the market occupied by the other company, but now they have common enemies to fight.  Google is moving users one level up in the stack, feeding them with application that run inside a normal Internet browser, storing data on the server, and basically making the personal computer a commodity that nobody cares about.  And they use AJAX, a technology paradigm where neither Apple nor Microsoft have experience.  Hand-held manufactures are on their way to provide a new computing concept, where you carry your important data and applications in your pocket and always on.  Meanwhile, the Open Source movement is making operating systems and standard applications a commodity.</p>
<p>They know their traditional business is in danger, so their companies are both busy at differentiating, trying to find an escape path.  Microsoft spent the last years investing in game consoles (the Xbox), internet search engines, portals and advertising (MSN) and now they&#8217;re trying to merge with Yahoo and become a media company.  Apple spent the last years investing in portable players (iPod), music distribution (iTunes), cell phones (iPhone) and basically dismissed the computer hardware market when they stopped having their own technological platform, standardizing on the same Intel processors that run Windows.</p>
<p>This get-together appears as one more signal the personal computer industry reached a dead end and a new industry is taking the lead.  That is not a real smile at all.  Their eyes are nervously trying to convey a message: &#8220;let&#8217;s stop our fight and work together to save the business&#8221;.  I won&#8217;t be surprised if they announce a joint venture or a strategic partnership in a few months.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2007/06/02/sunset-of-the-personal-computer-industry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash prompt with stock quote</title>
		<link>http://www.mostly-useless.com/blog/2007/05/26/bash-prompt-with-stock-quote/</link>
		<comments>http://www.mostly-useless.com/blog/2007/05/26/bash-prompt-with-stock-quote/#comments</comments>
		<pubDate>Sat, 26 May 2007 13:58:03 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2007/05/26/bash-prompt-with-stock-quote/</guid>
		<description><![CDATA[In case you are a stock trading geek like me, or if you just want to monitor the stock of some company while working on your linux server, this is a very useful configuration you can put in your .bash_profile. Thank you Yahoo! TICKER="QQQQ" PS1="\[\033[01;32m\]\`GET 'http://download.finance.yahoo.com/d/quotes.csv?s=$TICKER&#38;f=sl1d1'&#124;cut -f2 -d,\` \u@\h\[\033[01;34m\] \w \$\[\033[00m\] " export PS1 Happy [...]]]></description>
			<content:encoded><![CDATA[<p>In case you are a stock trading geek like me, or if you just want to monitor the stock of some company while working on your linux server, this is a very useful configuration you can put in your <code>.bash_profile<code>. </code></code>Thank you Yahoo!</p>
<blockquote><p><code>TICKER="QQQQ"<br />
PS1="\[\033[01;32m\]\`GET 'http://download.finance.yahoo.com/d/quotes.csv?s=$TICKER&amp;f=sl1d1'|cut -f2 -d,\` \u@\h\[\033[01;34m\] \w \$\[\033[00m\] "<br />
export PS1</code></p></blockquote>
<p>Happy monitoring!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2007/05/26/bash-prompt-with-stock-quote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seating people together for maximum enjoyment</title>
		<link>http://www.mostly-useless.com/blog/2007/05/01/176/</link>
		<comments>http://www.mostly-useless.com/blog/2007/05/01/176/#comments</comments>
		<pubDate>Tue, 01 May 2007 12:28:24 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Movies]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2007/05/01/176/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://xkcd.com/c173.html"><img src="http://www.mostly-useless.com/blog/wp-content/uploads/2007/05/movie_seating.png" alt="Movie Seating" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2007/05/01/176/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java sucks for daemon programming</title>
		<link>http://www.mostly-useless.com/blog/2006/12/24/java-sucks-for-daemon-programming/</link>
		<comments>http://www.mostly-useless.com/blog/2006/12/24/java-sucks-for-daemon-programming/#comments</comments>
		<pubDate>Sun, 24 Dec 2006 00:19:30 +0000</pubDate>
		<dc:creator>simone</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.mostly-useless.com/blog/2006/12/24/java-sucks-for-daemon-programming/</guid>
		<description><![CDATA[I don&#8217;t usually waste my time on java, but today I was in the right mood and tried to write a very simple network daemon, just to learn how hard it was. After some quick google I found that java can&#8217;t daemonize itself (it has no access to relevant native system calls) and therefore the [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t usually waste my time on java, but today I was in the right mood and tried to write a very simple network daemon, just to learn how hard it was.  After some quick google I found that java can&#8217;t daemonize itself (it has no access to relevant native system calls) and therefore the Apache guys developed a nice component called org.apache.commons.daemon.  I though Apache guys are smart, after all they developed the Apache web server, Subversion and more interesting stuff, so they have to know very well how a network daemon works.  So I happily started with the test app, SimpleDaemon, bundled in the commons tar file, just to prove it works.</p>
<p>Unfortunately at the 1st attempt I got:</p>
<blockquote><p>pioppo@roentgen ~/sandbox/daemon $ jsvc -verbose SimpleDaemon.class SimpleDaemon<br />
24/12/2006 00:32:53 32525 jsvc error: Cannot execute JSVC executor process</p></blockquote>
<p>Gosh, what is this? <span id="more-131"></span></p>
<p>Ok ok, some more googling and I found jsvc is using execve(2) on itself but doesn&#8217;t canonicalize the filename so execve fails.  To workaround the problem you have to invoke jsvc as an absolute path:</p>
<blockquote><p>pioppo@roentgen ~/sandbox/daemon $ /usr/bin/jsvc -verbose SimpleDaemon.class SimpleDaemon<br />
pioppo@roentgen ~/sandbox/daemon $</p></blockquote>
<p>On second attempt I get no errors, but it&#8217;s not running.  Well, not very verbose either.  I know my stuff, so I try debugging with strace and I find jsvc is failing opening the pidfile in /var/run/jsvc.pid but it&#8217;s not nice enough to tell me.  Ok, let&#8217;s try again forcing log file creation and a pid file in the current dir:</p>
<blockquote><p>pioppo@roentgen ~/sandbox/daemon $ /usr/bin/jsvc -pidfile ./sd.pid -errfile ./err.log SimpleDaemon.class SimpleDaemon<br />
pioppo@roentgen ~/sandbox/daemon $</p></blockquote>
<p>This time the err.log file has been created and I can read this nice report:</p>
<blockquote><p>24/12/2006 00:42:58 31709 jsvc.exec error: syscall failed in set_caps<br />
24/12/2006 00:42:58 31709 jsvc.exec error: set_caps(CAPS) failed<br />
24/12/2006 00:42:58 31708 jsvc.exec error: Service exit with a return value of 4</p></blockquote>
<p>Gosh, this is driving me crazy.  Wasn&#8217;t this supposed to be a piece of cake? Ok, some more googling and I find this happens in case I have no capability kernel module loaded.  OK OK, let&#8217;s modprobe capability and try again:</p>
<blockquote><p>24/12/2006 00:51:28 32407 jsvc.exec error: Cannot find daemon loader org/apache/commons/daemon/support/DaemonLoader<br />
24/12/2006 00:51:28 32406 jsvc.exec error: Service exit with a return value of 1</p></blockquote>
<p>$&#038;$&#038;&#038;^ what the hell is this, a candid camera?  After more googling I find this happens because I forgot to add the path to the jar file for commons.  Eventually I find a way to run this test daemon that is supposed to do nothing, just an Hello World app.  I look it up in top and I see it spawned 10 threads and is taking 368M of virtual mem.  Ok, now I know why I don&#8217;t usually waste my time on java <img src='http://www.mostly-useless.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mostly-useless.com/blog/2006/12/24/java-sucks-for-daemon-programming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

