View Full Version : [Solved] Mount linprocfs in jail
noobster
August 3rd, 2009, 21:17
What is the easiest/best way to mount linprocfs in a jail? I tried searching the web, but there were surprisingly few results. Thanks.
SirDice
August 3rd, 2009, 21:19
You could try putting the entry in /etc/fstab.jailname and set jail_jailname_fstab="YES" in /etc/rc.conf.
Not sure if this will work for linprocfs though.
noobster
August 3rd, 2009, 21:36
Thanks for the prompt response. I tried, but it doesn't show up when I run mount.
noobster
August 3rd, 2009, 21:43
I also tried mounting it manually from the host system, but again it doesn't show up in mount.
SirDice
August 3rd, 2009, 21:43
It will get mounted when you /etc/rc.d/jail start.
And it won't show up in mount on the jail too ;)
Only the 'root' file system will show up. Doesn't mean it's not there though.
SirDice
August 3rd, 2009, 21:47
Oh wait.. It's jail_jailname_mount_enable="YES"
noobster
August 3rd, 2009, 23:58
Thanks again. So I did the following. I created /etc/fstab.jailname and inserted 'linproc /compat/linux/proc linprocfs rw 0 0'. I made sure that directory exists in the jail. In /etc/rc.conf I added jail_jailname_mount_enable="YES" and then I restarted the jail. Now, how can I check if it really works if it doesn't show up in mount?
SirDice
August 4th, 2009, 07:16
Now, how can I check if it really works if it doesn't show up in mount?
If the jail is running it should show up in the host's mount. Just not the jail's.
You can also set the sysctl security.jail.enforce_statfs see jail about this.
noobster
August 4th, 2009, 07:48
It works now! I did have to change 'linproc /compat/linux/proc linprocfs rw 0 0' to 'linproc /path-to-jail/usr/compat/linux/proc linprocfs rw 0 0', because it's relative to the host and not the jail. Thanks for your help.
SirDice
August 4th, 2009, 11:17
The added bonus of using /etc/fstab.jailname is that those filesystems will get mounted/unmounted when the jail itself starts/stops.
I use it to mount (using nullfs) a couple of directories from my /storage into a jail running apache.
noobster
August 4th, 2009, 19:57
Yes, I figured that ;).
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.