Re: jail on ZFS - Unable to mount devfs

2008-01-08 Thread Wesley Shields
On Tue, Jan 08, 2008 at 07:08:04AM -0800, snowcrash+freebsd wrote:
 hi patrick,
 
  If I remember correctly there was no password file for in the jail. I
  think you have to rerun a certain command. Of course I do not remember the
  command :( The command should create the master password database.
 
 using the ServiceJail model, after populating the jail skeleton and
 running mergemaster, the two commands i run are,
 
  /usr/bin/cap_mkdb /j/jSKEL/etc/login.conf
  /usr/sbin/pwd_mkdb -d /j/jSKEL/etc -p /j/j/etc/master.passwd
 
 which should take care of that.
 
  Also you have to run within in the jail newaliases to create the aliases
  file, do a touch /etc/fstab to stop complaints about unable to read
  mountpoints.
 
 hm.  i did not do that this time around.  i'd built my jail-world with
 *both* NO_MAILWRAPPER=true  NO_SENDMAIL=true, so i mayhave caused
 myself a problem.
 
 rather than cp'ing bins, tobe safe, i'll just rebuild world ... and
 see in a bit if that helps.
 
 thanks.
 
  Furthermore I am not sure that you can run a jail on a zfs file system.
  The setup I have is that I run my jails on ufs and have a zfs filesystem
  available within the jail.
 
 ??
 
 if that's true, then that renders the rest moot -- and i have a problem.
 
 atm, i have
 
 cat /etc/fstab
   /dev/mirror/gm0s1a /bootdirufs rw1 1
   /dev/mirror/gm0s1b noneswapsw0 0
   /dev/acd0  /cdrom  cd9660  ro,noauto 0 0
   /j/jMROOT  /j/jTESTnullfs  ro0 0
   /j/s/jTEST /j/jTEST/s  nullfs  rw0 0
 
 zfs list
   NAME  USED  AVAIL  REFER  MOUNTPOINT
   z5.23G   213G   250M  /z
   z/data 20K   213G20K  /data
   z/home   28.5K   213G  28.5K  /home
   z/j23K   213G23K  /j
   z/tmp 406K   213G   406K  /tmp
   z/usr4.88G   213G  4.88G  /usr
   z/var 105M   213G   105M  /var
 
 where z/j is a zfs mount.
 
 i *can* access the jail, and do just about 'all' i need to in the jail
 (builds, exec, etc).
 
 but do *not* yet know if, by running the jail on zfs space whehter
 i've compromised anything.
 
 do you have a reference for your comment?  or, perhaps, someone else
 can comment, as well?

I have a jail running in a ZFS environment.

[EMAIL PROTECTED] ~ % jls
   JID  IP Address  Hostname  Path
 3  192.168.1.100   asterisk  /u/jails/asterisk
[EMAIL PROTECTED] ~ % mount | grep data
data on /u (zfs, NFS exported, local, noatime)
[EMAIL PROTECTED] ~ % mount | grep devfs
devfs on /dev (devfs, local)
devfs on /u/jails/asterisk/dev (devfs, local)
[EMAIL PROTECTED] ~ % 

-- WXS
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Bash scripting -- Usage of arrays

2005-11-29 Thread Wesley Shields
On Wed, Nov 30, 2005 at 02:39:15AM +0530, Jayesh Jayan wrote:
 Hi,
 
 Today I was trying to script using arrays in FreeBSD 5.4 but it doesn't
 work.
 
 Below is a sample script which I used.
 
 **
 
 #!/bin/bash
 
 array=( zero one two three four);
 echo Elements in array0:  [EMAIL PROTECTED]
 
 **
 
 It works fine on RedHat server.
 
 Below is the output.
 
 # sh array.sh
 Elements in array0:  zero one two three four
 
 Below is the out put from the FreeBSD server using the same code.
 
 -bash-2.05b# sh aa.sh
 aa.sh: 3: Syntax error: word unexpected (expecting ))
 
 Please guide me on how to use arrays on freebsd too.

Bash (installed via ports) is in /usr/local/bin.  Change the first line
to be #!/usr/local/bin/bash and chmod 750 (at least) the script.  This
way you can just ./aa.sh and be done.

If you prefer to run it as you have shown above don't run sh aa.sh,
instead do bash aa.sh, assuming bash is in your path.  sh aa.sh will try
and run the script through sh (which is not bash).

[EMAIL PROTECTED] ~  ls -la foo.sh
-rwxr-xr-x  1 wxs  wxs  97 Nov 29 16:26 foo.sh*
[EMAIL PROTECTED] ~  cat foo.sh
#!/usr/local/bin/bash

array=( zero one two three four);
echo Elements in array0:  [EMAIL PROTECTED]
[EMAIL PROTECTED] ~  bash ./foo.sh
Elements in array0:  zero one two three four
[EMAIL PROTECTED] ~  ./foo.sh
Elements in array0:  zero one two three four
[EMAIL PROTECTED] ~  sh ./foo.sh
./foo.sh: 3: Syntax error: word unexpected (expecting ))
[EMAIL PROTECTED] ~ 

-- WXS
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]