How to remove Mono from Ubuntu 9.10 Karmic Koala [Updated]

AkhenatenI’ve been mildly intrigued as to why the volume of background noise and character assassination that has surrounded Mono has been on the wane over the last few months. Consequently, I started wondering if there were any obvious reasons for this outbreak of pacifism in what has sometimes seemed like a debating chamber for differing groups of religious fundamentalists.

Some of it is surely to do with Microsoft’s Community Promise made back in July 2009, but I doubt that is really the only reason for the attenuation. I do wonder if Mono might just simply be losing some of its lustre. In August Blackduck reported how the amount of code being written for FOSS projects using C# was pretty negligible at just 1.33% and that growth in C# usage over a 12 month period was virtually zero.

There were also some rather nasty and personal attacks which did nothing to help our community at large nor the reputation of the individuals’ concerned so maybe people have consciously, or subconsciously, decided to just shut-up for a while?

Quite recently Microsoft, along with Intel, announced that they will ship Silverlight on Linux as opposed to using the Microsoft/Novell sponsored Mono project called Moonlight. OK, admittedly this announcement was only for Moblin Linux, but hey, since when has Microsoft ever been transparent about it’s long term objectives or plans? Perhaps, Mono and Moonlight were just too heavyweight for Moblin devices (netbooks and smart-phones typically), or maybe there is more to it. It could be a very good start to a typical Microsoft "Embrace, Extend & Extinguish" strategy. Who knows? But it certainly isn’t exactly a ringing endorsement of Mono and Moonlight is it?

The awkward question: If it’s that easy to port Microsoft Silverlight to Linux, why does the Moonlight project exist at all?

“I’m really clear about our commitment to Moonlight. I see the work we’re doing with Miguel and Moonlight as core to our strategy for delivering implementations for Linux,” says Goldfarb, protesting, perhaps, a little too much. ®

Anyhow, my personal opinion of Mono hasn’t changed much. There are no Mono applications in Ubuntu that make me go weak at the knees and get all excited; far from it in fact:

  • I’ve never really had any need for Tomboy at all and since discovering Getting Things Gnome my jotted notes and todos all go in this great little Python task keeping application anyway. If you have used, or ever wanted to use Tomboy in the past however there is now a clone written in C++ called Gnote. This is in the Karmic “universe” repository and can be installed either from Synaptic, the new Ubuntu Software Centre (now spelt correctly if you use an en_GB locale) or by typing sudo apt-get install gnote.
  • When I last used F-Spot, which was probably back in Gutsy or Hardy days I reckon, it annoyed me that the application wouldn’t automatically delete the pictures off my camera after importing. GThumb did and always has; so no big deal there then. There is also a new kid on the block called Solang that is in the Karmic repos too. I haven’t tried it in anger myself yet but I’ve heard good things from others.
  • Media Players/Managers? “Banshee!” I hear you cry. Well, I’ve never tried it because I don’t have Mono on my Ubuntu desktop or laptops so I can’t say if I like or not as an application. On my Ubuntu machines, the only music player I have tried and actually really liked, is Songbird. There are still a few features missing, but the forthcoming 1.4 release is looking like it will plug some of these gaps. Songbird looks, feels and works fine for my needs.

On the 15th October a very important figure in our community penned his own contribution to this discussion. Jeremy Allison, of Samba fame, wrote a well considered letter essentially calling on the major GNU/Linux distributions to move Mono outside of their default and core repositories. It’s something others, including myself, have discussed before, but likely with a lot less weight than Jeremy’s comments will surely carry.

… I think it is time for the Mono implementation and applications that use it to be moved into the “risky” category, until the patent situation around it is deemed to be truly safe to use by default in Free Software.

Microsoft isn’t playing games any more by merely threatening to assert patents. Real lawsuits have now occurred and the gloves are off against Free Software. Moving Mono and its applications to the “restricted” repositories is now just plain common sense.

Anyway, back to the reason for this post.

In the latest, shiniest, bestest, release of Ubuntu to date, and it really is a cracking release, the desktop version of Karmic Koala (version 9.10) contains two Mono dependent applications in the default install along with the Mono VM and associated libraries etc.

Now, this time, we have 3 ways to go Mono free:

  1. Visit Jo Shield’s blog and get Chicken Little Remix (CLR). Chicken Little Remix (CLR) provides a solution for users who wish to use Ubuntu but would prefer it to not contain any Mono-based software. This 2nd release of CLR, based on Ubuntu 9.10, comes as a livecd with it’s own unique desktop wallpaper and also features replacement applications where appropriate.
  2.  

  3. Use the KDE based Kubuntu instead of Ubuntu, which uses Gnome. (Thanks Mark for pointing out my omission in the comments below)
  4.  

  5. Install the regular Ubuntu distribution and then remove the applications and their supporting packages*. The simple command required goes like this [Update] Thanks to Jo who mentioned the 3 libraries that should also be removed [/Update]:

    sudo apt-get purge libmono* libgdiplus cli-common libsqlite0 libglitz-glx1 libglitz1

    Which should reply with something similar to:

    The following packages will be REMOVED
    cli-common* f-spot* libart2.0-cil* libflickrnet2.2-cil* libgconf2.0-cil*
    libgdiplus* libglade2.0-cil* libglib2.0-cil* libgmime2.2a-cil*
    libgnome-keyring1.0-cil* libgnome-vfs2.0-cil* libgnome2.24-cil*
    libgnomepanel2.24-cil* libgtk2.0-cil* libmono-addins-gui0.2-cil*
    libmono-addins0.2-cil* libmono-cairo2.0-cil* libmono-corlib2.0-cil*
    libmono-data-tds2.0-cil* libmono-i18n-west2.0-cil* libmono-posix2.0-cil*
    libmono-security2.0-cil* libmono-sharpzip2.84-cil* libmono-sqlite2.0-cil*
    libmono-system-data2.0-cil* libmono-system-web2.0-cil*
    libmono-system2.0-cil* libmono2.0-cil* libndesk-dbus-glib1.0-cil*
    libndesk-dbus1.0-cil* mono-2.0-gac* mono-gac* mono-runtime* tomboy*
    0 upgraded, 0 newly installed, 34 to remove and 0 not upgraded.
    After this operation, 47.8MB disk space will be freed.
    Do you want to continue [Y/n]?

NB: This command was tested on a default installation. The purge switch is designed to remove configuration data too. If you have any important information on your system that might be dependent on these applications, please do your research and backup or copy it first. I test the command in a clean Virtual Machine build before using it on a live system: YMMV.

* If you are aware of any other packages that can, or should be removed, please let me know and I will update the post.

Depending on your vigilance or need, you may wish to install the package called Mononono which will keep a look out for you and alert you if an application tries to install any Mono components.

For those of you who do not happen to be scholars of ancient Egyptian history, the picture at the top of this article is of the Egyptian Pharaoh Akhenaten regarded by some as the first Monotheist:

Akhenaten tried to bring about a departure from traditional religion that in the end would not be accepted. After his death, traditional religious practice was gradually restored, and when some dozen years later rulers without clear rights of succession from the Eighteenth Dynasty founded a new dynasty, they discredited Akhenaten and his immediate successors, referring to Akhenaten himself as ‘the enemy’ in archival records.

Image courtesy of Wikimedia under several free licences.

Windows is Dead (almost). Long Live Free & Open Source Software, i.e. Ubuntu

Finally.

My wife’s PC was the last bastion of proprietary software hell remaining in our home (and we have quite a few PCs). 2 days ago, Helen explained that she’d been having a nightmare with Windows. You’d start to login and immediately it would log you out again! Nice. And there was no easy way to prevent it. “Safe Mode” did the same thing. Very helpful – not. Googling threw up a lot of people with the same experience and some rather dodgy sounding workarounds to rectify the situation.

Helen has had a dual boot setup for a while, has been getting used to the nuances of Ubuntu and the Gnome desktop and is now fairly comfortable with it. So, rather than trying to fix an inherently broken OS we decided to make the switch. There was one caveat however; iTunes. Her work is a franchised music therapy business for elderly and disabled residential care homes. She uses a big iPod and iTunes to manage her many playlists etc., and all the music is in Apple’s lossless proprietary format. (I know, but I didn’t have an opportunity to suggest an alternative at the time…)

To make the move to Ubuntu as painless as possible I bought some more RAM and a 320GB HDD from Scan Computers to give her some more space and also just in case I ended up needing to do a fresh Windows install for a dual-boot setup. But my plan was to first of all attempt to use VirtualBox for the iTunes requirement. Unfortunately Wine didn’t seem like a viable option at this time.

After what seems like far too much effort, the iTunes Library is now hosted on our home server so it can be backed up easily. A VirtualBox (the closed source PUEL edition for USB passthrough) VM is running a fresh new install of XP and only iTunes, and it connects via a Samba share (Windows is configured to re-connect the network drive (Z:) on startup) to the music library.

The iTunes library was a complete PITA to move. There are lots of how tos and such like on the web but when it boils down to it, you need to check, very carefully, the structure in the iTunes Library.xml file so it matches the new location of the music itself. What didn’t help me was discovering, after several failed attempts, that iTunes at some stage in the past, had decided to create two complete “Compilation” and “Podcasts” directory structures, each with mostly different content, but some of it overlapping.

Essentially, the process is something like this:

  • Backup the whole library!
  • Create the new library location and copy in the data
  • Delete the *.itl files from the root of the iTunes library
  • Examine the iTunes Library.xml file and use a good editor/comparison tool to alter all the paths so they point to the correct locations in your new library structure
  • Fire up iTunes, edit the Music Library location to where the new one lives
  • Under the File menu (IIRC) you choose “import library” and point it at your modified iTunes Library.xml file
  • Cross your fingers, toes and anything else ;-)

Judicious use of that great comparison tool Meld and my eyeballs meant that finally I managed to restructure the library so it was consistent and not duplicated. I think that had it not been like this, my experience would not have been so bad or so lengthy, but iTunes will leave always a very nasty taste in my mouth. Also, had Windows not completely barfed (again) I would have been able to use the already installed iTunes app and move the library using it’s own built in tools (as this is apparently possible according to the interweb).

Probably the next step will be to introduce Helen to Songbird (or similar) and see if we can migrate the library, playlists and music across to that. I’ll do some playing on my own before suggesting it though. Small steps to catchy monkey I think.

VirtualBox 3.02 seems to be really good though. The USB pass through and auto-filtering is just brilliant (so Ubuntu doesn’t alert when you plug in the iPod when the VM is running; it goes straight through to the Windows VM). It does seem to take quite a long time for the whole Windows/iTunes thing to settle down after I’ve plugged the iPod in but it might be just because it’s a big 120G iPod anyway… But it isn’t a major issue.

So, although Windows isn’t completely dead in our household, it is certainly on its very last legs. And good riddance to it to.

A shared “drop-box” using Samba [Updated]

Here’s a neat thing I managed to sort out the other day.

If you have read any of the “Untangle, Asterisk and File Server; All-in-One” series of posts before, then you will know that I’ve got a neat little VIA CN700 server for our home that is running all sorts of good stuff.

One of the things I have wanted to do for a while was to create a shared directory on the server so any family member can put stuff in there (like music files etc) but not be able to delete anything so as to prevent accidentally removing thousands of MP3s or irreplaceable digital pictures for example. This facility is apparently called a “drop-box”.

Hmmmm. Now let me think… Linux file permissions are rwx: Read Write eXecute. So, if you have write access, you can delete too. How can I fix this?

After some Googling and reading the Samba documentation it is actually pretty straightforward. Here’s how to make a drop-box on a Linux file server using Samba (CIFS) as the file sharing protocol and access mechanism.

  • Create a directory somewhere on your server and give it a sensible name: I called it “shared” and put it under the /home tree.
  • Create a Linux group for all users who you want to access the drop-box: I called the group “shared”. Then add your users to that group.
  • Using sudo or running as root, change the the directory settings as follows:
    • chmod 770 shared. This prevents access to the directory by anyone other than root, and the owner and group members.
    • chown nobody:shared shared. This changes the directory ownership to a user “nobody” and the group “shared”. It is important that you use a user who is NOT a member of the shared group. Any user will do, but it must be defined in/etc/passwd. I chose “nobody” as it has very minimal permissions and is unlikely to pose any sort of security hazard. On my server, the user nobody is configured thus:nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
    • chmod g+s shared/. This sets the directory’s SGID bit so that any new files or directories created in our shared directory will have their group id set to that of the of the shared directory. This ensures all members of the shared group can read the contents.
    • chmod +t shared This sets the “sticky bit” of our shared directory. On Linux, setting the sticky bit, means items inside the directory can be renamed or deleted only by the item’s owner, the directory’s owner, or the superuser; without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of owner.
    • Here’s a listing of the directory showing how it should look now:drwxrws--T 3 nobody shared 62 2008-04-15 21:48 shared

Now we can set-up our share in Samba as follows:

[shared]
comment = Our Shared Data/Media
path = /home/shared/
read only = no
valid users = @shared
browseable = yes
inherit owner = yes

The valid users @shared line tells samba that only members of the “shared” group can access this share. And the line inherit owner = yes is what makes it all work. This tells samba to set the owner of any files created to the owner of the directory we are in. In this case the owner is “nobody”. As the sticky bit is set on this directory, only the user “nobody” or the superuser can remove files as their ownership is instantly changed by Samba when first created from the actual user to the user “nobody”.

After dropping a file into the shared directory over a samba connection the listing looks like this:

-rwxr--r-- 1 nobody shared 1272366 2008-04-17 14:17 14_-_Jubilee.mp3.

See how the file is owned by “nobody:shared” and only has group and other read set.

It might sound like a bit of a palaver, but it doesn’t take very long to set up. This is a very useful way of creating drop-boxes for many kinds of applications.

I hope someone finds this useful, and please leave a comment if you do!

[UPDATE]

A big thanks to Simbul who noted the obvious flaw in my suggestion. Although you could safely drop files into this folder, you couldn’t create directories which was a bit of a PITA to be honest. However Simbul made a simple addition to the [shared] section that fixes this issue (See the comments at the bottom of this post for details):

[shared]
comment = Our Shared Data/Media
path = /home/shared/
read only = no
valid users = @shared
browseable = yes
inherit owner = yes

Add the following two lines:
directory mode = 3770
force directory mode = 3770

And that’s it. Thanks Simbul. It works a treat.

Lets all do the Samba! Merry Christmas!

Fantastic!

The EU vs. Microsoft litigation that finished a couple of months ago has finally bourne fruit. The Samba team now have royalty free access to the protocol documentation for Windows Workgroup protocols. Read the full story over on Groklaw. Massive thanks are due also to PJ for keeping the pressure on the EU so its judgement provided a way for Microsoft to deliver their protocol specs without encumbering users and developers with Patent restrictions and licenses.

Merry Christmas – This is a BIG deal for the Open Source Community and what a great way to finish what has been a pretty stonking year for OSS in general.

Untangle, Asterisk PBX and File Server; All-in-One. Part 8

If you’ve been following the story so far you’ll now where I am. If you haven’t, please go back to Part 1 and read from there. Alternatively if you click on the Untangle tag in the tag cloud then you should get all of the posts so far.

Hi all,

I’ve not yet got any further with the Untangle portion, but pretty much everything else is now in place and working :-)

Last night I built and installed the few remaining applications that are necessary to support my objectives:

  • MySQL (I need this for Joomla! and vtiger)
  • Postgresql (I need this for untangle)
  • Apache
  • PHP (and some associated libraries for added functionality, i.e. HTML-Tidy, mm, libmcrypt, mhash…)

I have also been thinking about what it is actually I am trying to achieve. I find a picture really helps so here’s a block diagram of the applications I want and how they should interface to the outside world…

Functional Block Diagram

This was a good exercise that helped me to understand the flow of traffic and what needs to be prevented from passing through the server. The dotted line from Apache to the Internet is because I’m not sure yet whether I’ll actually provide any sort of public web presence from this box or not. I doubt it somehow but you never know…

If anyone has any comments or suggestions for improvements I’d be happy to hear them. I made the original diagram in OOo draw. Here’s the original file if you want to use it or alter it. As with all other stuff on here, its CC licensed.

M$ vs. EU (Open Source): Samba Wins!

This story has been back and forth like a long stroke piston engine, but it now seems as though for a one-time payment of €10k, the Samba team get the necessary stuff they need without prejudice and ongoing royalty commitments.

Microsoft, which has decided not to appeal the Court of First Instance’s September 17 ruling in favor of the European Commission and its 2004 antitrust order against the company, has also agreed to bend its terms to the open source business model and slash the price of its server communication protocols – just like the Samba Project wanted.

I know it isn’t quite free – but come on, €10k, they have already had two “donations”. I should think Redhat and Ubuntu could find that between them in spare change…

Samba always said it could deal with a one-time payment. It just couldn’t abide a royalty stream or a patent agreement. Kroes went to bat for the project and got Microsoft to agree to either a one-time payment of EUR 10,000, roughly $14,300, or a royalty structure, including a worldwide patent license, of 0.4%, down from 5.95% – less than 7% of its original price, the EC preened.

I think this is good news, but as I said it has been back and forth so perhaps this may change again…

Untangle, Asterisk PBX and File Server; All-in-One. Part 6

If you’ve been following the story so far you’ll now where I am. If you haven’t, please go back to Part 1 and read from there. Alternatively if you do a search for Untangle in the little search box top-left then you should get all of the posts so far.

I have stalled on Untangle due to kernel issues already well documented on here before. The good news is the guys from Untangle are in contact with me and are working on a new kernel for the upcoming 5.1 release. I am hoping to get something to play with in the next few weeks. And it will most likely be based on a 2.6.22 release which is excellent news as that has direct support for my hardware.

So in the meantime I have been installing Samba – which is fairly straightforward – and Asterisk which is a bit more involved.

As you will know, I am using the Linux From Scratch (LFS) project for this server’s operating system. From the same stable, comes the Beyond Linux From Scratch (BLFS) book that contains many (i.e. hundreds) excellent resources and instructions for installing various applications; including Samba. So I will not go into detail about how to build Samba here. The configuration of Samba for my home network is another subject and I will discuss this further once I’m happy with the set up.

Asterisk, the Open Source PBX, is another ballgame entirely. To build asterisk itself from source is not too hard. From an LFS core, there were no dependencies to satisfy first. If you are on a major distro however, you will certainly need to add quite a few -dev packages to your system first. With Ubuntu they have a meta package called build-essentials which will certainly help. Here is a good starting point for information: http://www.voip-info.org/wiki/index.php?page=Asterisk+installation+tips.

To build asterisk for testing purposes, build and install as root*. As I have an x100p analogue FXO card I need to install the zaptel driver first like this (after extracting the source tarball and cd‘ing into it):

./configure --prefix=/usr &&
make menuselect &&
make &&
make install &&
make config

Both this and the Asterisk build expect your kernel source tree (the headers) to be in /usr/src/linux-`uname -r` by default. The make menuselect command will enable you to select which hardware drivers you need and to disable the building of those you do not. make config will install a rc.d script for init so the card is properly initialised during boot-up. Although I had to hack this a bit to work with the LFS/BLFS boot scripts. Even if you do not have any analogue cards, you are recommended to install the zaptel drivers as they can provide timing a source for Inter-Asterisk Trunks (IAX) and conferencing via the ztdummy module.

Once the zaptel modules are installed, repeat a similar process for the Asterisk source:

./configure --prefix=/usr &&
make menuselect &&
make &&
make install

This should build and install the Asterisk server into the /usr hierarchy with the configuration files in /etc/asterisk and the runtime information and sound files under /var. When you run make menuselect pay attention, you can choose whether to install various language files, codecs, add-on sounds (I installed the extra sound files) and other goodies. Here’s a page that should help you get going once again: http://www.voip-info.org/wiki/index.php?page=Asterisk+Compile.

You can elect to install sample configuration files, by typing make samples. This will basically give you a working PBX out of the box for testing purposes. This is sort-of-useful but the files are very complicated and hard to follow, although they are well commented so they make a good reference. I quickly removed the whole /etc/asterisk directory to somewhere else (to keep for reference) and started from scratch with a clean directory.

Learning how to setup asterisk is time consuming. Then comes that moment when, after reading for hours and looking into lots of text files and learning about channels, priorities, applications and contexts, suddenly the penny drops! It will become clear. But don’t rush it and I would strongly recommend NOT going for one of the packaged appliance builds that come with a GUI front end to start with. Why? Because you will never learn what’s under the hood and you will be limited by the GUI designer’s ideas of what you need to configure. Once you ‘get it’, by all means use a GUI, but not before…

For testing you will need a phone :-) I know. Obvious but it had to be said. There are plenty of SIP phones on the market that are inexpensive, and there are several “soft phones” that you can run on your PC and use a headset, or mic & speakers. I chose to go the soft phone route for now and tried the following three soft phones for Linux.

  • Ekiga: Formerly Gnome Meeting. Initially I thought this was great but I have had several weird issues with DTMF and sound quality, so this is on the back-burner for now.
  • Wengo Phone: Looks nice, seems to work O.K. but I preferred the User Interface and overall experience of the final one in my list.
  • Twinkle: This just works. Has a simple and easy to use interface and is a cinch to setup. My personal favourite of the three (apart from the name, that is.)

These soft phones I used purely for SIP connectivity on my local LAN to the Asterisk server. There are others that can connect to Asterisk using IAX or H.323 but I didn’t try those, nor see a need to.

Here are a couple of resources I found very helpful along the way:

  • The voip-info.org wiki for Asterisk
  • This excellent short slide presentation (They say a picture paints a thousand words don’t they…)
  • This e-book: The “TFOT” Book (If this site is down, google for it. It’s available from lots of other sources)
  • And google. There is loads of information out there if you are prepared to look for it.

Along with my business partner who has installed Asterisk on his similarly small and low-powered server, we now have fully networked digital PBX functionality (IAX trunking between our servers), Voicemail (with email notification and forwarding), and Dial-in & Dial-out via the PSTN (through the x100p card on my box). Next is to try conferencing and call parking.

Asterisk, Samba Server HardwareWith this little server (shown here with the x100p card installed), I now have Samba, providing a home network file server for all the family, Asterisk running happily and providing advanced digital telephony throughout the house. And all using free and Open Source software. Once I’d bought the hardware, the software costs were zero, and will be zero. How much is Windows Home Server? And more to the point, why do you need it? Oh yes, does it also have a fully fledged enterprise grade digital PBX? And is it secure? (Just like the rest of Windows… lol)

Once I’ve nailed the configuration down and got asterisk running securely*, I’ll post some more on this including configuration details.

* The usual way to install Asterisk from source is by, and as, root. For a test-bed that’s no problem but for a production environment with direct internet connectivity (as this device will have) this is not a good idea. I will spend a little time developing an installation procedure that will install it as a non-root user and with limited privilages. The suggested mechanisms I have found on-line are not quite as I would like them. I try and keep to the FHS where possible and maintain a “tight” ship. This process I will also document once it’s nailed…

Untangle, Asterisk PBX and File Server; All-in-One. Part 5

If you’ve been following the story so far you’ll now where I am. If you haven’t, please go back to Part 1 and read from there.

I’ve been a bit busy recently so haven’t had as much time as I’d like to crack on with this. However, I’ve actually come to a bit of a halt regarding Untangle due to the kernel…

I managed to get the initial Rake (Ruby’s Make) build scripts to run to completion on my LFS-6.3 system :-) . For those who are interested, after editing some of the Rake files for hard-coded environment variables, I had to drop down to the last version 5 release of the JDK. Version 6 is not supported due to the issues mentioned in part 4 of this series.

After the build completed, trying to run Untangle caused it to barf badly. But I wasn’t surprised by this. I hadn’t installed Postgresql, and I discovered I was missing a setting in my kernel config (IP Userspace queueing via NETLINK (OBSOLETE)) which caused this file ip_queue_maxlen to be created in /proc. There was another file in /proc missing too: icmp_frag_accept. It was searching for this, that led me to get to the bottom of the kernel issues.

After some dialogue on their mailing lists, it became clear that the build process was not going to be as simple as I’d first thought. The current version of Untangle (5.0.2) uses a very heavily patched Debian kernel (2.6.16-ck11). The method they use for patching relies on some debian tools which, seeing as I am building on LFS, I don’t have – nor do I really want.

A little side note: In the Untangle kernel, they are using the now infamous CK scheduler from Con Kolivas, that is no longer being developed for, or ported to, the main kernel tree (Google for Con Kolivas to read about the saga). I’m not sure how this will affect the UT project in the long run but it is quite an interesting area of kernel development and fuelled some big arguments.

When I have some more time to concentrate, I’ll try and work out what is really needed and see if I can patch my recent 2.6.22.5 kernel. They are developing a new release of Untangle (5.1) which may well give me what I need anyway; the ability to run other apps on the same platform and a more modern kernel version. Watch this space…

In the meantime, I have managed to get Asterisk installed. It’s a fairly straightforward CMMI (configure, make, make install) install for the needed packages (in build order): zaptel-1.4.5.1 drivers for the x100p card, asterisk-1.4.11 and asterisk-addons-1.4.2.

Configuring asterisk however is another ball game entirely. It is fairly complicated and involves a steep learning curve. Although thankfully, there are plenty of resources available on-line. I strongly recommend to get the Creative Commons Licensed O’Reilly book from 2005: Asterisk – The Future of Telephony which is widely available on-line and is an excellent resource. Also, there are lots of good blogs ;-) and other online resources to help you get started.

In addition, you will almost certainly need a SIP phone of some description. I’m currently using the Ekiga softphone as it is open source and happily runs on Ubuntu (it’s gnome based). It was originally called GnomeMeeting.

I can now make and receive calls locally between the Asterisk server and my PSTN line. Next is to try and get it work over a NAT’ed firewall to Alan Bell’s (my business partner) Asterisk server. Using IAX2 (Inter-Asterisk Exchange protocol) seems the way to ge here as it was specifically designed to use a single IP port, as opposed to SIP that uses independent ports (and potentially many of them) for connection management (UDP) and actual call data (RDP). Using SIP requires you to open up hundreds, if not thousands, of ports on your firewall. More reading and learning to follow.

Laterz…

Untangle, Asterisk PBX and File Server; All-in-One. Part 4

If you’ve been following the story so far you’ll now where I am. If you haven’t go back to Part 1 and start from there.

The server itself is running smoothly and seemingly reliably. Building Untangle (ut for short) is proving somwhat more problematic, although to be honest, it is what I expected.

After fixing a few hardcoded environment variables (JAVA_HOME) in the [m]rakefiles and changing a class declaration from com.sun.java.swing to javax.swing, the build is failing due to some Java declarations which are requesting an unsupported feature. If anyone is interested, here’s a tarball of the build-log so far: Untangle Build Log

A bit of Googling has thrown up some information that using the SwingUtilities2 package is a big no-no. Even in the JDK 5 version. It has been moved out of the way in JDK 6 and is, apparently, unnecessary due to changes in the way swing now deals with anti-aliasing and sub-pixel font rendering.

Anyway, the guys at Untangle are being very helpful, I’ve got subscribed to their developer mailing list and, hopefully, we’ll have a fix soon.

If there are any Java gurus out there who could suggest an alternative way of dealing with this using the JDK 6 release, the error is caused in this try/catch block:

try{ ((JComponent)nameJLabel).putClientProperty(javax.swing.SwingUtilities2.AA_TEXT_PROPERTY_KEY, new Boolean(true)); }
catch(Throwable t){}

or here in the util class:

public static void setAAClientProperty(Component parentComponent, boolean isAAEnabled){
if( parentComponent instanceof JComponent ){
try{ ((JComponent)parentComponent).putClientProperty(javax.swing.SwingUtilities2.AA_TEXT_PROPERTY_KEY, new Boolean(isAAEnabled)); }
catch(Throwable t){}

Meanwhile, I’ve been playing with file systems and sorting out the partitioning to my liking. Reading several articles on-line I have decided to use XFS for the file system on most partitions. According to what I can find, it offers generally better performance and scalability than the more commonly used ext2/3. It certainly takes up less disk space, I gained 4GB on the biggest partition /home: ext3 = 260GB v XFS = 264GB. On the smaller partitions (4.7GB) I gained 100MB when going from ext3 to XFS and lost that silly and irrelevant lost+found directory.

Keep Tuned, and don’t hesitate to comment :-)

Untangle, Asterisk PBX and File Server; All-in-One. Part 3

In this third instalment, the hardware is all running and I have a nice and shiny new LFS-6.3 running happily with xorg-7.2 and the very cool and lightweight fluxbox Window Manager. I have also installed the latest JDK, and Ruby & Rake to support the untangle build process.

A first try at building the untangle source failed (as I expected really). Initially this was due to the JAVA_HOME environment variable being hard-coded into various “.rb” rake build files. Needless to say, where they expected the JDK to be (/usr/lib/jvm/java-1.5.0-sun/jre), mine is somewhere else entirely (/opt/jdk).

I edited the top level rakefile, so that JAVA_HOME pointed to my JDK, to see how this affected the build. It ran for a bit longer but then aborted with some unintelligible errors.

Realising that I know nothing of Ruby, and consequently Rake, I thought I’d try a different tack. My main desktop machine runs Ubuntu Feisty. As an experiment, I installed VirtualBox (A virtualisation application) and installed the Untangle ISO into that as a virtual machine.

Really neat – it worked without any hiccups or issues whatsoever. Now I can play around with Untangle, see what goes where and what it’s dependencies are, before I go back to try and build it from source on my new server platform.

Here’s a screen shot of Untangle running as a VM (Virtual Machine) on my Ubuntu Desktop :-) You can see I have opened a

Untangle in VirtualBox

terminal in Untangle so I can start investigating the environment.

In terms of the dependencies I know I am missing: Postgresql is definate, and I may need ANT too. It might also be that I will need to downgrade the JDK to version 5 rather than 6; but I’ll confirm that later.

I have also just ordered the FXO card for Asterisk. The card I ended up going for was for sale on eBay in the USA. It sounds like it should do the trick nicely and has a low profile bracket so it will install into my little case. Including shipping it worked out at just over £17.00. Not too bad.

This may end up being a slightly longer series that I first thought. But hopefully it will still be interesting…

Next Page »