<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Micks Distractions&#187; Computers</title>
	<atom:link href="http://onut.net/blog/archives/category/tech/computers/feed" rel="self" type="application/rss+xml" />
	<link>http://onut.net/blog</link>
	<description>Life is too short to be not interested in everything.</description>
	<lastBuildDate>Thu, 15 Dec 2011 10:59:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<copyright>Copyright &#xA9; Micks Distractions 2011 </copyright>
	<managingEditor>website@boutade.net (Micks Distractions)</managingEditor>
	<webMaster>website@boutade.net (Micks Distractions)</webMaster>
	<image>
		<url>http://onut.net/wp/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Micks Distractions</title>
		<link>http://onut.net/blog</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Life is too short to be not interested in everything.</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>Micks Distractions</itunes:author>
	<itunes:owner>
		<itunes:name>Micks Distractions</itunes:name>
		<itunes:email>website@boutade.net</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://onut.net/wp/wp-content/plugins/podpress/images/powered_by_podpress.jpg" />
		<item>
		<title>Solaris 8 brandz getppid hack</title>
		<link>http://onut.net/blog/archives/577#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/577#comments</comments>
		<pubDate>Sat, 12 Sep 2009 08:24:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sun Microsystems]]></category>

		<guid isPermaLink="false">http://onut.net/blog/?p=577</guid>
		<description><![CDATA[Sun has always said that any application written for Solaris 6 will be forwards compatible with any other version. It’s a big claim, but as long as the application adheres to the API it’s possible. Occasionally you bump into things that don’t adhere to the API, (quite a lot of applications really). This is usually [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Sun has always said that any application written for Solaris 6 will be forwards compatible with any other version. It’s a big claim, but as long as the application adheres to the API it’s possible.<br />
Occasionally you bump into things that don’t adhere to the API, (quite a lot of applications really). This is usually caused by developers thinking that they should do things “this way”, because Sun does it oh so wrong all the time. Consequently, you end up with legacy applications that can’t run on Solaris 10.</p>
<p>Enter Solaris 8 brandz zones. Being able to run legacy applications in a Solaris 8 brandz generally gets you around most of the issues in the remaining apps that do stupid things. However, there’s a couple of quirks with a zone that can introduce odd behaviour in an application.</p>
<p>Progress for example.…… Read On.<br />
<span id="more-577"></span></p>
<h4>The issue</h4>
<p>An old legacy Progress database was sitting on an old legacy server which was so EOL that it would make even Bill cringe… or laugh… Running Solaris 6 was not an option, but running anything else, (even Solaris 9), would be adventurous to say the least. Can I say legacy again?</p>
<h4>The solution</h4>
<p>So first try a brandz Solaris 8. Configured, installed, and booted a brand spanking new zone. Copy the data over. Attempt a start of the Progress database.</p>
<pre LANGUAGE="text">
10:03:21 BROKER  0: Multi-user session begin. (333)
10:03:24 BROKER  0: Begin Physical Redo Phase at 13312 . (5326)
10:03:30 BROKER  0: Physical Redo Phase Completed at blk 13743 off 2457 upd 2636. (7161)
10:03:31 BROKER  0: Started for mfglive using TCP, pid 20533. (5644)
10:04:02 BROKER  0: SYSTEM ERROR: Unable to kill parent process, errno= 4. (1680)
10:04:02 BROKER  0: SYSTEM ERROR: The broker is exiting unexpectedly, beginning Abnormal Shutdown. (5292)
10:04:02 BROKER  0: drexit: Initiating Abnormal Shutdown
10:04:02 BROKER  0: ** Save file named core for analysis by Progress Software Corporation. (439)
10:04:02 BROKER  0: Begin ABNORMAL shutdown code 2 (2249)
10:04:04 BROKER   : Removed shared memory with segment_id: 41
10:04:04 BROKER   : Multi-user session end. (334)
</pre>
<p>Nada. Mmmmm. Seems to start up OK, but then crashes in a screaming heap a short while later.</p>
<p>Checking shared libraries seemed to be OK. Nothing missing or odd.</p>
<pre LANGUAGE="text">
root % ldd -r /mfgpro/dlc91c/bin/_mprosrv
        /usr/lib/secure/s8_preload.so.1
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libintl.so.1 =>  /usr/lib/libintl.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Sun-Fire-V490/lib/libc_psr.so.1
</pre>
<p>So, I thought I’d truss, (the old friend), a few processes to see what was going on. Chucking the below in various scripts, and comparing the working server to the non-working server. (This produces VERY NOISY output, but it’s great for diagnosing what’s going on.)</p>
<pre LANGUAGE="text">
truss -feal -vall -xall -rall -wall -sall -mall -o /tmp/logfile exec_process
</pre>
<p>If you look at the appendices to this post, I’ve added the relevant, sections of the truss. You may notice an interesting thing. The working server roughly follows this process, (in the snippet):<br />
– Bind to 0.0.0.0 port 3500.<br />
– fstat64() filehandles.<br />
– Yadda, yadda, write output to STDOUT.<br />
– getpid() — find parent process, (24012).<br />
– kill –TERM 24012<br />
– wait()<br />
– Parent — ALRM signal<br />
– Parent — die.<br />
– Child — Context switch.<br />
– getpid() — find parent process, (1). OK!</p>
<p>Now this is a little odd. It would seem that some developer thought that it’d be a damn good idea to re-invent the old “I’m going to fork a child process in the background” API calls, and chuck in their own.</p>
<p>They are checking the parent process, killing it, and rechecking to see if it’s now 1, (which is sysvinit), then it progresses on.</p>
<p>Now, the non-working server.<br />
– Bind to 0.0.0.0 port 3500.<br />
– fstat64() filehandles.<br />
– Yadda, yadda, write output to STDOUT.<br />
– getpid() — find parent process, (21267).<br />
– kill –TERM 21267<br />
– wait()<br />
– Parent — ALRM signal <-IMPORTANT<br />
– Parent — no die.<br />
– getpid() — find parent process, (21267).<br />
– kill –TERM 21267<br />
– wait()<br />
– Parent — ALRM signal <-IMPORTANT<br />
– Parent — no die.<br />
Ad naseum.….</p>
<p>A quick process check:</p>
<pre LANGUAGE="text">
     UID   PID  PPID  C    STIME TTY      TIME CMD
    root  2260  1417  0   May 27 ?        0:09 /etc/init
    root  1417  1417  0   May 27 ?        0:00 zsched
    root  2960  1417  0   May 27 ?        0:00 /usr/lib/picl/picld
</pre>
<p>Hey! Of course you’re not gonna be able to kill zsched! You see in a Solaris zone the ‘root’ process is called ‘zsched’, and it will never ever be 1 at all, and neither will init for that matter. Not only that you’re not ever going to be able to kill the zsched process from within the zone as it’s protected within the global zone memory space.</p>
<p>Well, it’s too late to kick the developer up the bum. So time to hack.</p>
<h4>The hack</h4>
<p>Preloading shared libs has been around since I was a Mars Bar in my Dad’s top pocket, (well almost). So it should be a simple case of replacing any getpid() API call with my own. Simple enough, done it before.</p>
<p>See the appendix for the getpidhack.c file that I used. This is a shared lib that replaces both getppid() and getpid(), (for good measure, but not really needed in my case), API calls. It will return the PID 1, when _getppid() returns the same PID as the environment variable PIDHACK.<br />
Note that I call _getppid() which allows me to fetch the REAL PID so I can return it when they don’t match.</p>
<p>So, to use it. First build it:</p>
<pre LANGUAGE="bash">
gcc -fPIC -c getpidhack.c
gld getpidhack.o -L/usr/lib -lc -G -assert pure-text -o /usr/local/lib/libgetpidhack.so
</pre>
<p>Set an environment variable called PIDHACK to the currently running zsched process:</p>
<pre LANGUAGE="bash">
HACKPID=`ps -e | awk '/zsched/{print$1}'`
export HACKPID
</pre>
<p>Then set your LD_PRELOAD variable to point to the shared lib:</p>
<pre LANGUAGE="bash">
LD_PRELOAD="/usr/local/lib/libgetpidhack.so"
export LD_PRELOAD
</pre>
<p>After this the Progress database just started. Woot! The DB can now run on hardware that it would never in it’s life be able to run on under a brandz zone. Another EOL server to chuck out the computer room window to see what happens.</p>
<p>BTW, if you are having issues with this, you can run a DTrace to see if you’re calling the real getpid(), or the getpidhack version. Create the following script, and run it with one argument, (the PID of your zsched). Every time you hit the getppid() API call it’ll register — this means that you are not replacing the API call and your shared lib preload isn’t working.</p>
<pre LANGUAGE="c">
#!/usr/sbin/dtrace -s

syscall::getpid:return
/ppid == $1/
{
        printf("%d %d", ppid, pid);
}
</pre>
<hr />
<h4>Appendix 1 — getpidhack.c</h4>
<pre LANGUAGE="c">
#include &lt;sys/types.h&gt;
#include &lt;unistd.h&gt;
#include &lt;stdio.h&gt;

pid_t getppid(void)
{
        pid_t hackppid;
        pid_t realppid;

        // hackpid - the PID of the zsched process.
        hackppid = atol(getenv("HACKPID"));

        // realppid - the real PID of the parent process.
        realppid = _getppid();

        // If the realppid equals hackppid, then we want to reset it to 1.
        if (realppid == hackppid)
        {
                return((pid_t) 1);
        }

        // Else return whatever PID we were given.
        return(realppid);
}

pid_t getpid(void)
{
        pid_t hackpid;
        pid_t realpid;

        // hackpid - the PID of the zsched process.
        hackpid = atol(getenv("HACKPID"));

        // realpid - the real PID of the parent process.
        realpid = _getpid();

        // If the realpid equals hackpid, then we want to reset it to 1.
        if (realpid == hackpid)
        {
                return((pid_t) 1);
        }

        // Else return whatever PID we were given.
        return(realpid);
}
</pre>
<h4>Appendix 2 — The working server</h4>
<pre LANGUAGE="text">
24013/1:        setsockopt(76, 65535, 4, 0xEFFFF7FC, 4)         = 0
24013/1:        setsockopt(76, 65535, 8, 0xEFFFF7FC, 4)         = 0
24013/1:        bind(76, 0x0015DCA8, 16)                        = 0
24013/1:                name = 0.0.0.0/3500
24013/1:        listen(76, 10)                                  = 0
24013/1:        getpid()                                        = 24013 [24012]
24013/1:        lseek(3, 457164, 0)                             = 457164
24013/1:        read(3, 0xEFFFF66C, 81)                         = 81
24013/1:           % L S t a r t e d   f o r   % s   u s i n g   % s ,   p i d  %
24013/1:           l .   ( 5 6 4 4 )\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0
24013/1:          \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
24013/1:        time()                                          = 1252542477
24013/1:        write(9, 0xEFFFF154, 69)                        = 69
24013/1:           1 0 : 2 7 : 5 7   B R O K E R     0 :   S t a r t e d   f o r
24013/1:           m f g l i v e   u s i n g   T C P ,   p i d   2 4 0 1 3 .   ( 5
24013/1:           6 4 4 )\n
24013/1:        fstat64(0, 0xEFFFF058)                          = 0
24013/1:            d=0x01540000 i=17139 m=0020620 l=1  u=0     g=7     rdev=0x0 0600005
24013/1:                at = Sep 10 10:27:46 EST 2009  [ 1252542466 ]
24013/1:                mt = Sep 10 10:27:56 EST 2009  [ 1252542476 ]
24013/1:                ct = Sep 10 09:39:31 EST 2009  [ 1252539571 ]
24013/1:            bsz=8192  blks=0     fs=ufs
24013/1:        fstat64(1, 0xEFFFF058)                          = 0
24013/1:            d=0x01540000 i=17139 m=0020620 l=1  u=0     g=7     rdev=0x0 0600005
24013/1:                at = Sep 10 10:27:46 EST 2009  [ 1252542466 ]
24013/1:                mt = Sep 10 10:27:56 EST 2009  [ 1252542476 ]
24013/1:                ct = Sep 10 09:39:31 EST 2009  [ 1252539571 ]
24013/1:            bsz=8192  blks=0     fs=ufs
24013/1:        fstat64(2, 0xEFFFF058)                          = 0
24013/1:            d=0x01540000 i=17139 m=0020620 l=1  u=0     g=7     rdev=0x0 0600005
24013/1:                at = Sep 10 10:27:46 EST 2009  [ 1252542466 ]
24013/1:                mt = Sep 10 10:27:56 EST 2009  [ 1252542476 ]
24013/1:                ct = Sep 10 09:39:31 EST 2009  [ 1252539571 ]
24013/1:            bsz=8192  blks=0     fs=ufs
24013/1:        write(1, 0xEFFFF154, 69)                        = 69
24013/1:           1 0 : 2 7 : 5 7   B R O K E R     0 :   S t a r t e d   f o r
24013/1:           m f g l i v e   u s i n g   T C P ,   p i d   2 4 0 1 3 .   ( 5
24013/1:           6 4 4 )\n
24013/1:        pwrite64(7, 0xEFFFF908, 4, 0)                   = 4
24013/1:             0xEFFFF908: "\0\0\002"
24013/1:        close(7)                                        = 0
24013/1:        getpid()                                        = 24013 [24012]
24013/1:        getpid()                                        = 24013 [24012]
24013/1:        kill(24012, 0x0000000F)                         = 0
24012/2:        signotifywait()                                 = 15
24013/1:        lwp_alarm(1)                                    = 0
24012/2:            Incurred fault #11, FLTPAGE  %pc = 0xEF5CDC80  addr = 0xEF67 0F48
24012/2:            Incurred fault #11, FLTPAGE  %pc = 0xEF64A3C8  addr = 0xEF66 FA68
24012/2:        lwp_sigredirect(1, 0x0000000F)                  = 0
24012/1:            Received signal #15, SIGTERM, in wait() [caught]
24012/1:              siginfo: SIGTERM pid=24013 uid=0
24012/1:        wait()                                          Err#4 EINTR
24012/1:        sigprocmask(3, 0xEF667DF8, 0x00000000)          = 0
24012/1:                 set = 0 0 0 0
24012/1:            Incurred fault #11, FLTPAGE  %pc = 0x0004593C  addr = 0x0013 10F4
24012/1:            Incurred fault #11, FLTPAGE  %pc = 0x000459A8  addr = 0x0015 3AEC
24012/1:        _exit(0)
24013/1:            Received signal #14, SIGALRM, in pause() [caught]
24013/1:        pause()                                         Err#4 EINTR
24013/1:            Incurred fault #11, FLTPAGE  %pc = 0xEF5CDCE8  addr = 0xEF5C DCE8
24013/1:        sigprocmask(3, 0xEF667DF8, 0x00000000)          = 0
24013/1:                 set = 0 0 0 0
24013/1:        context(1, 0xEFFFF240)
24013/1:        getpid()                                        = 24013 [1]
24013/1:        close(0)                                        = 0
24013/1:        open(0xEFFFF920, 0)                             = 0
24013/1:             0xEFFFF920: "/qaddb/eblive/mfglive.lg"
24013/1:        close(1)                                        = 0
24013/1:        open(0xEFFFF920, 0)                             = 1
24013/1:             0xEFFFF920: "/qaddb/eblive/mfglive.lg"
24013/1:        close(2)                                        = 0
24013/1:        open(0xEFFFF920, 0)                             = 2
24013/1:             0xEFFFF920: "/qaddb/eblive/mfglive.lg"
24013/1:        lseek(3, 342954, 0)                             = 342954
24013/1:        read(3, 0xEFFFF570, 81)                         = 81
24013/1:           % L P R O G R E S S   V e r s i o n   % s   o n   % s .   ( 4 2
24013/1:           3 4 )\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0
24013/1:          \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
24013/1:        time()                                          = 1252542478
24013/1:        write(9, 0xEFFFF05C, 61)                        = 61
24013/1:           1 0 : 2 7 : 5 8   B R O K E R     0 :   P R O G R E S S   V e r
24013/1:           s i o n   9 . 1 C   o n   S O L A R I S .   ( 4 2 3 4 )\n
24013/1:        fstat64(0, 0xEFFFEF60)                          = 0
24013/1:            d=0x01540002 i=68332 m=0100644 l=1  u=0     g=1     sz=97192 88
24013/1:                at = Sep 10 03:01:28 EST 2009  [ 1252515688 ]
24013/1:                mt = Sep 10 10:27:58 EST 2009  [ 1252542478 ]
24013/1:                ct = Sep 10 10:27:58 EST 2009  [ 1252542478 ]
24013/1:            bsz=8192  blks=19008 fs=ufs
24013/1:        fstat64(1, 0xEFFFEF60)                          = 0
24013/1:            d=0x01540002 i=68332 m=0100644 l=1  u=0     g=1     sz=97192 88
24013/1:                at = Sep 10 03:01:28 EST 2009  [ 1252515688 ]
24013/1:                mt = Sep 10 10:27:58 EST 2009  [ 1252542478 ]
24013/1:                ct = Sep 10 10:27:58 EST 2009  [ 1252542478 ]
24013/1:            bsz=8192  blks=19008 fs=ufs
24013/1:        fstat64(2, 0xEFFFEF60)                          = 0
24013/1:            d=0x01540002 i=68332 m=0100644 l=1  u=0     g=1     sz=97192 88
24013/1:                at = Sep 10 03:01:28 EST 2009  [ 1252515688 ]
24013/1:                mt = Sep 10 10:27:58 EST 2009  [ 1252542478 ]
24013/1:                ct = Sep 10 10:27:58 EST 2009  [ 1252542478 ]
24013/1:            bsz=8192  blks=19008 fs=ufs
24013/1:        write(1, 0xEFFFF05C, 61)                        Err#9 EBADF
24013/1:           1 0 : 2 7 : 5 8   B R O K E R     0 :   P R O G R E S S   V e r
24013/1:           s i o n   9 . 1 C   o n   S O L A R I S .   ( 4 2 3 4 )\n
24013/1:        lseek(3, 346761, 0)                             = 346761
24013/1:        read(3, 0xEFFFF570, 81)                         = 81
24013/1:           % L S e r v e r   s t a r t e d   b y   % s   o n   % s .   ( 4
24013/1:           2 8 1 )\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0
24013/1:          \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
24013/1:        time()                                          = 1252542478
24013/1:        write(9, 0xEFFFF05C, 65)                        = 65
24013/1:           1 0 : 2 7 : 5 8   B R O K E R     0 :   S e r v e r   s t a r t
24013/1:           e d   b y   r o o t   o n   / d e v / p t s / 5 .   ( 4 2 8 1)
24013/1:          \n
</pre>
<h4>Appendix 3 — The non-working server</h4>
<pre LANGUAGE="text">
21268/1:        setsockopt(76, 65535, 4, 0xFFBFF9AC, 4, 1)      = 0
21268/1:        setsockopt(76, 65535, 8, 0xFFBFF9AC, 4, 1)      = 0
21268/1:        bind(76, 0x0015DCA8, 16, 3)                     = 0
21268/1:                AF_INET  name = 0.0.0.0  port = 3500
21268/1:        listen(76, 10, 1)                               = 0
21268/1:        getpid()                                        = 21268 [21267]
21268/1:        lseek(3, 457164, 0)                             = 457164
21268/1:        read(3, 0xFFBFF81C, 81)                         = 81
21268/1:           % L S t a r t e d   f o r   % s   u s i n g   % s ,   p i d   %
21268/1:           l .   ( 5 6 4 4 )\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
21268/1:          \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
21268/1:        time()                                          = 1252542489
21268/1:        write(9, 0xFFBFF304, 69)                        = 69
21268/1:           1 0 : 2 8 : 0 9   B R O K E R     0 :   S t a r t e d   f o r
21268/1:           m f g l i v e   u s i n g   T C P ,   p i d   2 1 2 6 8 .   ( 5
21268/1:           6 4 4 )\n
21268/1:        fstat64(0, 0xFFBFF208)                          = 0
21268/1:            d=0x05980009 i=4426329 m=0020620 l=1  u=0     g=7     rdev=0x00600011
21268/1:                at = Sep 10 10:27:57 EST 2009  [ 1252542477 ]
21268/1:                mt = Sep 10 10:28:09 EST 2009  [ 1252542489 ]
21268/1:                ct = Sep 10 09:44:02 EST 2009  [ 1252539842 ]
21268/1:            bsz=8192  blks=0     fs=lofs
21268/1:        fstat64(1, 0xFFBFF208)                          = 0
21268/1:            d=0x05980009 i=4426329 m=0020620 l=1  u=0     g=7     rdev=0x00600011
21268/1:                at = Sep 10 10:27:57 EST 2009  [ 1252542477 ]
21268/1:                mt = Sep 10 10:28:09 EST 2009  [ 1252542489 ]
21268/1:                ct = Sep 10 09:44:02 EST 2009  [ 1252539842 ]
21268/1:            bsz=8192  blks=0     fs=lofs
21268/1:        fstat64(2, 0xFFBFF208)                          = 0
21268/1:            d=0x05980009 i=4426329 m=0020620 l=1  u=0     g=7     rdev=0x00600011
21268/1:                at = Sep 10 10:27:57 EST 2009  [ 1252542477 ]
21268/1:                mt = Sep 10 10:28:09 EST 2009  [ 1252542489 ]
21268/1:                ct = Sep 10 09:44:02 EST 2009  [ 1252539842 ]
21268/1:            bsz=8192  blks=0     fs=lofs
21268/1:        write(1, 0xFFBFF304, 69)                        = 69
21268/1:           1 0 : 2 8 : 0 9   B R O K E R     0 :   S t a r t e d   f o r
21268/1:           m f g l i v e   u s i n g   T C P ,   p i d   2 1 2 6 8 .   ( 5
21268/1:           6 4 4 )\n
21268/1:        pwrite64(7, 0xFFBFFAB8, 4, 0)                   = 4
21268/1:             0xFFBFFAB8: "\0\0\002"
21268/1:        close(7)                                        = 0
21268/1:        getpid()                                        = 21268 [21267]
21268/1:        kill(21267, 0x0000000F)                         = 0
21267/1:            Received signal #15, SIGTERM, in wait() [caught]
21267/1:              siginfo: SIG#0
21268/1:            Incurred fault #11, FLTPAGE  %pc = 0x000C3048  addr = 0x58900137234
21267/1:        wait()                                          Err#4 EINTR
21268/1:        alarm(1)                                        = 0
21267/1:        lwp_sigtimedwait(0xFFBFF570, 0xFFBFF498, 0x00000010) = 0
21267/1:                sigmask = 0 0 0 0
21267/1:              siginfo: SIG#0
21267/1:        lwp_sigtimedwait(0xFFBFF488, 0xFFBFF570, 0x00000010) = 0
21267/1:                sigmask = 0 0 0 0
21267/1:              siginfo: SIG#0
21267/1:        lwp_sigtimedwait(0xFFBFF484, 0xFFBFF2B8, 0x00000010) = 0
21267/1:                sigmask = 0x00004000 0 0 0
21267/1:              siginfo: SIG#16384
21267/1:        lwp_sigtimedwait(0xFFBFF2A8, 0xFFBFF330, 0x00000010) = 0
21267/1:                sigmask = 0x00004000 0 0 0
21267/1:              siginfo: SIG#16384
21267/1:        sigprocmask(3, 0xFFBFF330, 0x00000000)          = 0
21267/1:                 set = 0x00004000 0 0 0
21267/1:            Incurred fault #11, FLTPAGE  %pc = 0x0004593C  addr = 0x589001310F4
21267/1:            Incurred fault #11, FLTPAGE  %pc = 0x000459A8  addr = 0x58900153AEC
21267/1:        _exit(0)
21268/1:            Received signal #14, SIGALRM, in pause() [caught]
21268/1:              siginfo: SIG#0
21268/1:        pause()                                         Err#4 EINTR
21268/1:        lwp_sigtimedwait(0xFFBFF698, 0xFFBFF5C0, 0x00000010) = 0
21268/1:                sigmask = 0 0 0 0
21268/1:              siginfo: SIG#0
21268/1:        lwp_sigtimedwait(0xFFBFF5B0, 0xFFBFF698, 0x00000010) = 0
21268/1:                sigmask = 0 0 0 0
21268/1:              siginfo: SIG#0
21268/1:        lwp_sigtimedwait(0xFFBFF5AC, 0xFFBFF3E0, 0x00000010) = 0
21268/1:                sigmask = 0x00002000 0 0 0
21268/1:              siginfo: SIG#8192
21268/1:        lwp_sigtimedwait(0xFFBFF3D0, 0xFFBFF458, 0x00000010) = 0
21268/1:                sigmask = 0x00002000 0 0 0
21268/1:              siginfo: SIG#8192
21268/1:        sigprocmask(3, 0xFFBFF458, 0x00000000)          = 0
21268/1:                 set = 0x00002000 0 0 0
21268/1:        lwp_sigtimedwait(0xFF1D7C18, 0xFFBFF1B0, 0x00000010) = 0
21268/1:                sigmask = 0xFFBFFEFF 0x00001FFF 0 0
21268/1:              siginfo: SIG#-4194561
21268/1:        lwp_sigtimedwait(0xFFBFF1A0, 0xFFBFF228, 0x00000010) = 0
21268/1:                sigmask = 0xFFBFFEFF 0x0000FF1F 0 0
21268/1:              siginfo: SIG#-4194561
21268/1:        sigprocmask(3, 0xFFBFF228, 0xFFBFF238)          = 0
21268/1:                 set = 0xFFBFFEFF 0x0000FF1F 0 0
21268/1:                oset = 0x00002000 0 0 0
21268/1:        lwp_sigtimedwait(0xFFBFF238, 0xFFBFF1B0, 0x00000010) = 0
21268/1:                sigmask = 0x00002000 0 0 0
21268/1:              siginfo: SIG#8192
21268/1:        lwp_sigtimedwait(0xFFBFF1A0, 0xFFBFF360, 0x00000010) = 0
21268/1:                sigmask = 0x00002000 0 0 0
21268/1:              siginfo: SIG#8192
21268/1:        lwp_park(1, 1, 1)                               = 0
21268/1:        lwp_sigtimedwait(0xFFBFF370, 0xFFBFF088, 0x000001C0) = 0
21268/1:                sigmask = 0x0000082F 0 0 0
21268/1:              siginfo: SIG#2095
21268/1:        lwp_sigtimedwait(0xFFBFF090, 0xFFBFEFF8, 0x00000010) = 0
21268/1:                sigmask = 0 0 0 0
21268/1:              siginfo: SIG#0
21268/1:        lwp_sigtimedwait(0xFFBFEFE8, 0xFFBFF090, 0x00000010) = 0
21268/1:                sigmask = 0 0 0 0
21268/1:              siginfo: SIG#0
21268/1:        context(1, 0xFFBFF088)
21268/1:        getpid()                                        = 21268 [1417]
21268/1:        kill(1417, 0x0000000F)                          = 0
21268/1:        alarm(1)                                        = 0
21268/1:            Received signal #14, SIGALRM, in pause() [caught]
21268/1:              siginfo: SIG#0
21268/1:        pause()                                         Err#4 EINTR
</pre>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/577" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/577/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Java Web Console</title>
		<link>http://onut.net/blog/archives/61#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/61#comments</comments>
		<pubDate>Thu, 09 Jul 2009 10:22:31 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Sun Microsystems]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/61</guid>
		<description><![CDATA[This is a little rant from several angles.

Sun's Java Web Console is a nice little toy. Great for those people who prefer the less extreme learning curve of a CLI, and great for manager types who like pictures.

I've used it several times before, but thought I'd try it in on x86 Solaris10u6 box I have here. Bloody Sun. You think a <strong>released version</strong> implies that it's stable, and working.

No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is a little rant from several angles.</p>
<p>Sun’s Java Web Console is a nice little toy. Great for those people who prefer the less extreme learning curve of a CLI, and great for manager types who like pictures.</p>
<p>I’ve used it several times before, but thought I’d try it in on x86 Solaris10u6 box I have here. Bloody Sun. You think a <strong>released version</strong> implies that it’s stable, and working.<br />
<span id="more-61"></span><br />
For me the issue was that when I originally installed the server, I used a temporary hostname, and DHCP for network because I couldn’t be bothered to change my local DNS and figure out a spare IP. I then changed to fixed IP and hostname later.</p>
<p>The ramifications of this is that my hostname ended up being assigned to localhost, (aka 127.0.0.1). This means that when the WebConsole was initially installed and configured it used 127.0.0.1 throughout it’s hardcoded, (stupid Tomcat — hate it with a vengence), config files.</p>
<p>This is something that annoys the heck out of me: I understand developers making ‘packages’ that they can ‘deploy’ to a web server, (Tomcat). It’s nice to be able to ‘deploy’ a package. But for heck’s sake, why shove hostname/IP/port definitions in not just one file, but 50 stupid files that are zipped up along with shared libs and binaries? Why? Haven’t they heard of /etc/hosts, or even putting these definitions into somewhere common? Why do they have to have these definitions in multiple places?</p>
<p>Another great example of letting the developer take the lead in systems management.</p>
<p>Anyway, digging around the net trying to resolve my issue showed up a lot of similar complaints, but nothing really to sort it out. ‘wcadmin’  refused to start the ‘deployed’ packages, because they couldn’t connect to the Tomcat server running on my old hostname.</p>
<pre>root@somewhere % wcadmin list

Deployed web applications (application name, context name, status):

console  ROOT            [stopped]
console  com_sun_web_ui  [stopped]
console  console         [stopped]
console  manager         [stopped]
console  zfs             [stopped]

Registered jar files (application name, identifier, path):

console  audit_jar     /usr/lib/audit/Audit.jar
console  console_jars  /usr/share/webconsole/lib/*.jar
console  jato_jar      /usr/share/lib/jato/jato.jar
console  javahelp_jar  /usr/jdk/packages/javax.help-2.0/lib/*.jar
console  shared_jars   /usr/share/webconsole/private/container/shared/lib/*.jar

Registered login modules (application name, service name, identifier):

console  ConsoleLogin  userlogin
console  ConsoleLogin  rolelogin

Persistent Jvm options:

-server
-Xmx128m
-XX:+UseParallelGC
-XX:ParallelGCThreads=4</pre>
<p>I tried using wcadmin ro ‘undeploy’ and ‘deploy’ packages, and even the brut force method of</p>
<pre class="code">root@somewhere % find /var/webconsole /usr/share/webconsole /etc/webconsole /usr/lib/webconsole -type f | xargs egrep -l '127.0.0.1|localhost'</pre>
<p>and manually modifying any config files found.</p>
<p>In the end I did a pkgrm/remove configs/pkgadd cycle:</p>
<p>1. Remove WebConsole packages.</p>
<pre>system      SUNWasac  Sun Java System Application Server Admin Client
application SUNWmcon  Sun Java(TM) Web Console 3.0.2 (Core)
system      SUNWmconr Sun Java(TM) Web Console 3.0.2 (Root)
application SUNWmcos  Implementation of Sun Java(TM) Web Console (3.0.2) services
application SUNWmcosx Implementation of Sun Java(TM) Web Console (3.0.2) services
application SUNWmctag Sun Java(TM) Web Console 3.0.2 (Tags &amp; Components)
application SUNWzfsgr ZFS Administration for Sun Java(TM) Web Console (Root)
application SUNWzfsgu ZFS Administration for Sun Java(TM) Web Console (usr)</pre>
<p>The usual removal:</p>
<pre>root@somewhere % pkgrm SUNWzfsgu SUNWmcosx SUNWmcos SUNWasac SUNWmcon SUNWzfsgr SUNWmconr SUNWmctag</pre>
<p>Then remove all the config files:</p>
<pre class="code">root@somwehere % rm -rf /var/webconsole /usr/share/webconsole /etc/webconsole /usr/lib/webconsole</pre>
<p>Or tarball up and then remove:</p>
<pre>root@somewhere % tar cvf /tmp/webconsole.tar /var/webconsole /usr/share/webconsole /etc/webconsole /usr/lib/webconsole
root@somewhere % rm -rf /var/webconsole /usr/share/webconsole /etc/webconsole /usr/lib/webconsole</pre>
<p>2. Re-install the WebConsole packages:<br />
If you have your original install DVD/CD handy, then just chuck it in, and install the packages from the Product directory:</p>
<pre>root@somewhere % pkgadd -d /cdrom/cdrom0/s2/Solaris_10/Product SUNWzfsgu SUNWmcosx SUNWmcos SUNWasac SUNWmcon SUNWzfsgr SUNWmconr SUNWmctag
The following packages are available:
 1  SUNWasac      Sun Java System Application Server Admin Client
 (i386) 8.2,REV=2006.08.16.08.46
 2  SUNWmcon      Sun Java(TM) Web Console 3.0.2 (Core)
 (i386) 3.0.2,REV=2006.12.08.20.48
 3  SUNWmconr     Sun Java(TM) Web Console 3.0.2 (Root)
 (i386) 3.0.2,REV=2006.12.08.23.39
 4  SUNWmcos      Implementation of Sun Java(TM) Web Console (3.0.2) services
 (i386) 3.0.2,REV=2006.12.08.23.39
 5  SUNWmcosx     Implementation of Sun Java(TM) Web Console (3.0.2) services
 (i386) 3.0.2,REV=2006.12.08.23.39
 6  SUNWmctag     Sun Java(TM) Web Console 3.0.2 (Tags &amp; Components)
 (i386) 3.0.2,REV=2006.12.08.20.48
 7  SUNWzfsgr     ZFS Administration for Sun Java(TM) Web Console (Root)
 (i386) 1.0,REV=2006.10.24.20.44
 8  SUNWzfsgu     ZFS Administration for Sun Java(TM) Web Console (usr)
 (i386) 1.0,REV=2006.10.24.20.44</pre>
<p>Even though you are installing version 3.1 of the Java Web Console, it actually appears as 3.0.2 for some stupid reason.</p>
<p>Everything will startup as expected using the new hostname defined.</p>
<pre>root@somewhere % wcadmin list

Deployed web applications (application name, context name, status):

console  ROOT            [running]
console  com_sun_web_ui  [running]
console  console         [running]
console  manager         [running]
console  zfs             [running]

Registered jar files (application name, identifier, path):

console  audit_jar     /usr/lib/audit/Audit.jar
console  console_jars  /usr/share/webconsole/lib/*.jar
console  jato_jar      /usr/share/lib/jato/jato.jar
console  javahelp_jar  /usr/jdk/packages/javax.help-2.0/lib/*.jar
console  shared_jars   /usr/share/webconsole/private/container/shared/lib/*.jar

Registered login modules (application name, service name, identifier):

console  ConsoleLogin  userlogin
console  ConsoleLogin  rolelogin

Persistent Jvm options:

-server
-Xmx128m
-XX:+UseParallelGC
-XX:ParallelGCThreads=4</pre>
<p></p>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/61" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rant — Solaris vs Linux Part I</title>
		<link>http://onut.net/blog/archives/59#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/59#comments</comments>
		<pubDate>Thu, 13 Nov 2008 13:37:42 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sun Microsystems]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/59</guid>
		<description><![CDATA[A rant about the state of play with Sun, and what I’d like to see Sun do to improve Solaris. I was midly amused when Sun made claims some time back that Solaris is a better Linux than Linux itself. I’ve been a Linux user since the early 0.9 kernel days, and nothing beats it. [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>A rant about the state of play with Sun, and what I’d like to see Sun do to improve Solaris.<br />
<span id="more-59"></span><br />
I was midly amused when Sun made claims some time back that Solaris is a better Linux than Linux itself. I’ve been a Linux user since the early 0.9 kernel days, and nothing beats it. Sure there are issues that crop up from time to time, but overall. It’s a pretty pleasant experience. I must admit I was a little offended by that Sun comment.<br />
<br />
I have been an admin of Solaris and HP systems for many years, both commercial versions of UNIX have goodness and badness to them.<br />
<br />
But, then along came ZFS. I usually balk at companies’ gargantuan claims of their products meeting all requirements, providing easy administration, seamless integration, and making sure your cat is out for the night. But I suspect that Sun’s ZFS may be just that… It’s fantastic. No longer having to worry about slices, disks with different geometries, having to fsck disks after a crash, waiting 3 hours for a 500G FS to be created, then having to redo it all again ’cause you got the sizes slightly wrong.<br />
<br />
It is/was Sun’s saviour, (along with dtrace, zones, and performance)… couldn’t have come at a better time.<br />
<br />
But, now, finally we have <a href="http://www.sun.com/aboutsun/pr/2008-10/sunflash.20081031.1.xml" target="_self">ZFS booting</a> . Woohoo! We can BOOT ZFS now. No more UFS. Damn fantastic that is.<br />
<br />
This is just one more nail in Linux’s coffin, (unfortunately), for me. These days, on the server side, I run Solaris exclusively, the desktop side still Linux, but I’d switch like I change my light bulbs if only Sun would address the very last… nagging.….horrible… frustrating aspect of Solaris, (OK, there’s more, but this is one that has frustrated me for YEARS).<br />
<br />
Sun’s package management<br />
<br />
It’s a HORRIBLE hack. I detest it with a vengeance. IMO the best package management system is HPUX’s Software Distributor. A close second is Debian’s apt-get/dpkg. You can install via network, tape, disk, CD. You can install and rollback. You can checksum verify package contents. You can see what it actually installs, and what it has installed. You can do a dry-run. Has all the pre/post script execution goodness.<br />
<br />
If only Sun came out with something similar. Maybe even a combination of apt-get, (or yum), and SDUX. That’d be gold. I really expect this to happen. If Sun is heading down the command/admin simplification path. I look forward to being able to type:</p>
<pre>
% pkg install gnome
</pre>
<p>Or</p>
<pre>
% pkg remove hugin
</pre>
<p>Or</p>
<pre>
% pkg verify firefox
</pre>
<p>Or</p>
<pre>
% pkg list
</pre>
<p>I mean.… Why not Sun?<br />
<br />
(And what about my cat?)</p>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/59" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/59/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO — Opera Mini + Linux</title>
		<link>http://onut.net/blog/archives/58#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/58#comments</comments>
		<pubDate>Thu, 11 Sep 2008 02:45:25 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobiles]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/58</guid>
		<description><![CDATA[I’ve been a user of Opera Mini for a long time. On my mobile it’s great. However, there’s times when I need to view the web in a bigger than 240x320 format. I spend a fair amount of time on the train, and I have a laptop with bluetooth, and a phone with GPRS and [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I’ve been a user of <a href="http://www.operamini.com/" target="_self">Opera Mini</a>  for a long time. On my mobile it’s great. However, there’s times when I need to view the web in a bigger than 240x320 format. I spend a fair amount of time on the train, and I have a laptop with bluetooth, and a phone with GPRS and bluetooth.… but GPRS is slow and running firefox over it is a pain… even with images turned off.</p>
<p>So, this howto shows you how to run Opera Mini on Linux in glorious 1440x900.… and take advantage of the speed increase.<br />
<span id="more-58"></span></p>
<h4>Requirements</h4>
<p>The Linux distribution I run is Debian, but this HOWTO will apply to any distribution really. In fact it should work on Windows as well. All you need initially is a running version of Java. However the complete list is:<br />
<a href="http://www.java.com/en/download/index.jsp" target="_self">Java 6</a><br />
<a href="http://www.microemu.org/" target="_self">Micro Emulator</a><br />
<a href="http://www.operamini.com/" target="_self">Opera Mini</a></p>
<h4>Installing Java</h4>
<p>On Debian I just do the usual installation process:</p>
<pre>root@localhost % apt-get install sun-java6-bin sun-java6-jre</pre>
<p>That’s it for java.</p>
<h4>Installing MicroEmulator</h4>
<p>Now for MicroEmulator. Fetch whatever the <a href="http://sourceforge.net/project/showfiles.php?group_id=30014" target="_self">latest release is</a> . I used 2.0.2 for this setup.</p>
<p>Extract the tarball to somewhere. Doesn’t matter where. I put it under $HOME/lib</p>
<pre>mick@localhost [~/lib] # tar zxvf microemulator-2.0.2.tar.gz</pre>
<p>I put in a symlink so that I can reference different version if need be. But you can skip this step if you want.</p>
<pre>mick@localhost [~/lib] # ln -s microemulator-2.0.2 microemulator</pre>
<p>Now, fire up java and point it to the microemulator jar file.</p>
<pre>mick@localhost [~/lib] # java -jar $HOME/lib/microemulator/microemulator.jar</pre>
<p>This window will now pop-up.<br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-1.png" /></p>
<p>Now Click on ‘Options’, and then ‘Select device’. There’s nothing stopping you from running Opera in this virtual device. But remember you want to run it in a big window, right!<br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-2.png" /></p>
<p>The window below will pop-up.<br />
<img src="/media/howto-operamini/Screenshot-Select_device-1.png" /></p>
<p>Click on Add… You want to traverse to your {directory where you installed the microemulator}/devices/, and select the microemu-device-resizable.jar file.<br />
<img src="/media/howto-operamini/Screenshot-Open.png" /></p>
<p>It will now appear in your virtual devices list. Click on ‘Set as default’ to use it every time you start it up.<br />
<img src="/media/howto-operamini/Screenshot-Select_device-2.png" /><br />
<img src="/media/howto-operamini/Screenshot-Select_device-3.png" /></p>
<p>The MicroEmulator window will change to a ‘not as snazzy’ window like this:<br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-2b.png" /></p>
<p>That’s it for the microemulator.</p>
<h4>Installing Opera Mini</h4>
<p>Installing Opera Mini is easy too. There’s two ways to do it.<br />
Click <a href="http://mini.opera.com/download-4/opera-mini-latest-advanced-int.jad" target="_self" class="broken_link">here</a> , and <a href="http://mini.opera.com/download-4/opera-mini-latest-advanced-int.jar" target="_self" class="broken_link">here</a>  and save somewhere.</p>
<p>Or follow these instructions, (I’ve put them here, because, as you know, links change on the internet, and I hate 404s).</p>
<p>Just fetch the <a href="http://www.operamini.com/download/" target="_self">latest version</a>  from Opera. There’s 4 steps to download:<br />
1. Select ‘Download to PC’.<br />
2. Select ‘Generic version’.<br />
3. Select ‘Advanced MIDP 2′<br />
4. Select you preferred language, and download the JAD and JAR files.</p>
<p>I placed these two files under $HOME/lib/opera. You will have to create a symlink so that the version you have downloaded will be used properly.</p>
<pre>mick@localhost [~/lib/opera] # ln -s opera-mini-latest-advanced-int.jar opera-mini-4.1.11355-advanced-int.jar</pre>
<p>Your version may/will vary. You’ll need to symlink, (or rename), the file for it to work, though.</p>
<p>Now you want to open the Opera Mini JAD file you just downloaded.<br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-3.png" /></p>
<p>Find it and open it.<br />
<img src="/media/howto-operamini/Screenshot-Open_JAD_File.png" /></p>
<p>Now you will see it in the list of applications that can be launched by Micro Emulator.<br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-4.png" /></p>
<p>Now just double click on it.<br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-5.png" /></p>
<p>Hooley Dooley Batman! It works! Cool!<br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-6.png" /><br />
<img src="/media/howto-operamini/Screenshot-MicroEmulator-last.png" /></p>
<p>
Either use your mouse and click, or you can use up/down/left/right keys and enter to traverse web pages.
</p>
<h4>One last thing</h4>
<p>I created the following script to make it easier for me to startup, and called it ‘operamini’.</p>
<pre>
#!/bin/bash

exec >&#038; /tmp/operamini.log

java -jar $HOME/lib/microemulator/microemulator.jar $HOME/lib/opera/opera-mini-latest-advanced-int.jad
</pre>
<p>Now I have my super fast GPRS internet connection. Also, a side benefit is that all my bookmarks are synced up to my phone.</p>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/58" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/58/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solaris jumpstart common problems</title>
		<link>http://onut.net/blog/archives/43#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/43#comments</comments>
		<pubDate>Wed, 24 Oct 2007 05:11:35 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Sun Microsystems]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/43</guid>
		<description><![CDATA[I’ve been playing around with Solaris jumpstart recently. I haven’t used it since the early days. It seems that a lot of the old problems still exist. So, I’ve listed most of the common problems and their solution here. This also covers Sun’s JET, (Jumpstart Enterprise Toolkit). This is a Work In Progress — so [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I’ve been playing around with Solaris jumpstart recently. I haven’t used it since the early days. It seems that a lot of the old problems still exist. So, I’ve listed most of the common problems and their solution here. This also covers Sun’s JET, (Jumpstart Enterprise Toolkit).<br />
This is a Work In Progress — so I’ll be updating this from time time as I come across issues.<br />
<span id="more-43"></span></p>
<h4>The ‘ERROR: (_app_set_slice) Disk is not selected’ error message.</h4>
<p>So, you’re trying to setup some DiskSuite metadevices during the jumpstart installation. You are getting this error because you don’t have the slices properly defined in your JET template. You will need to have something similar to the following defined in your JET template file, (under /opt/SUNWjet/Templates):</p>
<pre>
base_config_profile_root=512
base_config_profile_swap=16384
base_config_profile_s3_mtpt="/usr"
base_config_profile_s3_size="8192"
base_config_profile_s4_mtpt="/opt"
base_config_profile_s4_size="2048"
base_config_profile_s5_mtpt="/var"
base_config_profile_s5_size="2048"
base_config_profile_s6_mtpt=""
base_config_profile_s6_size=""

base_config_profile_disk_c0t1d0s0_mtpt="free"
base_config_profile_disk_c0t1d0s0_size="512"
base_config_profile_disk_c0t1d0s1_mtpt="free"
base_config_profile_disk_c0t1d0s2_size="8192"
base_config_profile_disk_c0t1d0s3_mtpt="free"
base_config_profile_disk_c0t1d0s3_size="8192"
base_config_profile_disk_c0t1d0s4_mtpt="free"
base_config_profile_disk_c0t1d0s4_size="2048"
base_config_profile_disk_c0t1d0s5_mtpt="free"
base_config_profile_disk_c0t1d0s5_size="2048"
base_config_profile_disk_c0t1d0s6_mtpt=""
base_config_profile_disk_c0t1d0s6_size=""
sds_root_mirror="c0t1d0"
sds_database_locations="c0t0d0s7:3 c0t1d0s7:3"
sds_database_partition="c0t0d0s7:64 c0t1d0s7:64"
sds_device_numbers="/:d100:d0:d10 swap:d101:d1:d11 /usr:d103:d3:d13 /opt:d104:d4:d14 /var:d105:d5:d15"
</pre>
<p>I had this error when I hadn’t specified the *_mtpt and set it to’free’, I had just left it blank.</p>
<h4>Jumpstart directory not found</h4>
<p>I had the following issue and it took me a while to figure it out.</p>
<pre>Searching for JumpStart directory...
not found
Warning: Could not find matching rule in rules.ok
Press the return key for an interactive Solaris install program...
</pre>
<p>In the end I started to debug the ‘install-solaris’, and ‘profind’ scripts line by line. It turns out that I had defined my hosts with FQDN in my /etc/hosts file. When the server starts to look for the jumpstart directory it’ll use the /usr/sbin/install.d/profind s<br />
cript to determine this. Contained within that is the line:</p>
<pre> set -- `/sbin/bpgetfile -retries 1 install_config`</pre>
<p>Because I was using the standard RARP method of booting, bpgetfile was called to determine where to nfs mount the jumpstart directory. bootparams didn’t return any information from the boot server, because it was asking for ‘hostname’, rather than ‘hostname.domain.name’. So, if you get this issue. run the command
<pre>/sbin/bpgetfile -retries 1 install_config</pre>
<p> from your install shell.</p>
<p>If you get nothing, then this is your issue. You will need to ensure you define your hosts not with a FQDN.</p>
<p>Actually, in my travels on this issue. Most of the resolutions to ‘no matching rule found in rules.ok’ issues had to do with accessing the jumpstart server from the client. So, check all your network settings, (netmasks, routes, etc). If not, then the above resolution will be it. On my clients, this was all OK, so it was baffling for a while.</p>
<p>Also, make sure that you have the matching swap and root partitions set correctly:</p>
<pre>base_config_profile_root=512
base_config_profile_disk_c0t1d0s0_mtpt="free"
base_config_profile_disk_c0t1d0s0_size="512"
base_config_profile_swap=8192
base_config_profile_disk_c0t1d0s1_mtpt="free"
base_config_profile_disk_c0t1d0s1_size="8192"
</pre>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/43" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/43/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO — Running familiar Linux from CF/SD/MMC</title>
		<link>http://onut.net/blog/archives/42#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/42#comments</comments>
		<pubDate>Thu, 20 Sep 2007 02:51:38 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobiles]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/42</guid>
		<description><![CDATA[This howto covers one way of running familiar Linux from your CF, SD, or MMC card. OK, it doesn’t actually boot from SD, but uses a snazzy Linux trick called pivot_root. Which switches over one root with another. This, IMHO, is probably the best way of doing it apart from actually directly booting from SD. [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>This howto covers one way of running familiar Linux from your CF, SD, or MMC card.</p>
<p>OK, it doesn’t actually boot from SD, but uses a snazzy Linux trick called pivot_root. Which switches over one root with another. This, IMHO, is probably the best way of doing it apart from actually directly booting from SD. Although, I’ve only tried this on a 38xx based iPAQ it should work for all handhelds based on familiar. Heck, it should work for anything really.</p>
<p><span id="more-42"></span></p>
<h3>Preface</h3>
<p>The general idea is to boot up Linux from the internal flash of the iPAQ to just before it runs the environment. Check the SD slot for a loopfs file, if one is there, then mount it up, switch roots, and continue to boot. </p>
<h3>Why?</h3>
<p>There’s several benefits to doing it this way:</p>
<ol>
<li>Backups — Since you have a copy of the root filesystem on SD, you can back it up very easily. Every PC these days has a SD slot. Just whack it in and copy the file across, you don’t even need Linux to do it either.</li>
<li>Choices — You can startup either environment GPE or OPIE, just by changing SD cards. (Further updates to setMMCroot will allow selecting environment by buttons.</li>
<li>Saving files — regardless of what environment you run, you can still save the files directly to the SD card. If you need them elsewhere, turn off the iPAQ, pop the SD card out and chuck it into a PC and read them. Easy!</li>
<li>Dead SD — If your SD card dies, you can still run with a basic environment that is already loaded up on your iPAQ. With other methods, if your SD dies that’s it. Things start going wierdo. </li>
</ol>
<h3>Pre-requisites</h3>
<p>You’re going to need several things to do this:</p>
<ol>
<li>Linux based PC, any dist will do.</li>
<li>An iPAQ — with familiar Linux already loaded up on to it, (doesn’t matter what environment). </li>
<li>A copy of <a href="http://familiar.handhelds.org/">familiar Linux</a> , with either the <a href="http://gpe.handhelds.org/">GPE</a>  or <a href="http://opie.handhelds.org/">OPIE</a>  will do. I used version 0.8.4 for this HOWTO. You will need the <a href="http://familiar.handhelds.org/releases/v0.8.4/install/files/" class="broken_link">tarballs from here</a>  and not the jffs files, (IE either of the *.rootfs.tar.bz2 files). </li>
<li>Any SD, MMC, or CF card formatted with FAT16, (if you just bought it you don’t need to do anything as all flash cards are formatted these days).</li>
</ol>
<h3>Step 1 — Create root filesystem.</h3>
<p>First we’ll need to create the filesystem that gets mounted up I’m creating a 1G filesystem, because I tend to load up a lot of applications onto my iPAQs. Since I also have a 2G SD card, I will be able to store both the GPE and OPIE environments on it.</p>
<pre>dd if=/dev/zero of=loopfs-gpe bs=1024 count=991680</pre>
<p>Note the size is just under 1G? This is because a 1G filesystem on an SD card will consume slightly more than 1G. So, I’ve allowed for that. I can fit two filesystems on that card this way. Adjust the “count” to whatever size you want or care for.</p>
<p>Now, you’ll need to setup the filesystem.</p>
<pre>mkfs.ext2 loopfs-gpe</pre>
<p>This will create a Linux ext2 filesystem. You can really use any filesystem, but you <strong>don’t</strong> want to use a journelling filesystem like ext3, reiserfs, xfs, as flash memory can’t stand too many writes to it. Journelling filesystem tend to write a lot of data even when not being used, (from a flash point of view). </p>
<p>Mount up the filesystem on your Linux box, (requires root).</p>
<pre>
mkdir loopfs-gpe.mount
mount -o rw,loop loopfs-gpe loopfs-gpe.mount
</pre>
<p>Extract the environment tarball into the loopback mount point.</p>
<pre>
cd loopfs-gpe.mount
tar jxf ../gpe-image-v0.8.4-h3600.rootfs.tar.bz2
</pre>
<p>You will need to edit /etc/passwd and change the root password to something sensible if you want to login, the following entry will set the password to ‘root’.</p>
<pre>root:dquXGWQyEH.uI:0:0:root:/home/root:/bin/sh</pre>
<p>Unmount the loopfs filesystem.</p>
<pre>umount loopfs-gpe.mount</pre>
<p> You now have a brand spanking new filesystem that will be used on your iPAQ.</p>
<h3>Step 2 — Prepare your SD.</h3>
<p>There are a number of files that need to be created and copied over to your SD card. These are all required.</p>
<ul>
<li>Your root filesystem that you just created, ensure it is called either <strong>loopfs-opie</strong> or <strong>loopfs-gpe</strong>.</li>
<li>The <a href="/files/ipaq/setMMCroot#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">setMMCroot script</a> , which does all the work.</li>
<li>Create a file called <strong>loopfs.boot</strong> on the SD card with the full path of the loopfs file you created. For example: /media/card/loopfs-gpe, or /media/card/loopfs-opie, or /media/card/i.like/it.here </li>
</ul>
<p>Remove the SD card and plonk it into your iPAQ.</p>
<h3>Step 3 — Prepare your iPAQ.</h3>
<p>Fire up your favourite serial port communication program, (I use minicom), to connect to your iPAQ, which should be connected to your PC by now. If you can’t do this, or don’t want to, then you can run these commands from within a console on your iPAQ, (under the Applications tab). The preferred option is to run the ppp daemon from your Linux box and ‘ssh 20.0.0.1′ into your iPAQ, using the following command, (needs root on your PC):</p>
<pre>/usr/sbin/pppd /dev/ttyS0 230400 20.0.0.5:20.0.0.1 nodetach local noauth nocrtscts lock user ppp connect "/usr/sbin/chat -v -t3 ogin--ogin: ppp"</pre>
<p>Run the following commands in a shell on your iPAQ.</p>
<pre>
ln -s /etc/init.d/setMMCroot /etc/rc5.d/S01setMMCroot
ln -s /etc/init.d/setMMCroot etc/rc2.d/S01setMMCroot
cp /media/card/setMMCroot /etc/init.d/setMMCroot
</pre>
<p>I had suggested using the ppp daemon because then the next part becomes easy. You ned to install the extra packages on your iPAQ. e2fsprogs, e2fsprogs-e2fsck, kernel-module-loop-2.4, and kernel-module-ext2-2.4. Run this on your iPAQ, or use the package manager to do it.</p>
<pre>ipkg install e2fsprogs e2fsprogs-e2fsck kernel-module-loop-2.4 kernel-module-ext2-2.4</pre>
<p>Holy toledo batman! You’re almost there!</p>
<h3>Step 4 — Reboot your iPAQ.</h3>
<p>Reboot your iPAQ, via Start -&gt; Settings -&gt; Shutdown.</p>
<p>When you reboot you should see the following appear just underneath the Linux penguin logo.</p>
<pre>
#### 1. Checking MMC: #
Found MMC!
Using loopfs: /media/card/loopfs-gpe
#### 2. FSCK filesystem:
/media/card/loopfs-gpe has gone 48850 days without being checked, check forced.
/media/card/loopfs-gpe: 2817/124160 files (0.1% non-contiguous), 12110/247900 blocks
#### 3. Setting up loopback FS:
Using /lib/modules/2.4.19-rmk6-pxa1-hh42/kernel/drivers/block/loop.o
#### 4. Mounting:
#### 5. Ballet:
#### 6. Tidying up:
killall: Xfbdev: no process killed
#### 7. Handover:
</pre>
<p>The script will wait for 16 seconds for an SD card to be inserted, (a hash will appear every second), else it will just boot up straight from the internal flash. This allows you to just run with whatever is there already, if need be.</p>
<p>Depending on what environment you have running will change some of the messages between each stage. I’ll see if I can take a photo of the bootup stage and chuck it on here. (EDIT: I’ve put up some bloody horrible images of the iPAQ booting, taken with my mobile.)</p>
<h5>Boot loader screen.</h5>
<p><img src="/files/ipaq/booting.png" alt=" " /></p>
<h5>FSCKing the filesystem.</h5>
<p><img src="/files/ipaq/fsck.png" alt=" " /></p>
<h5>Ballet school</h5>
<p><img src="/files/ipaq/ballet.png" alt=" " /></p>
<p>From there onwards, it’s just the normal boot procedure.</p>
<h3>Step 5 — Final install.</h3>
<p>Because this is a ‘fresh’ install you will be asked all the questions you would have been asked when you did the initial install of familiar on your iPAQ. If you get to this stage you’ve done it! Congratulations!</p>
<p>Once you have gone through the final install procedure, if you open up a console session and type ‘df’ , you’ll see what the setMMCroot script does. /mnt/realroot points to your iPAQ flash filesystem, and / is the SD filesystem. Cool eh?!</p>
<pre>root@h3600:~# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/root 976056 387164 539308 42% /
tmpfs 31676 40 31636 0% /mnt/realroot/var
tmpfs 31676 0 31676 0% /mnt/realroot/media/ram
/dev/mmc/part1 1983360 991712 991648 50% /mnt/realroot/media/card
/dev/loop/0 976056 387164 539308 42% /
</pre>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/42" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/42/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nokia GPRS with Linux iPAQ</title>
		<link>http://onut.net/blog/archives/41#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/41#comments</comments>
		<pubDate>Mon, 17 Sep 2007 07:51:45 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobiles]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/41</guid>
		<description><![CDATA[If you have an iPAQ installed with familiar Linux and want it to connect to the net using your Nokia mobile via GPRS; then this is how you do it. Work In Progress, (sorry it’s a bit sparse and hurried, but it’ll give you the general idea). I haven’t used this method for a while, [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>If you have an iPAQ installed with familiar Linux and want it to connect to the net using your Nokia mobile  via GPRS; then this is how you do it.<br />
<span id="more-41"></span></p>
<p>Work In Progress, (sorry it’s a bit sparse and hurried, but it’ll give you the general idea).</p>
<p>I haven’t used this method for a while, but just started playing with my iPAQ again, somewhere between then and now it stopped working. Apparently Telstra have made some changes to their APNs. So I’ve updated this page to reflect the changes.</p>
<h3>1. Create/modify a couple of files.</h3>
<p>Note: Telstra have changed their APN, (Access Point Number), since I last tried this.</p>
<p><strong>File: /etc/ppp/peers/gprs</strong></p>
<pre>nodetach
defaultroute
nocrtscts
lock
noauth
# lcp-echo-interval 5
# lcp-echo-failure 3
usepeerdns
230400
local
asyncmap 0
connect /etc/ppp/peers/gprs.chat.connect
disconnect /etc/ppp/peers/gprs.chat.disconnect
</pre>
<p><strong>File: /etc/ppp/peers/gprs.connect</strong></p>
<pre>
#!/bin/sh
exec chat TIMEOUT 5 \
ECHO ON \
ABORT 'nBUSYr' \
ABORT 'nERRORr' \
ABORT 'nNO ANSWERr' \
ABORT 'nNO CARRIERr' \
ABORT 'nNO DIALTONEr' \
ABORT 'nRINGINGrnrnRINGINGr' \
'' \
rAT TIMEOUT 12 OK \
ATH OK \
'ATDT+cgdcont=2,"IP,"telstra.internet"\n' '' \
AT OK \
'ATDT*99#' TIMEOUT 22 CONNECT \
"" SAY " - Connected."
</pre>
<p><strong>File: /etc/ppp/peers/gprs.disconnect</strong></p>
<pre>
#!/bin/sh

exec /usr/sbin/chat -V -s -S \
ABORT "BUSY" \
ABORT "ERROR" \
ABORT "NO DIALTONE" \
"" "K" "" "K" "" "K" "" "+++ATH" "" "+++ATH" "" "+++ATH"
</pre>
<p><strong>File: /etc/bluetooth/givepin</strong></p>
<pre>
#!/bin/sh
echo 'PIN:2222'
</pre>
<p><strong>File: /etc/bluetooth/hcid.conf</strong></p>
<pre>
options {
        autoinit yes;
        security auto;
        pairing multi;
        pin_helper /etc/bluetooth/givepin
}

device {
        name "iPAQ";
        class 0x120112;
        lm accept;
        iscan enable;pscan enable;
        lp rswitch,hold,sniff,park;
        encrypt enable;
}
</pre>
<h3>2. Pair the phones together.</h3>
<p>Get the Nokia to scan for bluetooth devices, and use the PIN that you used in the givepin file to pair the iPAQ found to your Nokia.</p>
<h3>3. Create the GPRS connection.</h3>
<p>From your iPAQ you can access your phone and connect to GPRS using the following:</p>
<pre>dund --nodetach --encrypt --connect 42:42:42:42:42:42 --channel 3 call gprs</pre>
<p>Replace 42:42:42:42:42:42 with your mobile phone’s address. To find this you can use hcitool to scan for it.</p>
<pre>
root@nowhere % hcitool scan
Scanning ...
        00:42:A0:42:26:42  Nokia N70
        00:16:42:DC:42:B8 AUSYDN000649
        42:42:42:42:42:42  I'm right behind you
        00:15:42:DB:42:24  n/a
</pre>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/41" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/41/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO — Setting up a Linux vserver</title>
		<link>http://onut.net/blog/archives/20#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/20#comments</comments>
		<pubDate>Wed, 18 Oct 2006 18:00:00 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/20</guid>
		<description><![CDATA[I had an issue with my home network. The server that supplies DNS, web proxy, IMAP proxy, VLAN tunneling, LDAP authentication is an HP B2000. This is a good server, however, my electricity bill is now $AU500/quarter. Ouch. So I decided to use it sparingly and to chuck all these services onto a green-friendly PC [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I had an issue with my home network. The server that supplies DNS, web proxy, IMAP proxy, VLAN tunneling, LDAP authentication is an HP B2000. This is a good server, however, my electricity bill is now $AU500/quarter. Ouch. So I decided to use it sparingly and to chuck all these services onto a green-friendly PC that can power up/down HDD and CPU on demand. But, then I thought. Heck let’s do it properly — I’ll virtualize it, then I can shift the virtual server around without having to go through the arduous re-setting up and copying of files for my specific configuration.<br />
So, here’s a mini-HOWTO, (to complement the many on the web), on how to setup a vserver on Linux.<br />
<span id="more-20"></span></p>
<h4>Choices:</h4>
<p>To virtualize an instance of a Linux server you have many choices, so I won’t go into them in detail but roughly.  </p>
<ul>
<li>
<p ><a href="http://www.vmware.com/"><strong>VMWare:</strong></a><br />
The king of the virtual world on PCs.</p>
<p>- Provides a fairly fast HAL, (Hardware Abstraction Layer), for devices.</p>
<p>- Direct device access, and emulated devices, (USB, SCSI, IDE, etc, etc).</p>
<p>- Supports pretty much every O/S that you can run natively on a PC, but virtually.</p>
<p>- Snapshots, rollbacks — it does it  all.</p>
<p>- Downside — it costs a lot, and is a bit of overkill.</p>
</li>
<li>
<p><strong>Linux Vserver:</strong></p>
<p>- Only supports Linux — not an issue for me.</p>
<p>- No disk pre-allocation — uses native Linux filesystem.</p>
<p>- 32bit/64bit independence — because I have x86 and AMD64 machines running on the same network.</p>
<p>- Non-distribution specific — RedHat, Suse, Gentoo, etc — you can do it all.</p>
<p>- Security — all the specific 2.4.19 kernel security mods are present and so lends itself to true isolation.</p>
<p>- Resource sharing — No special daemons need to be running. It all shares local resources, (like Solaris zones).</p>
<p>- Fast — runs the same kernel as the base O/S, (like Solaris zones).</p>
</li>
<li>
<p><strong><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/">Xen</a>:</strong><br />
Very similar to VMWare, (but this one is GPLd). There’s a lot of noise about Xen at the moment. Sun, Novell, and HP are using Xen in their O/S. It’s fast becoming the choice VM to use. But for me — too  much overhead.</p>
<p>- Requires the O/S to be modified to support it, (although this isn’t the case now with 3.0).</p>
<p>- No support for APM, or ACPI — I need it!</p>
<p>- Very similar to VMWare.</p>
</li>
<li>
<p><strong><a href="http://user-mode-linux.sourceforge.net/">UML — User Mode Linux</a>:</strong><br />
This method actually runs a modified kernel as an application, and this acts as a ‘HAL’.</p>
<p>- It’s standalone — you can run any distro you want.</p>
<p>- Slower than vserver, as it runs another instance of a kernel, (and support programs).</p>
<p>- Can access a local filesystem, but the norm is to provide a disk file for booting.</p>
</li>
<li>
<p><strong><a href="http://plex86.sourceforge.net/">Plex86</a>:</strong><br />
<br />Similar   to vserver &amp; UML.</p>
<p>- Requires modification of the kernel, (similar to Xen).</p>
<p>- Very lightweight.</p>
</li>
<li>
<p><strong><a href="http://bochs.sourceforge.net/">BOCHS</a>:</strong><br />
<br />A fully fledged emulator. NOTE: The word emulator and NOT virtualizer. There’s a difference and it’s mainly with speed, but it runs almost anything, (like vmware). It’ll be slow on my PCs, and it’s too  bloaty. Not what I want.</p>
</li>
</ul>
<p>There are others, but I didn’t bother investigating those. I eventually settled on vserver. Why? Well, that’s easy.</p>
<ul>
<li>
<div align="left">
<p>It handles very much like Solaris zones — more familiar ground for me.</p>
</div>
</li>
<li>
<div align="left">
<p>It can be transported between PCs — just do an rsync of the /etc/vservers/funky.homenet &amp; /etc/vservers/.defaults/vdirbase/funky.homenet directories and  start up.</p>
</div>
</li>
<li>
<div align="left">
<p>I can choose my distro — I can run sid in a vserver if I want to.however, it has to be noted that vserver shares the kernel, (similar to Solaris zones), so it’s probably better to keep to the same distro and release. In my case I will be.</p>
</div>
</li>
<li>
<p align="left">The fastest method for virtualizing — it’s faster than plex86, and UML, and not as bloaty as Xen and VMWare.</p>
</li>
</ul>
<h4>Stage 1 — the kernel:</h4>
<p>I tend to avoid modifying my kernel as much as possible for several reasons, the most important being time — I just want to be able to do an ‘apt-get update &amp;&amp; apt-get upgrade’ for security patches. However, vserver requires a modification to the kernel. Oh well. The benefits of vserver outweigh my desire for consistancy.</p>
<p> UPDATE: With Etch, (October 2006), you can just pick your kernel. Etch now has many kernels to choose from ranging from 486, bigmem, vserver, xen, etc. Just choose one of them. </p>
<pre>   % apt-get install linux-image-2.6.17-2-vserver-686 util-vserver vtun</pre>
<p>If you want to pick up some pre-built kernel packages go <a href="http://matvey.org.ru/pub/debian">here.</a> You’ll find a stock 2.6.12 kernel with the latest vserver utils package. Just add the following to your /etc/apt/sources.list, update and install.</p>
<p>deb http://matvey.org.ru/pub/debian/ stable main</p>
<pre> % apt-get install kernel-image-2.6.12lvs util-vserver vtun</pre>
<h4>Stage 2 — create the vserver:</h4>
<p style="margin-bottom: 0in">Once you’ve rebooted your box with the vserver enabled kernel, you can start creating your vserver. This is all pretty trivial.</p>
<pre> % vserver funky.homenet build -n funky.homenet --hostname funky.homenet \
--interface eth0:10.0.0.1/8 -m debootstrap -- -d sarge -m http://software/debian/sarge/i386/ 
</pre>
<p>What this does is:</p>
<ul>
<li>
<p>Create a virtual server called funky.homenet</p>
</li>
<li>
<p>FQDN is funky.homenet.</p>
</li>
<li>
<p>IP is 10.0.0.1 using eth0.</p>
</li>
<li>
<p>Use sarge.</p>
</li>
<li>
<p>Use the server ‘software’ as the sarge mirror, (my own local         mirror).</p>
</li>
</ul>
<p>This will create a /etc/vservers/funky.homenet, and a  /etc/vservers/.defaults/vdirbase/funky.homenet directory the last directory will contain the complete root of the vserver. So if you want to put it elsewhere the easiest way is to repoint the symlink /etc/vservers/.defaults/vdirbase somewhere else.</p>
<h4>Stage 3 — start the vserver:</h4>
<p style="margin-bottom: 0in">Once it’s finished creating, (around 160Mbytes, and 8 minutes later — on my 330MHz box), you can start the server.</p>
<pre> % <strong>vserver funky.homenet start</strong> Starting system log daemon: syslogd. Starting kernel log daemon: klogd. Starting MTA: exim4. Starting internet superserver: inetd. Starting OpenBSD Secure Shell server: sshd. Starting deferred execution scheduler: atd. Starting periodic command scheduler: cron. 
</pre>
<p> Once started login to the ‘console’, (similar to Sun’s ‘zlogin’).</p>
<pre>   % <strong>vserver funky.homenet enter</strong> funky:/#</pre>
<h4>Stage 4 — configure the vserver:</h4>
<p>Now that you have created and logged in to your vserver, there’s a few more steps left. The first one is pretty normal for a fresh Debian install. Edit your /etc/apt/sources.list to point at the mirror of your choice, (heck even point it at sid!), Then do the usual apt-get update &amp; apt-get upgrade or apt-get install. Whatever.Don’t forget to change your timezone, as this will be set to the default UTC.</p>
<p>The next thing is to do with networking. The basic vserver install here will set the IP address to be 10.0.0.1. The local PC will more than likely be on the same subnet, but doesn’t have to be. Either way you’re going to have to stop the local PC from accepting packets for connection requests for things like SSH, inetd, etc. This is one downside — vserver won’t redirect traffic destined for a virtual server. So, for example, if you don’t stop ssh from binding to 0.0.0.0, then when you SSH into your vserver all you’ll do is login to your local PC. Bummer eh.</p>
<p>So, best practice is to reduce all the listening ports and/or bind them to the local PC’s IP instead of anonymous binding.</p>
<p> Also, one last thing. Make sure that you chmod 000 the parent to the vserver root. This will enable the anti-getting-out-of-chroot-jail mods that were introduced in the kernel. </p>
<h4>Stage 5 — enjoy yourself:</h4>
<p>As I mentioned before, the reason I wanted to set up a vserver was for flexibility. I can transport the vserver over to another PC, I can run multiple vservers, test out an upgrade before releasing it on the ‘production’ server. What you can do is limited only by your imagination.</p>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/20" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO — clearcase under a solaris 10 zone</title>
		<link>http://onut.net/blog/archives/19#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/19#comments</comments>
		<pubDate>Mon, 06 Feb 2006 16:12:16 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Sun Microsystems]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/19</guid>
		<description><![CDATA[I had the situation at work where I wanted to run Clearcase under a Solaris 10 zone. With a bit of coercing it’s possible to do, and doesn’t impact much of the global zone at all. If you don’t know what Clearcase is, then this still may be handy information to know. Undoubtedly, there are [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I had the situation at work where I wanted to run Clearcase under a Solaris 10 zone. With a bit of coercing it’s possible to do, and doesn’t impact much of the global zone at all.   If you don’t know what Clearcase is, then this still may be handy information to know. Undoubtedly, there are other applications that rely on loadable modules.<br />
<span id="more-19"></span></p>
<h4>Pre-requisites</h4>
<ul>
<li>You need a stock Solaris 10 install.</li>
</ul>
<ul>
<li>You need to have a Clearcase release repository with at least patch 2003.06.00–29 applied.</li>
</ul>
<h4>Clearcase zone</h4>
<p>If you don’t know how to setup a Solaris 10 zone, then you can start off with a basic one by doing the following. Take particular note of the LOFS mounting of /kernel. That’s important. </p>
<pre>
<p class="shell">% zonecfg -z zone-clearcase
zone-clearcase: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone-clearcase> create
zonecfg:zone-clearcase> set autoboot=true
zonecfg:zone-clearcase> set zonepath=/mnt/zone/zone-clearcase
zonecfg:zone-clearcase> add net
zonecfg:zone-clearcase:net> set address=10.0.0.5
zonecfg:zone-clearcase:net> set physical=hme0
zonecfg:zone-clearcase:net> end
zonecfg:zone-clearcase> add fs
zonecfg:zone-clearcase:fs> set dir=/kernel
zonecfg:zone-clearcase:fs> set special=/kernel
zonecfg:zone-clearcase:fs> set type=lofs
zonecfg:zone-clearcase:fs> set options ro,nosuid
zonecfg:zone-clearcase:fs> end
zonecfg:zone-clearcase> info
zonepath: /mnt/zones/zone-clearcase
autoboot: true
pool:
inherit-pkg-dir:
        dir: /lib
inherit-pkg-dir:
        dir: /platform
inherit-pkg-dir:
        dir: /sbin
inherit-pkg-dir:
        dir: /usr
fs:
        dir: /kernel
        special: /kernel
        raw not specified
        type: lofs
        options: [ro,nosuid]
net:
        address: 10.0.0.5
        physical: hme0
zonecfg:zone-clearcase> verify
zonecfg:zone-clearcase> commit
zonecfg:zone-clearcase> exit
% 
</pre>
<p> Now install the zone, that has just been configured. </p>
<pre>
<p class="shell">% mkdir -p /mnt/zones/zone-clearcase
% chmod 700 /mnt/zones/zone-clearcase
% zoneadm -z zone-clearcase install
Preparing to install zone <zone-clearcase>.
Creating list of files to copy from the global zone.
Copying <143885> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1025> packages on the zone.
Initialized <1025> packages on zone.
Zone <zone-clearcase> is initialized.
Installation of <1> packages was skipped.
Installation of these packages generated warnings: <SUNWsshcu SUNWsshu SUNWvtsr>
The file <mnt/zones/zone-clearcase/root/var/sadm/system/logs/install_log> contains a log of the zone installation.
</pre>
<p> Now you can boot up the zone, login to it’s console, and finish off the install.</p>
<pre>
<p class="shell">% zoneadm list -cv     % zoneadm list -cv
    ID NAME             STATUS         PATH
     0 global           running        /
     - zone-clearcase   installed      /mnt/zones/zone-clearcase
  % zoneadm -z zone-clearcase boot
  % zlogin -C zone-clearcase
  [Connected to zone 'zone-clearcase' console]
  100/100
  What type of terminal are you using?
   1) ANSI Standard CRT
   2) DEC VT52
   3) DEC VT100
</pre>
<p>etc etc etc  </p>
<p>Now you need to setup the clearcase repository. I gather you have done this before, so I won’t spell it out here. Everything is standard issue — install what you want leave out the bits you don’t want. </p>
<p>Once you have your clearcase repository you will need to install clearcase first in the global zone. Don’t worry — you will be disabling this later on. I also gather that you have performed this before, so I’ll leave that out as well. </p>
<p> Now the fun begins. Shutdown clearcase in the global zone. </p>
<pre>
<p class="shell">% /etc/init.d/clearcase stop
</pre>
<p> Edit the /etc/init.d/clearcase and put the following entries right at the start.</p>
<pre>
<p class="shell">% /usr/sbin/modload /opt/rational/clearcase/sun5/kvm/5.10/sparcv9/mvfs
% exit    
</pre>
<p>Now startup ‘clearcase’ in the global zone. All this will do is load up the kernel module ‘mvfs’ </p>
<p>Next you will have to restart your clearcase zone. This will ensure that this zone will be able to see the mvfs module loaded up.
        </p>
<pre>
<p class="shell">% zoneadm -z zone-clearcase reboot
</pre>
<p>Now you can install clearcase into the zone you have created above. Do the normal things, install what you want leave out the bits you don’t. However, right at the end of the install you will possibly get some errors. You can ignore these.</p>
<p> And that’s it! You have one working clearcase server in a zone. You can setup as many as you want as well.</p>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/19" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/19/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO — vmware and AMD64</title>
		<link>http://onut.net/blog/archives/18#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://onut.net/blog/archives/18#comments</comments>
		<pubDate>Sat, 17 Dec 2005 15:58:37 +0000</pubDate>
		<dc:creator>Mick</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://onut.net/wp/archives/18</guid>
		<description><![CDATA[My aging 1GHz PC was creaking under ths strain of running too many virtual PCs. So I decided to upgrade to a much better, faster PC. I eventually settled on an AMD64 based PC, (200G HD, 3G DDR2 RAM). Basically a nice cool, (literally as well), box. The only trouble is that I couldn’t get [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>My aging 1GHz PC was creaking under ths strain of running too many virtual PCs. So I decided to upgrade to a much better, faster PC. I eventually settled on an AMD64 based PC, (200G HD, 3G DDR2 RAM). Basically a nice cool, (literally as well), box. The only trouble is that I couldn’t get my vmware to run. Aaaaaaaaaaargh. This is a short howto on what I had to do to get it to run.<br />
<span id="more-18"></span></p>
<h4>First up</h4>
<p> For various reasons I decided to <strong>not</strong> run Linux in full blown userspace 64bit mode. Therefore, building the vmware modules for networking, etc wasn’t straightforward and was the main cause of my troubles. So I adopted a chroot/install/build/copy approach. This has worked for me not only for cross-compiling, but also running different Linux distros natively under Debian. </p>
<h4>Pre-requisites</h4>
<ul>
<li>One stock Debian Sarge install.</li>
<li>% apt-get install cdebootstrap debootstrap</li>
</ul>
<h4>Setup chroot’ed 64bit Debian</h4>
<p>This was pretty basic. Once you have installed debootstrap, then just run:</p>
<pre>
% cdebootstrap --arch amd64 sarge /STUFF/CHROOT64/ http://public.planetmirror.com/pub/debian-amd64/debian/
</pre>
<p>You will have to select a Debian 64 mirror closest to you, and also choose an alternative base directory, (I set mine to /STUFF/CHROOT64/). </p>
<p>You will see Debian installing under your chroot directory, it’ll take a while. It took around 3 minutes for me, your mileage may vary. </p>
<h4>Configure chroot’ed base</h4>
<p>Once you’ve finished installing, you’ll need to configure it all up. I did so with the following: </p>
<pre>
% cp /etc/hostname /etc/resolv.conf /etc/mtab /etc/fstab /STUFF/CHROOT64/etc
% cp /etc/network/interfaces /STUFF/CHROOT64/etc/network
</pre>
<p>You’ll also need to setup your apt-get repository. Copy the following into your /STUFF/CHROOT64/etc/apt/sources.list file, and modify for your own mirror. </p>
<pre>
deb http://public.planetmirror.com/pub/debian-amd64/debian/ sarge main contrib non-free
deb-src http://public.planetmirror.com/pub/debian-amd64/debian/ sarge main contrib non-free
# deb http://security.debian.org/ stable/updates main contrib non-free
</pre>
<p> Then enter your chroot and finish the configure. </p>
<pre>
% chroot /STUFF/CHROOT64
% mount /proc
% base-config
% dpkg-reconfigure -plow console-data
</pre>
<p> The ‘base-config’ will take a while and ask the usual setup questions. Just answer them to mirror your base Debian install. </p>
<h4>Setup build env. for vmware</h4>
<p> Now you have a fully working 64bit userpsace chroot env. You’ll need a few more tools apart from the base install: </p>
<pre>
% apt-get update
% apt-get install gcc-3.4
% rm /usr/bin/gcc
% ln -s /usr/bin/gcc-3.4 /usr/bin/gcc
</pre>
<p>NOTE: VMWare will want to use gcc-3.4 to build the kernel modules as opposed to using gcc-3.3, which is the reason for re-symlinking /usr/bin/gcc. </p>
<p> Install the all-important kernel headers: </p>
<pre>
% apt-get install kernel-headers-2.6-amd64-generic
</pre>
<h4>Install vmware</h4>
<p> Now, untar the vmware install file. Run the vmware-install.pl script. Answer all those questions as you would normally. Everything should compile and install OK. The final restart of the kernel modules <strong>won’t</strong>. You’ll get some error that you can safely ignore. </p>
<p> Don’t worry, you won’t actually be running vmware from this environment, just building the kernel modules. </p>
<h4>Copy VMware install into base install</h4>
<p> Now copy all the vmware install files into the base Debian installation: </p>
<pre>
% cd /STUFF/CHROOT64
% tar -cf - usr/lib/vmware etc/vmware usr/share/doc/vmware usr/bin/vmware* lib/modules/2.6.8-11-amd64-generic/misc etc/init.d/vmware etc/rc?.d/*vmware | (cd /; tar xvf -)
% rm /etc/vmware/not_configured
% rsync -HvaxP dev/vm* /dev
</pre>
<p> NOTE: The removal of the /etc/vmware/not_configured file is important. Otherwise you won’t be able to start the vmware modules. </p>
<h4>Startup vmware modules</h4>
<p> Just run the rc script. </p>
<pre>
% /etc/init.d/vmware restart
</pre>
<h4>That’s it! Happy vmware-ing!</h4>
<p class="fbconnect_share"><fb:share-button class="url" href="http://onut.net/blog/archives/18" /></p><p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://onut.net/blog/archives/18/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

