Slashdot Mirror


Building Applications with the Linux Standard Base

r3lody (Ray Lodato) writes "Just because Linux is under the GPL, some people believe that it's pretty standardized. Actually, each distro has its own little additions and, consequently, quirks. Writing an application to work reliably under all variations is not a slam-dunk. The Linux Standard Base Specification seeks to provide the common ground that all Linux apps should adhere to, and therefore make reasonably sure that they will work as advertised. Building Applications with the Linux Standard Base is a reference manual for application developers to make sure their programs will work across the Linux map." Read on for the rest of Lodato's review. Building Applications with the Linux Standard Base author Core Members of the Linux Standard Base Team pages 246 publisher Pearson plc publishing as IBM Press rating 8 reviewer Ray Lodato (rlodato AT yahoo DOT com) ISBN 0131456954 summary Very dry reading, but a lot of useful information packed into a slim 246 pages.

I've been involved with IBM products and documentation since the late '70s, and their documentation has traditionally come in two flavors: user's guides, and reference manuals. The former are meant to be read cover-to-cover (more or less), and the latter are meant to be looked at for specific bits of information. This book falls more to the reference manual side of the spectrum. Consequently, reading it cover-to-cover was a little dry, but the information needed to get an application certified with the Linux Standard Base (LSB) was clearly laid out.

Building Applications with the Linux Standard Base (published by IBM Press and available on your favorite bookstore sites) is laid out in five large parts: Introduction, Developing LSB Applications, Certifying for the LSB, Contributing to the LSB Project, and Using LSB Resources. Except for the first part (Introduction), the book gives specific examples, and many, many references to the opengroup.org website's sections on the LSB.

It becomes obvious as you go through the book that the Linux Standard Base is still evolving. The authors (13 core members of the LSB team) frequently allude to how the project can (and should) be extended to increase its scope and sophistication. Two chapters (Adding New Interfaces..., and Adding New Architectures...) cover (albeit skimpily) what's needed to update the specification.

Backing up for a moment, Part II (Developing LSB Applications) describes in detail (with examples) the Dos and Don'ts of coding practices. It then explains carefully how an application should be packaged for distribution (RPM), and finally wraps up with a section on porting Solaris apps to the LSB. In each chapter, step-by-step instructions are given when appropriate. Differences in filesystem hierarchy, signal handling, and program options are all laid out to help you through.

Part III goes over the LSB Certification process. Both runtime environments (distros) and applications are covered. Again, the book lays out the process in a step-by-step approach.

The last part in the book talks about the various resources available: the written spec, the test suites, and various usage guides. The chapter on using the LSB test suites shows how much thought went into making sure a successful test ensures a certifiable (in a good way) application.

All in all, Building Applications with the Linux Standard Base, has what you need if you're developing a commercial-grade Linux distribution or application. Once your product has passed the testing described inside, you can be confident that it will work on almost anything Linux. Very dry reading, but a lot of useful information packed into a slim 246 pages. I'd give it a 7 for writing style, but a 9 for content: total=8/10.

You can purchase Building Applications with the Linux Standard Base from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, carefully read the book review guidelines, then visit the submission page.

25 of 282 comments (clear)

  1. Standards by Anonymous Coward · · Score: 4, Funny

    Ah, yes, standards. So many good ones to choose from.

    1. Re:Standards by Smilin · · Score: 4, Funny

      One of several standard responses?

  2. Actually... by drgroove · · Score: 4, Funny

    ... writing apps that work across distros is really easy - it's called Java. :)

    1. Re:Actually... by MrRuslan · · Score: 3, Interesting

      What about Mono www.mono-project.com

    2. Re:Actually... by cthrall · · Score: 4, Funny

      You misspelled "Python."

    3. Re:Actually... by jo42 · · Score: 5, Informative

      ...and I've see Java apps (i.e.InstallAnywhere) that stopped running because a distro changed from XFree86 to X.Org. The (Sun) JVM was expecting a certain library to be there, it wasn't, and boom!! - it fall down...

      Mandatory "Java Sux!" - me

    4. Re:Actually... by WebCowboy · · Score: 4, Insightful

      Dunno about you but I don't find Java all that easy across distros either.

      Java apps aren't immune to dependency issues either and I'm not aware of any widespread effort on the scale of LSB to create a compatibility and deployment standard.

      Dont forget the biggest dependency of all--you need a JVM to run Java. That still needs to be packeaged like any other app. Let me know when there is a GPL-compatible JVM, available in an LSB-compliant package that will install and run cross-distro...and wont break if you use a different X server or non-standard hardware...then we'll talk.

      Yes, Java can be written once to run everywhere, but you often still have a few hurdles to clear during compilation and installation.

    5. Re:Actually... by ScytheBlade1 · · Score: 5, Funny

      "Saying that Java is nice because it works on all OSes is like saying anal sex is nice because it works on all genders."

      --A friend of mine, aka Orlphar

    6. Re:Actually... by Pseudonym · · Score: 3, Funny

      Oh, no no no. Java is "write once, run anywhere". Common Lisp, on the other hand, is "write anywhere, run once".

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    7. Re:Actually... by Tribbin · · Score: 3, Insightful

      I'd like to state that in this case a layer lower than the virtual machine is not working.

      If the virtual machine is not working properly, it's like running an x86 executable on a sparc.

      --
      If you mod this up, your slashdot background will turn into a beautiful sunset!
  3. Non Sequitur by pete-classic · · Score: 5, Insightful
    Just because Linux is under the GPL, some people believe that it's pretty standardized.


    Does anyone see how one thing is supposed to follow the other?

    -Peter
    1. Re:Non Sequitur by Eric+Giguere · · Score: 3, Insightful

      Doesn't releasing something under GPL pretty much guarantee a loss of standardization? GPL = "Go, procreate and live".

      Eric
      How to detect Internet Explorer using the headers
  4. "linux standardization" by stratjakt · · Score: 5, Insightful

    This is about the hundredth project of it's kind that I've seen since linux' infancy.

    Good luck to it. I'd love see a "works with linux" stamp, and have distro choice be completely irrelevant.

    It's absolutely necessary if linux is to go anywhere worth going commercially.

    --
    I don't need no instructions to know how to rock!!!!
    1. Re:"linux standardization" by runderwo · · Score: 3, Interesting

      LSB is nothing new. It's been around since 1998. It's also a vendor consortium, which means nonprofits like Debian have no say in the standards they publish. That fact alone will unfortunately limit its uptake to the commercial distributions, and in the end probably just cause a greater divide between the commercial and noncommercial distros.

  5. it's lame that... by xyeeyx · · Score: 4, Insightful

    ...programs can break on subsequent versions of linux because something has been moved or changed. Come on, guys. Maybe the reason linux isn't mainstream yet is because it's so hard to get your feet on the ground before the rug is pulled out.

  6. Application level isn't such a problem by grahamsz · · Score: 3, Insightful

    An effort to make device driver standards would mean a lot more to lots of us.

    That would make it easier for manufacturers to make linux supported hardware and know that it worked.

    Every linux user needs linux compatible hardware, but relatively few need commercial software.

    1. Re:Application level isn't such a problem by dbacher · · Score: 3, Insightful

      2.6.8 to 2.6.9 broke ABI.

      --- QUOTE from someone who doesn't get the problem
      Simple, get your kernel driver into the main kernel tree (remember we are talking about GPL released drivers here, if your code doesn't fall under this category, good luck, you are on your own here, you leech .) If your driver is in the tree, and a kernel interface changes, it will be fixed up by the person who did the kernel change in the first place. This ensures that your driver is always buildable, and works over time, with very little effort on your part.
      ---END quote from someone who doesn't get the problem

      Wrong.

      The kernel developer goes into the GPL source code, and marks the driver as "incomplete" or at absolute best makes it compile. Not actually having the device, in all likelyhood, the code is then comitted, untested, to the kernel.

      At some later point in time, a week or a month down the line, some unsuspecting user installs the updated kernel, and their device starts having random, untrackable problems. They come to the list, and are told by a dozen people that the kernel developers aren't responsible for drivers, and that they should talk to whoever actually maintains the driver.

      After finding the appropriate mailing list for the particular driver that the kernel developer broke, the user posts a question about is there a patch, and receives e-mails from not less than 10 trolls telling them "it's open source, fix it yourself." Their message is in a sea of messages in all caps with too many question marks and exclamation points, where a developer is going around in circles with a user who can't afford a keyboard with a shift key, and can't afford to buy a vowel (they are expensive, you know).

      Finally after all of this, the device driver developer sends them back a reply "sorry, I've not had a chance to test with the new kernel yet, run the old version while you wait." Then the developer gets around to posting a patch.

      If you're lucky, it's a device a lot of people use, people get angry about it, and it gets some attention fast. If you're unlucky, you've got a device that needs the older kernel and a device that needs the newer kernel, and you have to make a choice between the two and wait for the other driver to get upgraded.

      The odds of another user capable of it getting off their ass and actually researching, fixing, and posting the fix are virtually nil.

      Here is the scenario for Windows:
      Insert your device
      Boot the computer
      Windows says "there's a new device, put the disk in"
      Windows copies the device driver
      Windows possibly reboots (this is rare for most device classes, but some still need reboots)
      Device works

      Now you can argue about bluescreens or whatever, but it is a better model in that Microsoft's kernel team takes no time maintaining device drivers. There's a clear ABI division between their kernel and their drivers, and that division changes only at major versions of the kernel.

      This is the thing. When I get the kernel, I'm getting thousands of drivers I don't want or need. Most of these aren't being actively maintained, and are being updated so that they compile but aren't undergoing any level of testing at all.

      The kernel developers do not perform unit testing on the drivers (there is no facility for them to do so), and do not typically have the hardware or the large number of hardware, software combinations that need to be tested.

      So no, putting it in the kernel tree does absolutely nothing to solve the problem.

      --
      If your code is acting bloated, and is running rather slow, it's likely and predicted that some loops you will unroll.
  7. Extract from book by oexeo · · Score: 4, Funny

    File naming protocol
    ------
    Characters in filename names are a rare commodity, to be used wisely.
    Filenames should be abbreviated to the point of obfuscating any meaning:
    Why use "print" when you can use "prin," why use "prin" when you can use
    "pin," why use "pin," when you can use "xb."

    Standard output formatting protocol
    ------
    When printing a table of data to standard output, there is no need to
    label rows and columns. Linux users are elite professionals, they
    instantly know what the endless rows and columns of hex values,
    abbreviated acronyms, and various other standard and non-standard
    variables represent.

    In the rare occasion that a Linux user is unsure what some data
    represents, he will simply view the source, if the source is not
    available, he will disassemble the executable, and read the assembly code.

    If you must label columns and/or rows, please
    follow guidelines set out by the "File naming protocol" section.

  8. metastandard by Doc+Ruby · · Score: 3, Interesting

    The biggest pain in the ass I find in writing complex apps that interact with other complex apps, across different Linux distros, is the different filesystems. Where's the meta-FS-standard, where either "make" or at runtime my app can access a filesystem path under one distro's namespace (ie, on which the app was designed), and have it translated to the distro under which it will run?

    "That's the nice thing about standards... there's so many to choose from!" - Anonymous PHB

    --

    --
    make install -not war

  9. FreeBSD has it figured out by gtrubetskoy · · Score: 3, Interesting

    Actually, each distro has its own little additions and, consequently, quirks. Writing an application to work reliably under all variations is not a slam-dunk.

    IMHO, this is one great advantage that the FreeBSD project has - there are no "distros".

    1. Re:FreeBSD has it figured out by The_Dougster · · Score: 3, Insightful


      What about Debian GNU/kFreeBSD? Isn't that the Debian distro of FreeBSD? Just because FreeBSD is still relatively obscure doesn't mean that its not going to end up in the same boat as Linux. Give it a couple more years.

      --
      Clickety Click ...
  10. Oh reeeally.. by Anonymous Coward · · Score: 3, Interesting

    Writing an application to work reliably under all variations is not a slam-dunk.

    So it turns out that Microsoft's mutant penguin ad compaign was right all along?

    For the past few years, I've been screaming about the negative effects of having so many different standards to choose from on Linux - this is why I personally use FreeBSD and OSX (well, okay, and Windows for games).

    But the biggest problem (which also exists on FreeBSD), is QT. The shitty licence has caused so much damage by keeping cross-platform and commercial development off KDE (one of the most popular window managers). I know there's GTK, but I can't help think that Linux might have reached critical mass and become mainstream popular without it - GTK might not be perfect, but it is a STANDARD.

    Monkey man Steve Balmer might have looked silly when he yelled it on stage, but he was right: "Developers, developers, developers." The Linux community should be bending over backwards to attract new developers into their flock, by making their passage into the fold as easy and as hassle-free as possible.

    Chicken and the egg: applications for Linux, users for Linux. The Linux community can't force people to use Linux for the sake of using Linux, but they can bring applications to the platform - if they're worth using, users will follow.

  11. Re:How about building applications for unix? by DreadSpoon · · Score: 4, Interesting

    First, that doesn't work in real life, where even the "real" UNIX systems don't follow the various UNIX standards perfectly.

    Second, SUS and other UNIX standards don't cover binary portability at all, which is usually far more interesting to _users_ than source compatibility. I haven't and never will look at the source of most the apps I run, but I _do_ know that I want to be able to run them. I don't want to have to compile things myself, wait for others to compile and package them, and/or hunt through hundreds of packages for the same software to find the one that works on my systme. I want to go to the upstream software's site, click Install Software, and have it work. And that's 100% feasible, assuming the apps sticks to a standard like the LSB and your distro is LSB compliant.

    Third, there's also then the issue of proprietary apps which don't even have the option of making users compile the source. Unfortunately, there are proprietary apps out there, there are people who _want_ to use proprietary apps even in the face of existing OSS alternatives, and that's that. The LSB largely exists to serve those apps, in fact.

  12. Online version w/ GNU Free Documentation License by AtomicJake · · Score: 5, Informative

    "Building Applications with the Linux Standard Base" has been (apparently) also published under the GNU Free Documentation License. Here is the Online version.

  13. Re:What we need--installation/uninstallation API by Xabraxas · · Score: 3, Interesting
    Try running a Linux binary from two years ago.

    While this is true there are programs that ran on 98 that don't run on XP. If they don't make a newer version of the program you are SOL. With OSS you just recompile, which is relatively painless for small applications. Even if a simple recompile doesn't work it is still possible to modify the source to get it to work.

    That way, GNOME and KDE could just be seperate shells on top of the same desktop, and they would happily run each other's apps.

    That seems pointless to me. Why wouldn't you just make one shell with all the options of GNOME and KDE? It seems like after you got everything to work as one DE with different shells, you would only be one small step away from merging them completely into one.

    I do think GNOME and KDE should integrate as much as they can to keep things compatible and consistent BUT it's good to have two seperate environments, especially since they seem to aim at different crowds. Also, competition is a good thing.

    I'd also request a kernel driver API that unties them from the kernel--recompiling an entire kernel to support a new scanner I just bought is ridiculous. I should just be able to go online and download a special binary driver

    I'm confused by this. You don't need to recompile your kernel to include a new driver. You can build modules without rebuilding the entire kernel. Also I build the madwifi-driver, which is partially proprietary and outside of the kernel, without having to recompile the kernel.

    --
    Time makes more converts than reason