making popen() work in a chroot environment in irix (solution)

making popen() work in a chroot environment in irix (solution)

Post by Alan J Rosenth » Wed, 15 Sep 1999 04:00:00

Greetings.  Since I couldn't find anything about this at dejanews, but I
eventually managed to solve it, I figured I should post an article in hopes
that others having this particular trouble might find my answer someday.

I always try to run things like web servers in chroot environments, and this
generally works quite well.  However, under irix 5.3 (and presumably at least
some other versions of irix share this problem) I've found that popen()
just doesn't work in the chroot environment and doesn't leave any traces
of why it fails.  Strangely, someone else's implementation of popen(),
compiled in to some package which included an "enhanced" popen(), works.
(I have a feeling that this was also the case for system(), but might be

The answer is that irix's popen() library function uses /sbin/sh rather
than /bin/sh.  So this file has to exist (e.g. you could symlink sbin to
bin at the top of your chroot environment).


1. how do 'plug-ins' work?

I've got a little project I'm working on that could benifit from being able to
drop in third-party extensions as plug-ins.  I understand the plug-in theory,
more or less, but I'm fuzzy on the implementation details.  I was hoping someone
could help me out a bit.

As I understand it (and please correct me if I'm wrong), if I create a function
library and compile it as a static object then I have to compile the final app
along with that object.  If I make my library a shared object than I just have to
link against it at compile time and it's included at run-time (I've never made
any of my own so's - do you have to do anything different than what you'd do for
a static object?).

But what if I want to create a library that I can just drop into an app without
having to recompile against it (such as a netscape-style plug-in)?  Obviously
there has to be some agreed-upon api so the app knows what entry points exist in
the library and the library knows what functions the app exposes, but how does
the app actually 'load' the library while it's running?

I noticed some functions for loading dynamic modules in a glib reference and this
seems like it would be a place to start, but once I've loaded the module is there
anything special I have to do to call it's functions or do they just magically
become available?  This is the part where I'm getting lost...

If anyone can point me to a good online resource for this or drop me a basic
explanation, I'd be grateful.  I've looked over netscape's plug-in docs but that
mostly concentrates on the api side of things.  I spent some time digging through
the gimp source but gimp plug-ins appear to run as a separate process which isn't
really the behavior I'm after (I could probably still do what I want that way,
but I need to get a handle on this whole library thing anyway ;).

thanks in advance,

|  Ethan VonderWeid                          IT Technical Operations  |

|  (650) 336-0534 (internal x60534)              This space for rent  |

2. Tux Paint 0.9.2 released; includes Korean support

3. IP Accounting doesn't work for PPP dial-ins :-(( ??

4. Simple C++ Telnet Class Wanted

5. Does uemacs really work ins SysV.2?

6. Solaris Permiteters in Streams question

7. Running chroot applications in a chroot environment

8. parallel zip drive

9. In search of Solaris 2.5 Netscape Navigator 3.0 plug ins

10. Need HELP to Log User Log-ins form the internet

11. Suse 7.0; Yast2, kinternet, rc.dialout und ich komme nicht ins Internet

12. Netscape plug-ins on AIX 4

13. what is a INS server?