Re: changes to rc.diskless*

2002-03-02 Thread David O'Brien

On Fri, Mar 01, 2002 at 03:04:28PM -0800, Brooks Davis wrote:
 -# If /tmp is a symlink, assume it points to somewhere writable, like
 -# /var/tmp, otherwise, use a small memory filesystem for /tmp.
 +# If /tmp is not writable, use a small memory filesystem for /tmp.
  #
  # XXX: mtree runs too early to create any directories needed in /tmp,
  # so if /var/tmp == /tmp, then you don't get a vi.recover.
  #
 -if [ ! -h /tmp ]; then
 +if /usr/bin/touch /tmp/_writable_test; then
 + rm /tmp/_writable_test
 +else
   mount_md ${tmpsize:=64m} /tmp 2
   chmod 01777 /tmp
  fi

I don't like this part -- because I use RW NFS mounted / (for sparc64
development), but I DO want a MFS /tmp as there is no need to do this
over the network.

Which just goes to show that your tests are not suffient.  Full rc.conf
knobs should be used instead.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: changes to rc.diskless*

2002-03-02 Thread Glenn Gombert

the diskless(s) scripts have a number of problems with them that need
to be fixed as well..inorder to get diskless kernels booting properly...

-- 
Glenn Gombert
[EMAIL PROTECTED] - email
(513) 587-2643 x2263 - voicemail/fax



 David O'Brien [EMAIL PROTECTED] wrote:
 On Fri, Mar 01, 2002 at 03:04:28PM -0800, Brooks Davis wrote:
  -# If /tmp is a symlink, assume it points to somewhere writable,
 like
  -# /var/tmp, otherwise, use a small memory filesystem for /tmp.
  +# If /tmp is not writable, use a small memory filesystem for /tmp.
   #
   # XXX: mtree runs too early to create any directories needed in
 /tmp,
   # so if /var/tmp == /tmp, then you don't get a vi.recover.
   #
  -if [ ! -h /tmp ]; then
  +if /usr/bin/touch /tmp/_writable_test; then
  + rm /tmp/_writable_test
  +else
mount_md ${tmpsize:=64m} /tmp 2
chmod 01777 /tmp
   fi
 
 I don't like this part -- because I use RW NFS mounted / (for sparc64
 development), but I DO want a MFS /tmp as there is no need to do this
 over the network.
 
 Which just goes to show that your tests are not suffient.  Full rc.conf
 knobs should be used instead.
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message
 

__
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com



msg35575/bin0.bin
Description: Binary data


msg35575/bin1.bin
Description: Binary data


msg35575/bin2.bin
Description: Binary data


Re: changes to rc.diskless*

2002-03-02 Thread Glenn Gombert

the diskless(s) scripts have a number of problems with them that need
to be fixed as well..inorder to get diskless kernels booting properly...

-- 
Glenn Gombert
[EMAIL PROTECTED] - email
(513) 587-2643 x2263 - voicemail/fax



 David O'Brien [EMAIL PROTECTED] wrote:
 On Fri, Mar 01, 2002 at 03:04:28PM -0800, Brooks Davis wrote:
  -# If /tmp is a symlink, assume it points to somewhere writable,
 like
  -# /var/tmp, otherwise, use a small memory filesystem for /tmp.
  +# If /tmp is not writable, use a small memory filesystem for /tmp.
   #
   # XXX: mtree runs too early to create any directories needed in
 /tmp,
   # so if /var/tmp == /tmp, then you don't get a vi.recover.
   #
  -if [ ! -h /tmp ]; then
  +if /usr/bin/touch /tmp/_writable_test; then
  + rm /tmp/_writable_test
  +else
mount_md ${tmpsize:=64m} /tmp 2
chmod 01777 /tmp
   fi
 
 I don't like this part -- because I use RW NFS mounted / (for sparc64
 development), but I DO want a MFS /tmp as there is no need to do this
 over the network.
 
 Which just goes to show that your tests are not suffient.  Full rc.conf
 knobs should be used instead.
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message
 

__
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com



msg35576/bin0.bin
Description: Binary data


msg35576/bin1.bin
Description: Binary data


msg35576/bin2.bin
Description: Binary data


Re: changes to rc.diskless*

2002-03-02 Thread Glenn Gombert

the diskless(s) scripts have a number of problems with them that need
to be fixed as well..inorder to get diskless kernels booting properly...

-- 
Glenn Gombert
[EMAIL PROTECTED] - email
(513) 587-2643 x2263 - voicemail/fax



 David O'Brien [EMAIL PROTECTED] wrote:
 On Fri, Mar 01, 2002 at 03:04:28PM -0800, Brooks Davis wrote:
  -# If /tmp is a symlink, assume it points to somewhere writable,
 like
  -# /var/tmp, otherwise, use a small memory filesystem for /tmp.
  +# If /tmp is not writable, use a small memory filesystem for /tmp.
   #
   # XXX: mtree runs too early to create any directories needed in
 /tmp,
   # so if /var/tmp == /tmp, then you don't get a vi.recover.
   #
  -if [ ! -h /tmp ]; then
  +if /usr/bin/touch /tmp/_writable_test; then
  + rm /tmp/_writable_test
  +else
mount_md ${tmpsize:=64m} /tmp 2
chmod 01777 /tmp
   fi
 
 I don't like this part -- because I use RW NFS mounted / (for sparc64
 development), but I DO want a MFS /tmp as there is no need to do this
 over the network.
 
 Which just goes to show that your tests are not suffient.  Full rc.conf
 knobs should be used instead.
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message
 

__
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com



msg35577/bin0.bin
Description: Binary data


msg35577/bin1.bin
Description: Binary data


msg35577/bin2.bin
Description: Binary data


Re: changes to rc.diskless*

2002-03-02 Thread David O'Brien

On Sat, Mar 02, 2002 at 01:31:25PM -0800, Glenn Gombert wrote:
 the diskless(s) scripts have a number of problems with them that need
 to be fixed as well..inorder to get diskless kernels booting properly...

And

actually since my last commit to them, diskless works OK except for /var.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: changes to rc.diskless*

2002-03-01 Thread Brooks Davis

On Thu, Feb 21, 2002 at 08:00:51PM -0800, David O'Brien wrote:
 The use of an MFS /var should also be settable  Otherwise installing
 ports(packages) is just a total PITA

Below is a patch I'd like to commit that may solve this problem in
most cases  This patch does the following:

- Makes creation of MFS /tmp and /var dependent on them being read-only
  It might be useful to make this configurable in rcconf, but I'm
  having a hard time coming up with a reasionable configuration this
  test will break
- Add pre and post hooks to the file in the spirit of the ones in
  /sbin/dhclient-script  I'm using the pre hook to automaticly decide
  if the local disk on my machines has the right layout and using
  Warner's diskprep script to rebuild it if needed

Any comments, suggestions, objections?  I'd like to commit in a couple
days

-- Brooks

Index: rcdiskless2
===
RCS file: /usr/cvs/src/etc/rcdiskless2,v
retrieving revision 117
diff -u -r117 rcdiskless2
--- rcdiskless223 Feb 2002 01:49:20 -  117
+++ rcdiskless21 Mar 2002 21:53:54 -
 -55,8 +55,20 
 /etc/rcconf
 fi
 
-echo +++ mount_md of /var
-mount_md ${varsize:=32m} /var 1
+# Invoke an optional pre mount script
+if [ -r /etc/rcdiskless2_pre ]; then
+/etc/rcdiskless2_pre
+fi
+
+mount -a   # chown, chgrp, and touch are in /usr
+
+# Create /var as a memory file system if needed
+if /usr/bin/touch /var/_writable_test; then
+   rm /var/_writable_test
+else
+   echo +++ mount_md of /var
+   mount_md ${varsize:=32m} /var 1
+fi
 
 echo +++ populate /var using /etc/mtree/BSDvardist
 /usr/sbin/mtree -deU -f /etc/mtree/BSDvardist -p /var
 -70,8 +82,6 
 echo +++ create lastlog
 /usr/bin/touch /var/log/lastlog
 
-mount -a   # chown and chgrp are in /usr
-
 # Since we are starting with a very fresh /etc on an MFS:
 if [ -d /conf/default/etc ]; then
newaliases
 -81,13 +91,14 
 # XXX make sure to create one dir for each printer as requested by lpd
 #
 
-# If /tmp is a symlink, assume it points to somewhere writable, like
-# /var/tmp, otherwise, use a small memory filesystem for /tmp
+# If /tmp is not writable, use a small memory filesystem for /tmp
 #
 # XXX: mtree runs too early to create any directories needed in /tmp,
 # so if /var/tmp == /tmp, then you don't get a virecover
 #
-if [ ! -h /tmp ]; then
+if /usr/bin/touch /tmp/_writable_test; then
+   rm /tmp/_writable_test
+else
mount_md ${tmpsize:=64m} /tmp 2
chmod 01777 /tmp
 fi
 -100,4 +111,9 
(cd /; find -x dev | cpio -o -H newc)  /tmp/devtmp
mount_md 4096 /dev 3 512
(cd /; cpio -i -H newc -d  /tmp/devtmp)
+fi
+
+# Invoke an optional post mount script
+if [ -r /etc/rcdiskless2_post ]; then
+/etc/rcdiskless2_post
 fi

-- 
Any statement of the form X is the one, true Y is FALSE
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4



msg35567/pgp0.pgp
Description: PGP signature


Re: changes to rc.diskless*

2002-02-22 Thread Brooks Davis

On Thu, Feb 21, 2002 at 08:00:51PM -0800, David O'Brien wrote:
 The use of an MFS /var should also be settable.  Otherwise installing
 ports(packages) is just a total PITA.

I had issues with the MFS /var and /tmp[0] a couple days ago and changed
the code to move the mount -a up before /var and /tmp creation and
then actually test to be sure they are not writable before attempting to
create MFS versions.  The logic was basicly:

if touch /var/_writable_test; then
rm /var/_writable_test
else
#create MFS var
fi

-- Brooks

[0] I've got a slightly strange configuration with network booting
cluster nodes which have a disk for /tmp, /var, and swap.

-- 
Any statement of the form X is the one, true Y is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4



msg35070/pgp0.pgp
Description: PGP signature


Re: changes to rc.diskless*

2002-02-22 Thread Robert Watson

On Fri, 22 Feb 2002, Brooks Davis wrote:

 On Thu, Feb 21, 2002 at 08:00:51PM -0800, David O'Brien wrote:
  The use of an MFS /var should also be settable.  Otherwise installing
  ports(packages) is just a total PITA.
 
 I had issues with the MFS /var and /tmp[0] a couple days ago and changed
 the code to move the mount -a up before /var and /tmp creation and
 then actually test to be sure they are not writable before attempting to
 create MFS versions.  The logic was basicly:
 
 if touch /var/_writable_test; then
   rm /var/_writable_test
 else
   #create MFS var
 fi
 
 -- Brooks
 
 [0] I've got a slightly strange configuration with network booting
 cluster nodes which have a disk for /tmp, /var, and swap.

One of the problems I have with a similar configuration is that the file
system checker never runs for local filesystems mounted on writable disks. 
I tend to mount everything nfs and mfs, except for a scratch drive and
swap, which are from the local hard disk.

Robert N M Watson FreeBSD Core Team, TrustedBSD Project
[EMAIL PROTECTED]  NAI Labs, Safeport Network Services



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: changes to rc.diskless*

2002-02-22 Thread Brooks Davis

On Fri, Feb 22, 2002 at 01:23:12PM -0500, Robert Watson wrote:
 
 One of the problems I have with a similar configuration is that the file
 system checker never runs for local filesystems mounted on writable disks. 
 I tend to mount everything nfs and mfs, except for a scratch drive and
 swap, which are from the local hard disk.

Hmm, that's odd.  They are definatly getting fsck'd on my test machine.

-- Brooks

-- 
Any statement of the form X is the one, true Y is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4



msg35074/pgp0.pgp
Description: PGP signature


Re: changes to rc.diskless*

2002-02-22 Thread Jake Burkholder

Apparently, On Thu, Feb 21, 2002 at 08:00:51PM -0800,
David O'Brien said words to the effect of;

 The existing very bazaar and local policy in rc.diskless1 is Just Wrong;
 and looks like no other Unix diskless configuration I've ever seen.  I
 plan on committing this patch to negate this.

Yay!

 
 The use of an MFS /var should also be settable.  Otherwise installing
 ports(packages) is just a total PITA.
 
 
 Index: rc.diskless2
 ===
 RCS file: /home/ncvs/src/etc/rc.diskless2,v
 retrieving revision 1.15
 diff -u -r1.15 rc.diskless2
 --- rc.diskless2  26 Dec 2001 17:18:39 -  1.15
 +++ rc.diskless2  22 Feb 2002 03:56:18 -
 @@ -56,7 +56,7 @@
  fi
  
  echo +++ mount_md of /var
 -mount_md ${varsize:=65536} /var 1
 +mount_md ${varsize:=32m} /var 1

One problem with making the mds so big is that it uses type malloc
which afaict uses malloc(9) to get the backing store.  This was the
point of the M_SHORTWAIT patch posted a while ago, if you ask for too
much with M_WAITOK you might go to sleep and never be woken up.  It
might be better to use type vnode with file or swap based backing
store.  sparc64 machines tend to have more ram than older pcs that
this might also be used on  :)

my $0.02.

Jake

  
  echo +++ populate /var using /etc/mtree/BSD.var.dist
  /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
 @@ -83,7 +83,7 @@
  # so if /var/tmp == /tmp, then you don't get a vi.recover.
  #
  if [ ! -h /tmp ]; then
 - mount_md ${tmpsize:=20480} /tmp 2
 + mount_md ${tmpsize:=64m} /tmp 2
   chmod 01777 /tmp
  fi
  
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: changes to rc.diskless*

2002-02-22 Thread Glenn Gombert

The rc.diskless1/2 scripts *do* need some work, I finally got my diskless
kernel booting (with help from Matt and Robert Watson) but it was a lot of
'trial and error' to do so...but well worthwhile to boot diskless
(test/experimental) kernels for developmental purposes .


At 08:00 PM 2/21/2002 -0800, David O'Brien wrote:
The existing very bazaar and local policy in rc.diskless1 is Just Wrong;
and looks like no other Unix diskless configuration I've ever seen.  I
plan on committing this patch to negate this.

The use of an MFS /var should also be settable.  Otherwise installing
ports(packages) is just a total PITA.


Index: rc.diskless1
===
RCS file: /home/ncvs/src/etc/rc.diskless1,v
retrieving revision 1.13
diff -u -r1.13 rc.diskless1
--- rc.diskless1   17 Jan 2002 00:10:28 -  1.13
+++ rc.diskless1   22 Feb 2002 03:52:41 -
@@ -92,13 +92,14 @@
 done
 echo Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast
${bootp_ipbca}
 
+if [ -d /conf/default/etc ]; then
+  mount_md 4096 /etc 0
+  chkerr $? MFS mount on /etc
+  /bin/chmod 755 /etc
 
-mount_md 4096 /etc 0
-chkerr $? MFS mount on /etc
-/bin/chmod 755 /etc
-
-/bin/cp -Rp /conf/default/etc/* /etc
-chkerr $? cp /conf/default/etc to /etc MFS
+  /bin/cp -Rp /conf/default/etc/* /etc
+  chkerr $? cp /conf/default/etc to /etc MFS
+fi
 
 # Allow for override files to replace files in /etc.  Use /conf/*/etc to
find
 # the override files.  First choice is default files that # always override,
@@ -113,6 +114,11 @@
   cp -Rp /conf/${i}/etc/* /etc
   fi
 done
+
+# Since we are starting with a very fresh /etc on an MFS:
+if [ -d /conf/default/etc ]; then
+  newaliases
+if
 
 # Tell /etc/rc to run the specified script after it does its mounts but
 # before it does anything else.
Index: rc.diskless2
===
RCS file: /home/ncvs/src/etc/rc.diskless2,v
retrieving revision 1.15
diff -u -r1.15 rc.diskless2
--- rc.diskless2   26 Dec 2001 17:18:39 -  1.15
+++ rc.diskless2   22 Feb 2002 03:56:18 -
@@ -56,7 +56,7 @@
 fi
 
 echo +++ mount_md of /var
-mount_md ${varsize:=65536} /var 1
+mount_md ${varsize:=32m} /var 1
 
 echo +++ populate /var using /etc/mtree/BSD.var.dist
 /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
@@ -83,7 +83,7 @@
 # so if /var/tmp == /tmp, then you don't get a vi.recover.
 #
 if [ ! -h /tmp ]; then
-  mount_md ${tmpsize:=20480} /tmp 2
+  mount_md ${tmpsize:=64m} /tmp 2
   chmod 01777 /tmp
 fi
 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message

Glenn Gombert
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



changes to rc.diskless*

2002-02-21 Thread David O'Brien

The existing very bazaar and local policy in rc.diskless1 is Just Wrong;
and looks like no other Unix diskless configuration I've ever seen.  I
plan on committing this patch to negate this.

The use of an MFS /var should also be settable.  Otherwise installing
ports(packages) is just a total PITA.


Index: rc.diskless1
===
RCS file: /home/ncvs/src/etc/rc.diskless1,v
retrieving revision 1.13
diff -u -r1.13 rc.diskless1
--- rc.diskless117 Jan 2002 00:10:28 -  1.13
+++ rc.diskless122 Feb 2002 03:52:41 -
@@ -92,13 +92,14 @@
 done
 echo Interface ${bootp_ifc} IP-Address ${bootp_ipa} Broadcast ${bootp_ipbca}
 
+if [ -d /conf/default/etc ]; then
+   mount_md 4096 /etc 0
+   chkerr $? MFS mount on /etc
+   /bin/chmod 755 /etc
 
-mount_md 4096 /etc 0
-chkerr $? MFS mount on /etc
-/bin/chmod 755 /etc
-
-/bin/cp -Rp /conf/default/etc/* /etc
-chkerr $? cp /conf/default/etc to /etc MFS
+   /bin/cp -Rp /conf/default/etc/* /etc
+   chkerr $? cp /conf/default/etc to /etc MFS
+fi
 
 # Allow for override files to replace files in /etc.  Use /conf/*/etc to find
 # the override files.  First choice is default files that # always override,
@@ -113,6 +114,11 @@
cp -Rp /conf/${i}/etc/* /etc
fi
 done
+
+# Since we are starting with a very fresh /etc on an MFS:
+if [ -d /conf/default/etc ]; then
+   newaliases
+if
 
 # Tell /etc/rc to run the specified script after it does its mounts but
 # before it does anything else.
Index: rc.diskless2
===
RCS file: /home/ncvs/src/etc/rc.diskless2,v
retrieving revision 1.15
diff -u -r1.15 rc.diskless2
--- rc.diskless226 Dec 2001 17:18:39 -  1.15
+++ rc.diskless222 Feb 2002 03:56:18 -
@@ -56,7 +56,7 @@
 fi
 
 echo +++ mount_md of /var
-mount_md ${varsize:=65536} /var 1
+mount_md ${varsize:=32m} /var 1
 
 echo +++ populate /var using /etc/mtree/BSD.var.dist
 /usr/sbin/mtree -deU -f /etc/mtree/BSD.var.dist -p /var
@@ -83,7 +83,7 @@
 # so if /var/tmp == /tmp, then you don't get a vi.recover.
 #
 if [ ! -h /tmp ]; then
-   mount_md ${tmpsize:=20480} /tmp 2
+   mount_md ${tmpsize:=64m} /tmp 2
chmod 01777 /tmp
 fi
 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: changes to rc.diskless*

2002-02-21 Thread Matthew Dillon


:The existing very bazaar and local policy in rc.diskless1 is Just Wrong;
:and looks like no other Unix diskless configuration I've ever seen.  I
:plan on committing this patch to negate this.
:
:The use of an MFS /var should also be settable.  Otherwise installing
:ports(packages) is just a total PITA.

While you've got rc.diskless* broken open it would be great if 
you could implement an override rc variable that completely overrides
the script.  i.e. so someone can set 'rc_diskless_script' in
/etc/rc.conf (on the server) and /etc/rc will run that instead of
/etc/rc.diskless1 if the machine is booted diskless.

The problem we face is that the rc.diskless* scripts are simply not
flexible enough to cover everyone's needs (or even most people's needs)
and we need to provide a mechanism to allow the sysad to write his own
without forcing him to edit a 'system standard' script (i.e.
/etc/rc.diskless1 itself).

In anycase, if you don't have time to add this I'd appreciate a head's
up after you are done-and-committed your diskless scripts and I will
have a go at it.

-Matt


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message