Re: No network in mixed FBSD81/90 chroot environment

2011-11-29 Thread Erik Nørgaard

On 29/11/2011 15:58, Damien Fleuriot wrote:


On 11/29/11 1:58 PM, Erik Nørgaard wrote:

Today I finished make build/install world/kernel in /mnt, and now I no
longer have network access, interfaces are visible with ifconfig but
no ip is set and can't be set from within the chroot environment.

Is this to be expected? How do I get my network access back?

Should add: Network on the host FBSD81 system works fine.


When you chroot to your /mnt/ folder you're still using the 8.x kernel
and thus the 8.x NIC drivers, with a 9.x userland.

This might be your problem.


That seems strange though, first, drivers are loaded into the kernel so 
there is no mismatch there, 8.1 drivers in 8.1 kernel. And then, this is 
the output from ifconfig, first the chroot environment, then the host 
environment:


FreeBSD chroot # ifconfig
re0: flags=8943UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST metric 0 
mtu 1500 
options=389bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC

ether e0:69:95:77:f1:20
media: Ethernet autoselect (100baseTX full-duplex)
status: active
plip0: flags=8810POINTOPOINT,SIMPLEX,MULTICAST metric 0 mtu 1500
lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST metric 0 mtu 16384
options=3RXCSUM,TXCSUM
pflog0: flags=141UP,RUNNING,PROMISC metric 0 mtu 33200
FreeBSD chroot # exit

alpha# ifconfig
re0: flags=8943UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST metric 0 
mtu 1500

options=389bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC
ether e0:69:95:77:f1:20
inet 192.168.0.1 netmask 0xfe00 broadcast 192.168.1.255
media: Ethernet autoselect (100baseTX full-duplex)
status: active
plip0: flags=8810POINTOPOINT,SIMPLEX,MULTICAST metric 0 mtu 1500
lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST metric 0 mtu 16384
options=3RXCSUM,TXCSUM
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff00
nd6 options=3PERFORMNUD,ACCEPT_RTADV
pflog0: flags=141UP,RUNNING,PROMISC metric 0 mtu 33200

So, the devices are there, just no network connectivity.


What are you trying to achieve with this, a smooth 8.x -  9.x transition ?


Well, I don't know what happened on the host system, but the kernel 
fails building, even kernel 8.2, at if_vlan. Since I decided to migrate 
to the other disk and upgrade to 9.0 I created a chrooted environment on 
the new disk and build sources there.


Now, the tricky part is that this is a headless system and I need it to 
be up or at least be sure that I can roll back if something fails.



You may want to, instead, install your 9.0 on a different machine
(possibly a VM), then use dump on the filesystems to inject them
properly on your new disk on the original machine.

You should then be able to reboot on the new disk just fine.


Thanks, for the suggestion, but sounds risky, the disks are not 
identical size.


It seems I have a workaround that will get my new disk ready: Using 
fetch-recursive I've downloaded the sources of the ports I need 
installed, so I can build in the chroot without network access.


BR, Erik

--
M: +34 666 334 818
T: +34 915 211 157
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: No network in mixed FBSD81/90 chroot environment

2011-11-29 Thread Damien Fleuriot


On 29 Nov 2011, at 23:27, Erik Nørgaard norga...@locolomo.org wrote:

 On 29/11/2011 15:58, Damien Fleuriot wrote:
 
 On 11/29/11 1:58 PM, Erik Nørgaard wrote:
 Today I finished make build/install world/kernel in /mnt, and now I no
 longer have network access, interfaces are visible with ifconfig but
 no ip is set and can't be set from within the chroot environment.
 
 Is this to be expected? How do I get my network access back?
 Should add: Network on the host FBSD81 system works fine.
 
 When you chroot to your /mnt/ folder you're still using the 8.x kernel
 and thus the 8.x NIC drivers, with a 9.x userland.
 
 This might be your problem.
 
 That seems strange though, first, drivers are loaded into the kernel so there 
 is no mismatch there, 8.1 drivers in 8.1 kernel. And then, this is the output 
 from ifconfig, first the chroot environment, then the host environment:
 
 FreeBSD chroot # ifconfig
 re0: flags=8943UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST metric 0 mtu 
 1500 
 options=389bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC
ether e0:69:95:77:f1:20
media: Ethernet autoselect (100baseTX full-duplex)
status: active
 plip0: flags=8810POINTOPOINT,SIMPLEX,MULTICAST metric 0 mtu 1500
 lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST metric 0 mtu 16384
options=3RXCSUM,TXCSUM
 pflog0: flags=141UP,RUNNING,PROMISC metric 0 mtu 33200
 FreeBSD chroot # exit
 
 alpha# ifconfig
 re0: flags=8943UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST metric 0 mtu 
 1500
 options=389bRXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC
ether e0:69:95:77:f1:20
inet 192.168.0.1 netmask 0xfe00 broadcast 192.168.1.255
media: Ethernet autoselect (100baseTX full-duplex)
status: active
 plip0: flags=8810POINTOPOINT,SIMPLEX,MULTICAST metric 0 mtu 1500
 lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST metric 0 mtu 16384
options=3RXCSUM,TXCSUM
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff00
nd6 options=3PERFORMNUD,ACCEPT_RTADV
 pflog0: flags=141UP,RUNNING,PROMISC metric 0 mtu 33200
 
 So, the devices are there, just no network connectivity.
 
 What are you trying to achieve with this, a smooth 8.x -  9.x transition ?
 
 Well, I don't know what happened on the host system, but the kernel fails 
 building, even kernel 8.2, at if_vlan. Since I decided to migrate to the 
 other disk and upgrade to 9.0 I created a chrooted environment on the new 
 disk and build sources there.
 
 Now, the tricky part is that this is a headless system and I need it to be up 
 or at least be sure that I can roll back if something fails.
 
 You may want to, instead, install your 9.0 on a different machine
 (possibly a VM), then use dump on the filesystems to inject them
 properly on your new disk on the original machine.
 
 You should then be able to reboot on the new disk just fine.
 
 Thanks, for the suggestion, but sounds risky, the disks are not identical 
 size.
 

Disk/slice sizes are not relevant, dunp only injects the actual data (ie 
files/folders)

You can dump a 20gb partition then import it into a 50gb one.


 It seems I have a workaround that will get my new disk ready: Using 
 fetch-recursive I've downloaded the sources of the ports I need installed, so 
 I can build in the chroot without network access.
 
 BR, Erik
 
 -- 
 M: +34 666 334 818
 T: +34 915 211 157
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


strange moment in chroot environment

2004-10-04 Thread Sergey Velikanov [UzPAK]
Hi

I use pw in chroot environment, everything is work, but pw
always says that unable to parse auth.conf, I've discovered that
error appear when pw call properties_read from libutil, I can't
understand why? I run strace twice, in chroot environment and normal
environment I discover next difference ( also difference I soo when
run proftpd in chroot and normal environments)

Could anybody help me to solve this problem.

 This is chroot

open(1
, O_RDONLY) = -1 ENOENT (No such file or directory)
issetugid(0x280b1434) = 0
open( %e %H:%M:%S %Z %Y, O_RDONLY) = -1 ENOENT (No such file or directory)
fstat(3, {st_mode=S_IFBLK|S_ISUID|S_ISGID|0440, st_rdev=makedev(108, 1935999081), 
...}) = 0 
write(3, 2004-09-27 11:47:02 [root:groupa..., 47) = 47 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
open(/etc/group, O_RDONLY) = 4 
fstat(4, {st_mode=057516, st_size=8511913699829643361, ...}) = 0 
lseek(4, 0, SEEK_CUR) = 0 
lseek(4, 0, SEEK_SET) = 0 
read(4, # $FreeBSD: src/etc/group,v 1.28..., 16384) = 738 
close(4) = 0 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
gettimeofday({7, 7}, NULL) = 0 
gettimeofday({17, 18}, NULL) = 0 
access(/bin/sh, X_OK) = 0 
lstat(/etc/login.conf, {st_mode=S_IFBLK|S_ISGID|S_ISVTX|0145, st_rdev=makedev(99, 
543883361), ...}) = 0 
stat(: %m, {st_mode=0154162, st_size=18446700587165669490, ...}) = 0 
open(r^E
 
fcntl(4, F_SETFD, FD_CLOEXEC) = 0 
read(4, [EMAIL PROTECTED]..., 260) = 260 
lseek(4, 32768, SEEK_SET) = 32768 
read(4, \16\0\371?\333=\323=\262;\255;\2179\2139n7h7I5B5#5\r5\356..., 16384) = 16384 
close(4) = 0 
open(/etc/auth.conf, O_RDONLY) = 4 
read(4, \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0..., 4096) = 231 
read(4, , 4096) = 0 
close(4) = 0 
gettimeofday({4294967295, 4294967295}, NULL) = 0 
socket(PF_UNIX, SOCK_DGRAM, 0) = 4 
fcntl(4, F_SETFD, FD_CLOEXEC) = 0 
connect(4, {sa_family=0xff /* AF_??? */, sa_data=-./012345\377\377\377\377\377}, 
106) = -1 ENOENT (No such file or directory 
connect(4, {sa_family=0x32 /* AF_??? */, sa_data=.5.2.1 2001/05}, 106) = 0 
sendto(4, /24 12:20:02 markm Exp $\0$1$\0$\0\0..., 74, 0, NULL, 0) = 74 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
fork() = 1649 
--- SIGCHLD (Child exited) --- 


 This is normal
open(1
, O_RDONLY) = 4
fstat(4, {st_mode=035115, st_size=7309429057448327794, ...}) = 0
read(4, ectory\0No such process\0Interrupt..., 7944) = 56
close(4) = 0 
fstat(3, {st_mode=S_IFCHR|0155, st_rdev=makedev(111, 1953824815), ...}) = 0 
write(3, 2004-09-27 10:44:44 [root:groupa..., 4 = 48 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
open(/etc/group, O_RDONLY) = 4 
fstat(4, {st_mode=057516, st_size=8511913699829643361, ...}) = 0 
lseek(4, 0, SEEK_CUR) = 0 
lseek(4, 0, SEEK_SET) = 0 
read(4, # $FreeBSD: src/etc/group,v 1.28..., 16384) = 443 
close(4) = 0 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
gettimeofday({7, 7}, NULL) = 0 
gettimeofday({17, 18}, NULL) = 0 
access(/bin/sh, X_OK) = 0 
lstat(/etc/login.conf, {st_mode=S_IFBLK|S_ISGID|S_ISVTX|0145, st_rdev=makedev(99, 
543883361), ...}) = 0 
stat(: %m, {st_mode=0154162, st_size=18446700587165669490, ...}) = 0 
open(r.
 
fcntl(4, F_SETFD, FD_CLOEXEC) = 0 
read(4, [EMAIL PROTECTED]..., 260) = 260 
lseek(4, 32768, SEEK_SET) = 32768 
read(4, \16\0\371?\333=\323=\262;\255;\2179\2139n7h7I5B5#5\r5\356..., 16384) = 16384 
close(4) = 0 
open(/etc/auth.conf, O_RDONLY) = 4 
read(4, \16\30:`\213\16\236l\212\36\260\301w\25\327\'K1\275\332..., 4096) = 231 
read(4, , 4096) = 0 
close(4) = 0 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
stat(/etc/nsswitch.conf, {st_mode=01, st_size=42949672969, ...}) = 0 
fork() = 1279 
--- SIGCHLD (Child exited) ---  
 


Sergey Velikanov
Technical  Division
National Data Network UzPAK
tel +(99871) 114-6326
e-mail:  [EMAIL PROTECTED]
http://www.uzpak.uz/


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: chroot environment

2003-12-07 Thread horio shoichi
On Sat, 6 Dec 2003 13:18:13 -0800
Nick Twaddell [EMAIL PROTECTED] wrote:
 I am trying to setup a chroot environment for some users.  I rebuilt the
 environment inside their userdir, copied all the appropriate binaries, libs,
 etc.  The part I am stumped on, is how do you make it so their account gets
 chrooted on login.  Since chroot can only be executed by root.  Some of the
 docs I found created a shell script that would sudo chroot and run it on
 login.  I am just wondering what everyone else recommends.
 
 Thanks
 
 Nick Twaddell
 
 
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
 

Answer1: security/chrootuid.

Answer2: Build jail(8) environment, install sshd, for example, on each
jail. Let each user login to the respective account.


horio shoichi

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


chroot environment

2003-12-06 Thread Nick Twaddell
I am trying to setup a chroot environment for some users.  I rebuilt the
environment inside their userdir, copied all the appropriate binaries, libs,
etc.  The part I am stumped on, is how do you make it so their account gets
chrooted on login.  Since chroot can only be executed by root.  Some of the
docs I found created a shell script that would sudo chroot and run it on
login.  I am just wondering what everyone else recommends.

Thanks

Nick Twaddell


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: chroot environment

2003-12-06 Thread Rob
If you've already built the environment, you're halfway to having a
jail(8) - this extends chroot(8) by creating a private process tree and
network interface. You can run an entire system inside a jail, including
sshd(8) to accept logins.

For ftp logins, ftpd(8) has builtin support for chrooting certain users -
see ftpchroot(5). There is also support for chrooting logins in the ssh.com
version of sshd - I believe this is /usr/ports/security/ssh2, but I haven't
checked.

Apart from this, I don't know a 'standard' way of doing it.

- Original Message -
From: Nick Twaddell [EMAIL PROTECTED]
Subject: chroot environment


 I am trying to setup a chroot environment for some users.  I rebuilt the
 environment inside their userdir, copied all the appropriate binaries,
libs,
 etc.  The part I am stumped on, is how do you make it so their account
gets
 chrooted on login.  Since chroot can only be executed by root.  Some of
the
 docs I found created a shell script that would sudo chroot and run it on
 login.  I am just wondering what everyone else recommends.

 Thanks

 Nick Twaddell


 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
[EMAIL PROTECTED]


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]