A jail with a dash in its name

krad kraduk at gmail.com
Tue Dec 21 14:04:08 UTC 2010


On 21 December 2010 13:21, Christer Solskogen
<christer.solskogen at gmail.com>wrote:

> On Tue, Dec 21, 2010 at 1:54 PM, Da Rock
> <freebsd-questions at herveybayaustralia.com.au> wrote:
>
> > However, whether or not a hyphen is allowed in the jail name is another
> > matter. Yes a hyphen is allowed in a hostname, but in the rc.conf the
> > hostname is set in a string (as mentioned before). Also, the jail name
> and
> > hostname don't need to be the same thing.
>
> Hence my email :-)
>
> This is how my rc.conf looks now:
> #jail configuration for forest-friend
> jail_forest-friend_rootdir="/usr/jails/forest-friend"
> jail_forest-friend_hostname="forest-friend"
> jail_forest-friend_ip="192.168.0.15"
>
> But still:
> [root at cheer /usr/local/share/jailcfg/templates/default/etc]#
> /etc/rc.d/jail
> /etc/rc.conf: jail_forest-friend_rootdir=/usr/jails/forest-friend: not
> found
> jail_forest-friend_hostname=forest-friend: not found
> jail_forest-friend_ip=192.168.0.15: not found
> Usage: /etc/rc.d/jail [fast|force|one](start|stop|restart|rcvar)
>
> --
> chs,
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe at freebsd.org"
>

Its a shell limitation, neither bash or sh allow '-' as a valid character in
a variable name

$ sh
$ test-car="test"
test-car=test: not found
$ test\car="test"
testcar=test: not found
$ test\\-car="test"
test\-car=test: not found


More information about the freebsd-questions mailing list