# /etc/rc.d/jail does not set jailname



## uffe (Sep 13, 2010)

/etc/rc.d/jail does not set jailname.

Using FreeBSD 8.1-STABLE I've found that the standard /etc/rc.d/jail script does not create jails with "proper" names.

If you inspect your running jails (the ones started with /etc/rc.jail) with `# jls -n` you will see that jailname is equal to the jail id (jid)

Now I know that this is not directly a bug - but merely a matter of approach in /etc/rc.d/jail. Jails created without specific/explicit names will get their jid as the jailname by default.

But having "jid" and "jailname" equal each other reduces the usability for utilities like jls and jps that according to their man pages can take either jid or jailname as an argument.

The next question is what the jailname actually should be set to ?

1) should it be the jail "name" as referred to in /etc/rc.conf (eg "xyz" as in "jail_xyz_ip") ?

2) should it be the hostname (jail_xyz_hostname=) ?

3) or should the jailname have a (new) separate attribute in /etc/rc.conf (eg. "jail_xyz_name") ?


What is your opinion about this ? should I file a bug or take the discussion onto the freebsd-rc mailinglist ?


----------



## SirDice (Sep 14, 2010)

uffe said:
			
		

> The next question is what the jailname actually should be set to ?
> 
> 1) should it be the jail "name" as referred to in /etc/rc.conf (eg "xyz" as in "jail_xyz_ip") ?


Nope



> 2) should it be the hostname (jail_xyz_hostname=) ?


Nope



> 3) or should the jailname have a (new) separate attribute in /etc/rc.conf (eg. "jail_xyz_name") ?


Sounds good.



> What is your opinion about this ? should I file a bug or take the discussion onto the freebsd-rc mailinglist ?


It's not a bug because the scripts do exactly what they're supposed to do. 

In the mean time you can use:

```
jail_xyz_flags="-n somename"
```


----------



## uffe (Sep 14, 2010)

SirDice said:
			
		

> It's not a bug because the scripts do exactly what they're supposed to do.



Thanks for your reply.

Agree it is not a bug - it is more an enhancement of an existing feature.

I'm not a FBSD committer - where would I put such a request ?

Thanks.


----------



## SirDice (Sep 14, 2010)

uffe said:
			
		

> I'm not a FBSD committer - where would I put such a request ?


Send a PR.

http://www.freebsd.org/send-pr.html


----------

