# Jails in FreeBSD 8.0



## ahankinson (Dec 15, 2009)

Hi all,

I have been getting a strange error when I attempt to start a jail in FreeBSD 8. In the jail's /var/log/messages file I'm getting the error:


```
Dec 14 23:45:52 jailname login: chflags(/dev/pts/1): No such file or directory
Dec 14 23:45:52 jailname login: chown(/dev/pts/1): No such file or directory
```

In my host system I can see that /dev is mounted in the jail:


```
host$ df -h
....
devfs                             1.0K    1.0K      0B   100%   /jails/jailname/dev
fdescfs                           1.0K    1.0K      0B   100%  /jails/jailname/dev/fd
```

and going to /jails/jailname/dev/pts on the host shows that there are two entries in that directory, 0 and 1.


```
host$ ls /jails/jailname/dev/pts
total 0
crw--w----  1 root  tty    0, 129 Dec 15 00:04 0
crw--w----  1 root  tty    0, 139 Dec 15 00:04 1
```

However, inside the jail:

```
jailname# ls /dev/pts
jailname#
```

Once it is booted, the jail runs normally, but booting takes a couple minutes. It has no third-party services in it (databases, webservers, mailservers, etc), so it wouldn't be hanging while they start.

The weird thing is that other jails on the same machine run perfectly fine - one jail has tomcat, apache & postgres running in it and it starts in under 10s. They don't have the /dev/pts error showing in their logs too.

I'm at a loss as to why this is happening. They are all running off the same basejail, created with ezjail-admin. I'm wondering if anyone has come across this, and if they have found a solution.


----------



## SirDice (Dec 15, 2009)

Add a *jail_<jailname>_devfs_enable="YES"* to /etc/rc.conf.


----------



## ahankinson (Dec 15, 2009)

Does that need to be in /etc/rc.conf even if it is already in /usr/local/ezjails/<jailname>?


----------



## SirDice (Dec 16, 2009)

Not sure, I never use ezjails. I always make my own, it's not that hard. The jail(8) man page is pretty clear on how to do it.


----------



## FRANCOIS (Dec 16, 2009)

ahankinson said:
			
		

> Does that need to be in /etc/rc.conf even if it is already in /usr/local/ezjails/<jailname>?



I found that document(I never used jail or ezjail, though I understand the concept)I hope it will be usefulhttp://www.scottro.net/qnd/qnd-ezjail.html


----------



## Wiedmann (Dec 16, 2009)

> ```
> Dec 14 23:45:52 jailname login: chflags(/dev/pts/1): No such file or directory
> Dec 14 23:45:52 jailname login: chown(/dev/pts/1): No such file or directory
> ```


You can ignore this message. This message only occurs if you do a:

```
jexec 1 login -f root
```
--> as outlined is another thread, you don't have access to the pts device from your current login shell if you are using jexec. (your current pts is created in the host system and not in the jail.

Just use:

```
jexec 1 tcsh
```

Or if you are using ezjail change "ezjail_default_execute" in "ezjail.conf" to:

```
ezjail_default_execute=tcsh
```
(That's used in "ezjail-admin console jailname")




> Once it is booted, the jail runs normally, but booting takes a couple minutes.


Well, if your problem is not related to the pts message.
(this message is only created if you "login" to a jail. Just read /var/log/messages" from outside a jail)


----------



## ahankinson (Dec 17, 2009)

Thank you all for your responses. It's good to know that I can ignore that message.

It turns out that the startup delay was caused by something completely different. I had assigned the jail an IP that my network admin had told me was free, but it turns out something else already had it. :r

I changed it and it works beautifully now.


----------

