jails Creating a devfs link inside (thin)jail

Hi,
I've set up a thinjail in which I want to run ntpd.
To improve the ntpd accuracy, I want to use a gps receiver with pps.
I managed to pass the /dev/cuau0 device without problems into the jail, but ntpd expects /dev/gps0 to read the gps receivers messages from.
But I can't manage to create the link inside the jail.

My devfs.rules I am using looks like this:
Code:
# cat /etc/devfs.rules 
[devfsrules_jail_ntp=51]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add path pf unhide
add path cuau0 unhide
add path gps0 unhide
add path pps0 unhide

What I tried:
1. Manually creating the link inside the jail:
Code:
# jexec -u root ntp
root@ntp:/ # cd /dev/
root@ntp:/dev # ls
cuau0   fd      null    pf      pts     random  stderr  stdin   stdout  urandom zero    zfs
root@ntp:/dev # ln -s cuau0 gps0
ln: gps0: Operation not permitted

2. Adding the following line to the devfs.rules of the host
Code:
add path cuau0 link gps0 unhide

3. Putting the following in /etc/devfs.conf of the jail:
Code:
link cuau0 gps0

None of these made /dev/gps0 show up in the jail...
What is the correct way to create a devfs link inside a jail?
 
for those devfs rules (numbered 51) to apply to a jail, you have to have devfs_ruleset="51"; in the jail config. configure that on the host and start the jail with that option and you should be golden.

the symlink should just be cosmetic. if you can't get that to apply, tell ntpd to work with cuau0 instead.
 
Back
Top