Part 5: The X Factor

As I said before, this installment is optional for anyone not building in UNIX.  You’ve been warned!

By its nature, VA Smalltalk requires X-Windows to run in the UNIX environment.  When you’re working interactively, this isn’t a problem.  You’re logged into a nice Gnome, KDE or CDE environment that’s already graphical, or, if you’re an unreconstructed curmudgeon like me, you’re using SSH and forwarding X to a local X server.  The problem arises when you want to have VA Smalltalk do its thing unattended.

Tasks that are run via cron, the usual scheduler for UNIX, execute without the benefit of an X server.  As a result, your nice little script to start VA Smalltalk and do some brilliant unattended task that worked so well when you tested it is going to fail because the Smalltalk VM won’t be able to connect to the X server.  Luckily, there is a solution:  the X Virtual Frame Buffer, or xvfb.

Xvfb is available for all the environments on which VA Smalltalk runs, although I’ve only used it on Ubuntu Linux and AIX.  In the case of Ubuntu, you should install the package ‘xvfb’, either via apt-get or Synaptic.  For AIX, IBM has a useful page with installation information.

Once installed, Ubuntu includes the script xvfb-run.  All you need to do is pass your desired command line along as a parameter to xvfb-run, and it will create a fake X environment in which to run that command.  For AIX, you just need to export a DISPLAY environment variable specifying the display number assigned by your system administrator to the virtual frame buffer; e.g. export DISPLAY=:1.0.  The remainder of your build script can remain unchanged.

RPM-based Linux distributions have xvfb available, but they don’t include xvfb-run.  I haven’t looked into what would be required in those cases, nor have I looked into Solaris at all.

With the next installment, we return to our platform-independent discussions.

Advertisements

4 Responses to “Part 5: The X Factor”


  1. 1 Claus 2011-04-04 at 08:14

    Isnt there a way to tell VA to pipe all output (Transcript especially) to a file instead of insisting that there always needs to be X?
    That strikes me as odd.

    • 2 Tom Koschate 2011-04-04 at 11:55

      It’s not that odd if you think about it. Since there’s no provision for scripting, the only way to do anything is via the UI, so why provide a mechanism to redirect output?

  2. 3 Claus 2011-04-08 at 08:24

    Granted, but what about headless servers?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: