On 2007-06-10 08:50:05 +0300 Sebastian Reitenbach <[EMAIL PROTECTED]> wrote:

Hi,

I had some trouble to get GWorkspace to run on OpenBSD 4.1. I took the OpenBSD ports from http://mail.rochester.edu/~asveikau/gnustep-openbsd/, updated them to use gnustep-make-2.0.1, gnustep-base-1.15.0, gnustep-gui-0.12.0, gnustep-back-0.12, and GWorkspace-0.8.6. After installing, trying to start it, GWorkspace aborted with the following message:

Critical Error in GWorkspace
NSInvalidArgumentException: NSTask - launch path (mount) not valid

It took me a while to find out what this message wants me to know. After running GWorkspace it in the debugger, I saw it stopping here:

(gdb) bt
...
#10 0x0a34f3c5 in -[NSWorkspace(mounting) mountedVolumes] (self=0x87b4e928, _cmd=0x2a347848) at FSNodeRep.m:756 ...

This NSWorkspace's -mountedVolumes method, implemented by gworkspace in a 
category, is necessarily a compromise, an hack; the criteria it uses are:

#ifdef __APPLE__
  it uses getmntinfo() - tested on darwin.
#else
  #if defined(HAVE_GETMNTENT) && defined(MNT_DIR)
    it uses getmntent() - this is the default on linux.
  #else
    it uses [[NSProcessInfo processInfo] operatingSystem] and takes in 
consideration two cases:
          NSGNULinuxOperatingSystem:
            it parses /etc/mtab - this has been tested by me on Linux 
commenting the getmntent() part.  
          NSBSDOperatingSystem:
        it uses a NSTask, that is, the output of "mount -p" - this has been 
suggested by a FreeBSD user and should return a NSString equivalent to the contents of 
/etc/mtab on Linux. Untested by me.

For all the other cases an empty NSArray is returned.

I've not OpenBSD; the only solution I can see is if you write a patch for this method or 
(simplier) tell me the equivalent on OpenBSD for "mount -p".

The problem is easily explained: on OpenBSD mount is in /sbin, not in /bin. /sbin is not in $PATH environment variable of the user, therefore GWorkspace does not find the mount command automagically. The fix is to add /sbin to the PATH environment variable. With this done, I see another error message on the console regarding mount. Mount is called with parameter -p (on Linux to specify a file descriptor to read passwords from). This parameter does not exist on OpenBSD, therefore at least one call to mount fails, but does not seem to be fatal.




_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to