dhclient exiting

New About Yours API Help
1.5 KB, Plain text
Hello,

I enjoy your shows but I didn't blink during "The story of PR 219251". I had to try it, and there's only one minor bug when I run dhclient:

# dhclient eth0
chroot
exiting.

The eth0 is CBSD's way of representing (renaming) the epair0b in this case. I found that if I set IP/route manually on eth0, network works. Even using dhcpcd instead of dhclient works. Running dhclient with truss produces https://gist.github.com/anonymous/36a4e2bf1760198971934ff609a7d0de#file-gistfile1-txt-L228. As it breaks on chroot, I looked at the code: https://svnweb.freebsd.org/base/head/sbin/dhclient/dhclient.c?revision=317915&view=markup#l507. Oleg, CBSD author tried this:

diff -ruN dhclient.c-o dhclient.c
--- dhclient.c-o        2017-10-08 13:06:59.134921000 +0300
+++ dhclient.c  2017-10-08 13:07:48.047004000 +0300
-504,8 +504,8

       if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS)
               error("can't limit route socket: %m");

-       if (chroot(_PATH_VAREMPTY) == -1)
-               error("chroot");
+//     if (chroot(_PATH_VEREMPTY) == -1)
+//             error("chroot");
       if (chdir("/") == -1)
               error("chdir(\"/\")");

That works, so I assume chroot is working. How can I figure out what is so special about /var/empty? Also, if you have any other jail manager you know has VNET sorted out, I would love to look at the differences.

I'm sorry for bothering, but you're the only guys who I heard ever talking about VNET/VIMAGE, so I didn't know who else to turn to. Thank you!

Regards,
meka
Pasted 1 month, 2 weeks ago — Expires in 320 days
URL: http://dpaste.com/3GSGKD3