Re: A jail with a dash in its name

2010-12-22 Thread Leon Meßner
On Tue, Dec 21, 2010 at 11:31:42PM +0100, Christer Solskogen wrote:
 On Tue, Dec 21, 2010 at 9:26 PM, Matthew Seaman
 m.sea...@infracaninophile.co.uk wrote:
 
  Of course, there's no problem with using the form 'forest-friend' on the
  RHS of any assignments, so long as it's properly quoted, of course.
 
 
 Thanks for all your help!
 I chose to remove all hyphens instead.

I use ezjail and have jails with hyphens. Everything works fine there.

salut,
Leon
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


A jail with a dash in its name

2010-12-21 Thread Christer Solskogen
I want to create a jail called forest-friend. And having a dash in the
name seems to create problems for me.

/etc/rc.conf: jail_forest-friend_rootdir=/usr/jails/forest-friend: not found

how do I escape that?

-- 
chs,
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread krad
On 21 December 2010 10:58, Christer Solskogen
christer.solsko...@gmail.comwrote:

 I want to create a jail called forest-friend. And having a dash in the
 name seems to create problems for me.

 /etc/rc.conf: jail_forest-friend_rootdir=/usr/jails/forest-friend: not
 found

 how do I escape that?

 --
 chs,
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to 
 freebsd-questions-unsubscr...@freebsd.org


i'd stay away from characters like that. It should be ok in theory to use
but in my experience it is more likely to cause problems in the future
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Christer Solskogen
On Tue, Dec 21, 2010 at 12:06 PM, krad kra...@gmail.com wrote:
 i'd stay away from characters like that. It should be ok in theory to use
 but in my experience it is more likely to cause problems in the future


There's no problem of having a dash in a hostname, so why should it be
in a jailname?

-- 
chs,
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Chris Rees
On 21 December 2010 11:23, Christer Solskogen
christer.solsko...@gmail.com wrote:
 On Tue, Dec 21, 2010 at 12:06 PM, krad kra...@gmail.com wrote:
 i'd stay away from characters like that. It should be ok in theory to use
 but in my experience it is more likely to cause problems in the future


 There's no problem of having a dash in a hostname, so why should it be
 in a jailname?


You tried single quotes?

Chris
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Christer Solskogen
On Tue, Dec 21, 2010 at 12:28 PM, Chris Rees utis...@gmail.com wrote:
 You tried single quotes?



How? Where? :-)

jail_'forest-friend'_rootdir=/usr/jails/forest-friend also gives
/etc/rc.conf: jail_forest-friend_rootdir=/usr/jails/forest-friend:
not found

-- 
chs,
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Robert Bonomi
 From owner-freebsd-questi...@freebsd.org  Tue Dec 21 04:58:59 2010
 Date: Tue, 21 Dec 2010 11:58:38 +0100
 From: Christer Solskogen christer.solsko...@gmail.com
 To: FreeBSD Mailing List freebsd-questions@freebsd.org
 Subject: A jail with a dash in its name

 I want to create a jail called forest-friend. And having a dash in the
 name seems to create problems for me.

 /etc/rc.conf: jail_forest-friend_rootdir=/usr/jails/forest-friend: not found

 how do I escape that?

It looks to me like yo're chasing the wrong problem.

That statement appears to be a shell variable assignment, yet the 
error message indicates that the system is trying to find an executable
by the name of the entire expression.

You need to show us the actual line in /etc/rc.conf _and_ the surrounding
context. 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Christer Solskogen
On Tue, Dec 21, 2010 at 1:11 PM, Robert Bonomi bon...@mail.r-bonomi.com wrote:
 That statement appears to be a shell variable assignment, yet the
 error message indicates that the system is trying to find an executable
 by the name of the entire expression.

 You need to show us the actual line in /etc/rc.conf _and_ the surrounding
 context.


part of rc.conf:

jail_forest-friend_rootdir=/usr/jails/forest-friend
jail_forest-friend_hostname=forest-friend
jail_forest-friend_ip=192.168.0.15

cheer# /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@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Da Rock

On 12/21/10 22:48, Christer Solskogen wrote:

On Tue, Dec 21, 2010 at 1:11 PM, Robert Bonomibon...@mail.r-bonomi.com  wrote:
   

That statement appears to be a shell variable assignment, yet the
error message indicates that the system is trying to find an executable
by the name of the entire expression.

You need to show us the actual line in /etc/rc.conf _and_ the surrounding
context.

 

part of rc.conf:

jail_forest-friend_rootdir=/usr/jails/forest-friend
jail_forest-friend_hostname=forest-friend
jail_forest-friend_ip=192.168.0.15

cheer# /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)


   
I believe what was referred to earlier was the lack of quotes- as in . 
The rc variables in the conf are strings, so your rc.conf should have this:


jail_forest-friend_rootdir=/usr/jails/forest-friend
jail_forest-friend_ip=192.168.0.15

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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Christer Solskogen
On Tue, Dec 21, 2010 at 1:54 PM, Da Rock
freebsd-questi...@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:
[r...@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@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread krad
On 21 December 2010 13:21, Christer Solskogen
christer.solsko...@gmail.comwrote:

 On Tue, Dec 21, 2010 at 1:54 PM, Da Rock
 freebsd-questi...@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:
 [r...@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@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to 
 freebsd-questions-unsubscr...@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
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Ivan Voras

On 21/12/2010 12:23, Christer Solskogen wrote:

On Tue, Dec 21, 2010 at 12:06 PM, kradkra...@gmail.com  wrote:

i'd stay away from characters like that. It should be ok in theory to use
but in my experience it is more likely to cause problems in the future



There's no problem of having a dash in a hostname, so why should it be
in a jailname?


Well, the immediate reason here is this:

http://www.gnu.org/software/bash/manual/bashref.html#Definitions


name
A word consisting solely of letters, numbers, and underscores, and 
beginning with a letter or underscore. Names are used as shell variable 
and function names. Also referred to as an identifier.



(ignoring that /bin/sh is not bash but the syntax is the same for this 
purpose).


/etc/rc.conf is basically a shell script containing only variable 
assignments.


I think you actually *could* have jails with arbitrary names (including 
international / utf-8 if you're not worried about formatting much) but 
only if you are going to manage them manually, not with /etc/rc.conf.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: A jail with a dash in its name

2010-12-21 Thread Matthew Seaman
On 21/12/2010 12:11, Robert Bonomi wrote:
 I want to create a jail called forest-friend. And having a dash in the
  name seems to create problems for me.
 
  /etc/rc.conf: jail_forest-friend_rootdir=/usr/jails/forest-friend: not 
  found
 
  how do I escape that?

You don't.

rc.conf uses bourne shell syntax.  The entries are all variable
initializations.  jail_forest-friend_rootdir is illegal as a variable
name -- you can't have a '-' character in there.

I suggest you /call/ your jail forest_friend and use that form in
everything that appears on the LHS of an assignment in rc.conf.

Of course, there's no problem with using the form 'forest-friend' on the
RHS of any assignments, so long as it's properly quoted, of course.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: A jail with a dash in its name

2010-12-21 Thread Christer Solskogen
On Tue, Dec 21, 2010 at 9:26 PM, Matthew Seaman
m.sea...@infracaninophile.co.uk wrote:

 Of course, there's no problem with using the form 'forest-friend' on the
 RHS of any assignments, so long as it's properly quoted, of course.


Thanks for all your help!
I chose to remove all hyphens instead.

-- 
chs
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org