From: Stef B. <st...@gm...> - 2010-06-23 13:55:37
|
Hello, I'm trying to create a chrooted environment with a fuse module and chroot: fuse-workspace-ll --bind-directory=/var/lib/workspace/sbon/bind \ --conf-directory=/var/lib/workspace/sbon/conf \ /mnt/chroot/sbon/mount -o exec This module mirrors the contents of the bind directory into the mountpoint, and converts symlinks into directories when the same directory exists in the conf directory, and hides the toplevel directory entryname when the file entryname/.hide exists in the conf directory, and hides symlinks in the toplevel which are pointing to directories in root with the same name (like usr->/usr). With it's possible when run as root, to create a chrooted environment: ls -l /var/lib/workspace/sbon/bind total 16 lrwxrwxrwx 1 root root 4 2010-06-23 14:30 bin -> /bin drwxr-xr-x 2 root root 4096 2010-06-13 13:05 dev drwxr-xr-x 2 root root 4096 2010-06-13 13:10 Documenten lrwxrwxrwx 1 root root 4 2010-06-23 14:30 etc -> /etc lrwxrwxrwx 1 root root 4 2010-06-23 14:30 lib -> /lib lrwxrwxrwx 1 root root 4 2010-06-23 14:30 opt -> /opt drwxr-xr-x 2 root root 4096 2010-06-01 09:15 proc lrwxrwxrwx 1 root root 5 2010-06-23 15:05 root -> /root lrwxrwxrwx 1 root root 5 2010-06-23 14:30 sbin -> /sbin drwxr-xr-x 2 root root 4096 2010-06-01 09:17 sys lrwxrwxrwx 1 root root 4 2010-06-23 14:30 tmp -> /tmp lrwxrwxrwx 1 root root 4 2010-06-23 14:30 usr -> /usr lrwxrwxrwx 1 root root 4 2010-06-23 14:30 var -> /var Now conf looks like: ls -l /var/lib/workspace/sbon/conf total 56 drwxr-xr-x 2 root root 4096 2010-06-13 13:07 bin drwxr-xr-x 2 root root 4096 2010-06-13 13:08 dev drwxr-xr-x 4 root root 4096 2010-05-13 00:02 Documenten drwxr-xr-x 2 root root 4096 2010-06-13 13:08 etc drwxr-xr-x 2 root root 4096 2010-06-13 13:09 home drwxr-xr-x 2 root root 4096 2010-06-13 13:09 lib drwxr-xr-x 2 root root 4096 2010-06-13 13:09 opt drwxr-xr-x 2 root root 4096 2010-06-03 11:44 proc drwxr-xr-x 2 root root 4096 2010-06-23 15:05 root drwxr-xr-x 2 root root 4096 2010-06-13 13:09 sbin drwxr-xr-x 2 root root 4096 2010-06-03 11:45 sys drwxr-xr-x 2 root root 4096 2010-06-13 13:10 tmp drwxr-xr-x 2 root root 4096 2010-06-13 13:10 usr drwxr-xr-x 2 root root 4096 2010-06-13 13:10 var (Documenten is dutch for Documents) Now after mounting: mount -t proc proc /mnt/chroot/sbon/mount/proc mount -t sysfs syfs /mnt/chroot/sbon/mount/sys mount --bind /dev /mnt/chroot/sbon/mount/dev mount -t tmpfs tmpfs /mnt/chroot/sbon/mount/dev/shm mount -t devpts -o gid=4,mode=620 devpts /mnt/chroot/sbon/mount/dev/pts I can chroot into it: chroot /mnt/chroot/sbon/mount /bin/bash --login I have a complete working environment. The systemdirectories are hidden, but are present. ls / gives Documenten but I can enter proc: ls /proc gives a lot of files.. Sam with usr, bin, andso on. Like GoboLInux. Now I'm trying to start a new X session in this environment by running startx, but errors is what I get. It's the construction: xauth -q -f "$xserverauthfile" << EOF add :$dummy . $mcookie EOF which causes this. It's porobably the redirection of std input. Anyone reckognizes this? Stef |
From: Goswin v. B. <gos...@we...> - 2010-06-23 16:48:33
|
Stef Bon <st...@gm...> writes: > Now I'm trying to start a new X session in this environment by running > startx, but errors is what I get. > > It's the construction: > > xauth -q -f "$xserverauthfile" << EOF > add :$dummy . $mcookie > EOF > > which causes this. > > It's porobably the redirection of std input. > > Anyone reckognizes this? > > Stef This is a 'here document'. Everything between the two EOF is used as input to the xauth command. It is equivalent to echo "add :$dummy . $mcookie" | xauth -q -f "$xserverauthfile" MfG Goswin PS: ever thought of using unionfs-fuse? |
From: Stef B. <st...@gm...> - 2010-06-23 17:34:19
|
Well, I know this construction, and I know howto rewrite it. But I hoped someone reckognizes the error I get, and if there is one, it is related to fuse. I'll try to patch the xstart script (which has more "here documents"). But it's not the sollution to fix all the "here document" constructions. Well, maybe it's related to this: http://sourceforge.net/mailarchive/message.php?msg_name=1275598297.582.33.camel%40sledge.emsl.pnl.gov Stef 2010/6/23 Goswin von Brederlow <gos...@we...>: > Stef Bon <st...@gm...> writes: > >> Now I'm trying to start a new X session in this environment by running >> startx, but errors is what I get. >> >> It's the construction: >> >> xauth -q -f "$xserverauthfile" << EOF >> add :$dummy . $mcookie >> EOF >> >> which causes this. >> >> It's porobably the redirection of std input. >> >> Anyone reckognizes this? >> >> Stef > > This is a 'here document'. Everything between the two EOF is used as > input to the xauth command. It is equivalent to > > echo "add :$dummy . $mcookie" | xauth -q -f "$xserverauthfile" > > MfG > Goswin > > PS: ever thought of using unionfs-fuse? > |
From: Nikolaus R. <Nik...@ra...> - 2010-06-24 13:19:08
|
Stef Bon <ste...@pu...> writes: > Well, I know this construction, and I know howto rewrite it. > > But I hoped someone reckognizes the error I get, and if there is one, > it is related to fuse. Your chances of that would probably increase significantly if you would have told us anything about the error (instead of "I get an error"). Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C |
From: Goswin v. B. <gos...@we...> - 2010-06-30 11:20:21
|
Stef Bon <st...@gm...> writes: > Well, I know this construction, and I know howto rewrite it. > > But I hoped someone reckognizes the error I get, and if there is one, > it is related to fuse. > > I'll try to patch the xstart script (which has more "here documents"). > > But it's not the sollution to fix all the "here document" constructions. > > Well, maybe it's related to this: > > http://sourceforge.net/mailarchive/message.php?msg_name=1275598297.582.33.camel%40sledge.emsl.pnl.gov > > > Stef > > > > 2010/6/23 Goswin von Brederlow <gos...@we...>: >> Stef Bon <st...@gm...> writes: >> >>> Now I'm trying to start a new X session in this environment by running >>> startx, but errors is what I get. >>> >>> It's the construction: >>> >>> xauth -q -f "$xserverauthfile" << EOF >>> add :$dummy . $mcookie >>> EOF >>> >>> which causes this. >>> >>> It's porobably the redirection of std input. >>> >>> Anyone reckognizes this? >>> >>> Stef >> >> This is a 'here document'. Everything between the two EOF is used as >> input to the xauth command. It is equivalent to >> >> echo "add :$dummy . $mcookie" | xauth -q -f "$xserverauthfile" >> >> MfG >> Â Â Â Â Goswin >> >> PS: ever thought of using unionfs-fuse? >> I don't see where fuse has anything to do with here documents. That is a far too highlevel shell construct to relate to anything specific in fuse. Maybe run the script under strace and/or your fs with debug and see what operation actualy fails. Maybe your /dev/stdin doesn't work or something trivial. MfG Goswin |