How does mtree know where to start, when creating a hierarchy?

Greetings,

I'm creating a port that I want to chroot(8) into a specific hierarchy. I'm using /etc/mtree/BIND.chroot.dist as a model. I've read the chroot(8) man(1) page. But as I examine /etc/mtree/BIND.chroot.dist:

Code:
/set type=dir uname=root gname=wheel mode=0755
.
    dev             mode=0555
    ..
    etc
        namedb
            dynamic uname=bind
            ..
            master
            ..
            slave   uname=bind
            ..
            working uname=bind
            ..
        ..
    ..
/set type=dir uname=bind gname=wheel mode=0755
    var             uname=root
        dump
        ..
        log
        ..
        run
            named
            ..
        ..
        stats
        ..
    ..
..

I can't see where mtree(8) knows to start the creation process in /var/named. Can someone clear this up for me?

Thank you for all your time, and consideration.

--chris
 
I think it uses the current directory unless you supply it with the -p parameter.

Code:
-p path
	   Use the file hierarchy rooted in path, instead of the current
	   directory.
 
Greetings @SirDice, and thank you very much for the reply.

Right you are.

Code:
# /etc/named
	# Create (or update) the chroot directory structure
	#
	if [ -r /etc/mtree/BIND.chroot.dist ]; then
		mtree -deU -f /etc/mtree/BIND.chroot.dist \
		    -p ${named_chrootdir}
____________________^^
I should have seen this myself. I don't know how I missed it. Apologies for the "noise", and thanks again.

--chris
 
Last edited by a moderator:
Back
Top