BSD DevCenter

oreilly.comSafari Books Online.Conferences.

We've expanded our LAMP news coverage and improved our search! Search for all things LAMP across O'Reilly!

Search
Search Tips

advertisement

Listen Print Discuss Subscribe to BSD Subscribe to Newsletters

Running Commercial Linux Software on FreeBSD
Pages: 1, 2, 3

Troubleshooting with truss

Once you learn how to use truss(1), you'll wonder how you ever solved any problems without it. truss watches a running program and lists the system calls it makes. Whenever I have a problem getting a program to run in Linux mode, I run it under truss and gather all sorts of details.



One drawback to truss is that it requires a FreeBSD-native procfs. While procfs is not part of the FreeBSD new world order, it is still required on rare occasions. I recommend adding an entry for /proc to /etc/fstab but marking it noauto so that it is not automatically mounted at boot. That way, you only have to remember to type mount /proc before running truss, instead of digging through the procfs(5) man page.

proc                /proc           procfs  rw,noauto       0       0

Once you have /proc mounted, run your Linux program under truss. This will generate a lot of output, so you might want to use script(1) to capture the output. Simply asking the version generates 308 lines of truss output to skim through for the error. The simplest thing to do is to search the truss output for directory. Near the end of the output are several lines like:

# truss pgp --version
...
linux_open("/home/mwlucas/.pgp/randseed.rnd",0x8002,00) ERR#2 'No such file or
    directory'
linux_open("/home/mwlucas/.pgp/randseed.rnd",0x80c1,0600) ERR#2 'No such file
    or directory'
linux_open("/home/mwlucas/.pgp/randseed.rnd",0x8002,00) ERR#2 'No such file or
    directory'
...

Aha! PGP Command Line can't open /home/mwlucas/.pgp directory, as the directory doesn't exist. Once I create a .pgp directory, I get:

# pgp --version
PGP Command Line 9.0.2 build 560
Copyright (C) 2005 PGP Corporation
All rights reserved.

A few more complicated tests show that the software runs exactly as documented in the PGP Command Line manual. While I'm not sure I could get official corporate support for this install, everything I've tried works perfectly. I get excellent results installing Linux programs on FreeBSD by configuring the environment properly, branding the software correctly, and using truss(1) to identify problems. Good luck!

Absolute OpenBSD

Related Reading

Absolute OpenBSD
UNIX for the Practical Paranoid
By Michael W. Lucas

Michael W. Lucas


Read more Big Scary Daemons columns.

Return to the BSD DevCenter.


Do you have any tricks for getting a particular piece of software to work?
You must be logged in to the O'Reilly Network to post a talkback.
Post Comment
Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • MacOS X?
    2006-01-17 08:48:20  Purpendicular [Reply | View]

    MacOS X is very close to freeBSD. Would it be feasible to create the same linux compatibility mechanism for intel Macs? Is someone working on it already?


Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2009, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com