Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* How to get progs working under chroot in OSF1
@ 1995-03-21 19:55 Ken Mcdonald
  1995-03-22 23:37 ` Dirk Grunwald
  1995-03-23 22:18 ` David King
  0 siblings, 2 replies; 5+ messages in thread
From: Ken Mcdonald @ 1995-03-21 19:55 UTC (permalink / raw)


I'm trying to get httpd working in a chroot environment and encountering
some problems.  As an intermediate task, I'm trying simply to get "ls"
working under chroot, and encountering similar problems. In a nutshell,
here is the setup.

a copy of ls is in the directory /chdir. Also in this directory are
copies of the directories leading to, and the files, /usr/shlib/libc.so,
/etc/group, /etc/passwd, /dev/zero, and probably a few others as well.
So, for example, the file /chdir/usr/shlib/libc.so is a copy of the
file /usr/shlib/libc.so.  According to "odump -Dl", libc.so is the
only shared library ls depends on.  However, executing

	chroot /chdir /ls

gives the message "/ls not found". Executing the same command, but with
a command other than ls which does not make use of shared libraries
(eg. chroot /chdir /hostid, with a copy of hostid in chdir) does work.
Clearly, ls is missing something.  However, I have no idea what it is
missing, nor how to find out.  (On a sun, this process was quite a bit
easier--I would try to execute chroot, and it would tell me, "oh, I can't
find file such-and-such".  The error messages on the DEC are a little
more cryptic :-) )

Oh, yes, as the last line implies, I'm doing this on a Dec Alpha.
It's not my normal environment, so please feel free to point out even
really obvious points.


Thanks,
Ken McDonald
mcdonald@cs.sfu.ca


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get progs working under chroot in OSF1
  1995-03-21 19:55 How to get progs working under chroot in OSF1 Ken Mcdonald
@ 1995-03-22 23:37 ` Dirk Grunwald
  1995-03-23 18:09   ` Peter da Silva
  1995-03-24 20:42   ` Mark Bartelt
  1995-03-23 22:18 ` David King
  1 sibling, 2 replies; 5+ messages in thread
From: Dirk Grunwald @ 1995-03-22 23:37 UTC (permalink / raw)


>>>>> "KM" == Ken Mcdonald <mcdonald@cs.sfu.ca> writes:
KM> I'm trying to get httpd working in a chroot environment and encountering
--

I'm having similar problems. I can get a statically linked CERN httpd
that I compiled on OSF/1 V2.0 running under chroot. However, the NCSA
httpd (also under V2.0) complains about bad groups/users, even though
I included an /etc/passwd copy and the like.

I modified NCSA httpd to open & print /etc/passwd & the passwords are
there, but getpwent() & friends always returns 'no password'.

Still plugging on this, will post if I find anything.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get progs working under chroot in OSF1
  1995-03-22 23:37 ` Dirk Grunwald
@ 1995-03-23 18:09   ` Peter da Silva
  1995-03-24 20:42   ` Mark Bartelt
  1 sibling, 0 replies; 5+ messages in thread
From: Peter da Silva @ 1995-03-23 18:09 UTC (permalink / raw)


In article <GRUNWALD.95Mar22163727@foobar.cs.colorado.edu>,
Dirk Grunwald <grunwald@foobar.cs.colorado.edu> wrote:
> I'm having similar problems. I can get a statically linked CERN httpd
> that I compiled on OSF/1 V2.0 running under chroot. However, the NCSA
> httpd (also under V2.0) complains about bad groups/users, even though
> I included an /etc/passwd copy and the like.

Look in /etc and observe the files "passwd.pag" and so on. The password
routines are looking for the dbm index to the password file. The easiest
way to rebuild these files is to run mkpasswd(8) in the chrooted environment.
-- 
Peter da Silva                                            `-_-'
Network Management Technology Incorporated                 'U`
1601 Industrial Blvd.     Sugar Land, TX  77478  USA
+1 713 274 5180                       "Hast du Heute schon deinen Wolf umarmt?"


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get progs working under chroot in OSF1
  1995-03-21 19:55 How to get progs working under chroot in OSF1 Ken Mcdonald
  1995-03-22 23:37 ` Dirk Grunwald
@ 1995-03-23 22:18 ` David King
  1 sibling, 0 replies; 5+ messages in thread
From: David King @ 1995-03-23 22:18 UTC (permalink / raw)



To get chroot to work, you must also have:

/etc/sia/matrix.conf
/etc/sia/siainitgood

Plus perhaps:

/usr/shlib/libc.so
/sbin/loader

if you want to run shared cmds.

Hope this helps.

DavE King - Justacontractor


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to get progs working under chroot in OSF1
  1995-03-22 23:37 ` Dirk Grunwald
  1995-03-23 18:09   ` Peter da Silva
@ 1995-03-24 20:42   ` Mark Bartelt
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Bartelt @ 1995-03-24 20:42 UTC (permalink / raw)


[ Ken McDonald ]

| I'm trying to get httpd working in a chroot environment and encountering
| some problems.  As an intermediate task, I'm trying simply to get "ls"
| working under chroot, and encountering similar problems.

[ Dirk Grunwald ]

| I'm having similar problems.

I guess the "how do I run XYZ chrooted" Q&A should be in the FAQ.  (Perhaps it
is already.)  Anyway, I tackled this same problem back in November.  After all
the smoke had cleared, I ended up with the following files in the directory to
which the application did the chroot() ...

	etc/group
	etc/passwd
	etc/passwd.dir
	etc/passwd.pag
	etc/resolv.conf
	etc/sia/bsd_matrix.conf
	etc/sia/matrix.conf -> /etc/sia/bsd_matrix.conf
	etc/sia/siainitgood
	etc/svc.conf

I'm not certain that all of them are necessary, but the above list does seem
to be sufficient.  Oh, yeah, be sure that everything in the bin subdirectory
(or anything else in your path) is statically linked.  Or in other words, if
you want to use (for example) "ls", be sure to grab the copy from /sbin and
not the one from /usr/bin.  (There's likely a way to get dynamically-linked
programs to run in the chrooted environment, too, but one would probably have
to put even more stuff there, such as the shared objects, and /sbin/loader.

Mark Bartelt                                                     416/978-5619
Canadian Institute for                                  mark@cita.toronto.edu
Theoretical Astrophysics                                mark@cita.utoronto.ca

"Sheep not busy being shorn are busy frying"  -  Dylan, at a NZ lamb barbecue
             [ singing "It's all right, ma (I'm only bleating)" ]


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1995-03-24 20:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-03-21 19:55 How to get progs working under chroot in OSF1 Ken Mcdonald
1995-03-22 23:37 ` Dirk Grunwald
1995-03-23 18:09   ` Peter da Silva
1995-03-24 20:42   ` Mark Bartelt
1995-03-23 22:18 ` David King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox