Commit Graph

34 Commits

Author SHA1 Message Date
Mike Makonnen
337338ee00 Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
2004-10-07 13:55:26 +00:00
Ruslan Ermilov
3ee3cd3165 Replace shell's positional parameters safely. 2004-04-28 09:09:27 +00:00
Brooks Davis
3e091039ee Overhaul the /etc/rc.d/diskless script by splitting it out into
hostname, resolve, tmp, and var scripts.  The latter three are new and
were repo copied.  These scripts no longer depend on being booted with
and NFS root instead attempt to automaticly create mfs /tmp and /var
volumes if the they are not writable.  This behavior can be overridden
in /etc/rc.conf.

Reviewed by:    luigi, pjd
2004-03-23 23:22:35 +00:00
Pawel Jakub Dawidek
bd57d5b0f5 Mark scripts as not usable inside a jail by adding keyword 'nojail'.
Some suggestions from:	rwatson, Ruben de Groot <mail25@bzerk.org>
2004-03-08 12:25:05 +00:00
Brooks Davis
f0e62d30bd Don't run newaliases if sendmail_enable=NONE.
Submitted by:	Matt Peterson <matt at peterson dot org>
Approved by:	silence on freebsd-rc
2004-01-05 19:14:47 +00:00
Doug Barton
9f29b7170b Update references to rc.diskless[12] 2003-10-13 08:18:05 +00:00
Poul-Henning Kamp
e0f8a7e7af Fix typo.
Spotted by:	"Bjoern A. Zeeb" <bzeeb@zabbadoz.net>
2003-10-03 19:57:58 +00:00
Poul-Henning Kamp
027ec595a1 More checking if kenv actually know something.
Guard against test(1)-unfriendly outputs from kenv.
2003-10-03 19:07:31 +00:00
Poul-Henning Kamp
91c1935fe5 In case we have no /etc/resolv.conf, don't try to make it out of
thin blue air if the kenv doesn't have any info.

This improves the truth value of the comment above significantly and
reduces the bogous output on the console considerably.
2003-10-03 18:26:33 +00:00
John Hay
8a3a674f02 kenv moved from /usr/bin/ to /bin/. 2003-02-15 16:34:14 +00:00
Matthew Dillon
eb7bf00306 Do not unconditionally load the configuration files for the RCNG case.
Instead, load them as part of the rc.d system.  This allows us to prioritize
the initidiskless script so it runs before the configuration files are loaded
and allows us to get rid of the exit 2 hack in /etc/rc.  The exit 2 never
worked anyway since it did not unset the prior configuration, causing the
diskless code to not operate properly.

Do a major cleanup and revamping of the diskless code for RCNG.  This will
be backported to the non-RCNG scripts as well as -stable.

With suggestions from: Mike Makonnen <mtm@identd.net>
MFC after:	7 days
2002-12-22 22:18:41 +00:00
Jens Schweikhardt
143085107b Fix style bugs:
* Space -> tabs conversion.
* Removed blanks before semicolon in "if ... ; then".
* Proper indentation of misindented lines.
* Put a full stop after some comments.
* Removed whitespace at end of line.

Approved by:	silence from gordon
2002-10-12 10:31:31 +00:00
Ruslan Ermilov
7206028152 test -h is deprecated; use -L instead.
PR:             bin/40846
2002-10-01 13:29:45 +00:00
Poul-Henning Kamp
320d99c058 Use mdmfs(8) rather than rolling our own RAM-disks.
Sponsored by:	DARPA & NAI Labs.
2002-09-22 09:48:02 +00:00
Brian S. Dean
9f0af70eb1 Apply same fix as Rev 1.19 of /etc/rc.diskless2: create sendmail
required directories if sendmail_enable is not set to "none".

Suggested by:   gordon
2002-07-18 05:00:22 +00:00
Gordon Tetlow
242bd45fb4 Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.

Submitted by:   Mike Makonnen <makonnen@pacbell.net>
Reviewed by:    silence on -current and -hackers
Prodded by:     rwatson
2002-07-18 05:00:17 +00:00
David E. O'Brien
fc994f232c fix backwards spelling 2002-03-07 07:17:15 +00:00
David E. O'Brien
04e7d65aeb The usage of 'newaliases' needs to be after we know for sure that /usr
is mounted.

Submitted by:	rizzo
2002-02-23 01:49:20 +00:00
David E. O'Brien
5158a0f59f The existing bazaar and site-specific policy in rc.diskless1 is Just Wrong;
and looks like no other Unix diskless configuration I've ever seen.
Thus allow a more traditional /etc.

Note, the use of an MFS /var should also be settable.
Otherwise installing ports(packages) is just a total PITA.
2002-02-22 19:05:22 +00:00
Robert Watson
22e5e135e1 o Add a comment indicating that if /tmp==/var/tmp in rc.diskless2, the
md device and file system creation occurs *after* mtree is run, and
  as such an /var/tmp/* or /tmp/* entries will be under the mountpoint
  (or fail) rather than appearing in the md filesystems.  This prevents
  the creation of vi.recover, and might affect other localizations that
  rely on the mtree calls affecting these directories.
2001-12-26 17:18:39 +00:00
Robert Watson
0a79e75e5f Remeber to set the permissions on an md-backed /tmp to 01777, rather than
using the default of 0755.
2001-11-27 22:12:27 +00:00
Brian S. Dean
cd218bbaed Ensure that /var/log/lastlog exists so that login doesn't complain.
Submitted by:	Harti Brandt <brandt@fokus.gmd.de>
MFC after:	2 weeks
2001-10-17 14:30:19 +00:00
Ruslan Ermilov
0b381bf1fd Remove vestiges of MFS. 2001-06-01 10:07:28 +00:00
Brian S. Dean
44e0389495 * Simplify the population of the /etc memory filesystem. To avoid
the null mount, we currently create a temporary mfs on /tmp, copy
    /etc to /tmp, then mount /etc as mfs and copy everything back from
    /tmp, then delete the /tmp mfs.

    The patch eliminates the temporary /tmp mfs and the subsequent
    copying and simply populates the /etc mfs by copying from
    /conf/default/etc.  This requires that /conf/default/etc contain a
    complete copy of all the /etc stuff instead of just overrides.  I
    don't think that is too much of an extra step in setting up a
    diskless environment.

  * Provide the ability to make /tmp a memory filesystem independent
    of /var.  This removes the requirement that /tmp be a symlink to
    /var/tmp and this makes the diskless code work with the default
    filesystem layout.  If a seperate /tmp memory filesystem is
    created, the 'tmpsize' environment variable is used to determine
    its size (default to 10 Meg).

  * Reduce diffs between the -current and -stable versions of these
    files to a bare minimum.  Only the definition of the shell
    function 'mount_md' is different.

Not Objected to by: -arch@, -small@

MFC after: 2 days
2001-05-09 15:13:51 +00:00
Poul-Henning Kamp
92fa92b327 Don't mount a md(4) over /dev on DEVFS enabled diskless systems. 2001-05-01 20:13:59 +00:00
Warner Losh
9f474ffc5c Move to using md.
o create a simple wrapper function mount_md that makes it easy to
  move from mount_mfs.

# NOTE: you will need to MAKEDEV md[0123] in order for this to work.

Reviewed by: bsd, keichii
2001-04-25 05:46:40 +00:00
Warner Losh
c23b0b247d MFS: the MFS still applies to -current until such time as someone fixes
rc.diskless2 to use mdconfig rather than mount_mfs.  These changes are
still relevant to -current.
2001-04-24 07:02:01 +00:00
David E. O'Brien
a1c43e3fbb Add copyright notices. Other systems have been barrowing our /etc files
w/o giving any credit.
2000-10-08 19:20:36 +00:00
Sheldon Hearn
f66e7afa28 Add to defaults/rc.conf a new function source_rc_confs which rc
scripts may use to source safely overrides in ${rc_conf_files}
files.

This protects users who insist on the bad practice of copying
/etc/defaults/rc.conf to /etc/rc.conf from a recursive loop
that exhausts available file descriptors.

Several people have expressed interest in breaking this function
out into its own shell script.  Anyone who wants to embark on
such an undertaking would do well to study the attributed PR.

PR:		17595
Reported by:	adrian
Submitted by:	Doug Barton <Doug@gorean.org>
2000-04-27 08:43:49 +00:00
Luigi Rizzo
4f9b3f5f33 Cleanup diskless support in current, mostly aligning it to the one
in the 3.x branch. Also remove the dependency on /usr to find the
boot address/interface.
Mostly-submitted-abd-tested-by: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
2000-01-06 18:17:38 +00:00
Peter Wemm
6cabfb3832 Add/adjust some $FreeBSD$ tags.
Noted by:	Doug <Doug@gorean.org>
1999-09-13 17:09:08 +00:00
Sheldon Hearn
321704296f Apply a consistent style to most of the etc scripts. Particularly, use
case instead of test where appropriate, since case allows case is a sh
builtin and (as a side-effect) allows case-insensitivity.

Changes discussed on freebsd-hackers.

Submitted by:	Doug Barton <Doug@gorean.org>
1999-09-13 15:44:20 +00:00
Jordan K. Hubbard
9c63624e6f Use /etc/defaults/rc.conf everywhere, falling back to /etc/rc.conf
as necessary (for half-assed upgrades).
1999-02-10 18:08:16 +00:00
Matthew Dillon
e4715b9359 Revamp rc.diskless. Split into rc.diskless1 and rc.diskless2. provide
more opportunities for overriding.  Clean up /etc/rc ( remove conf_dir,
    remove startup mount special cases, remove other special cases )
1999-02-09 17:17:18 +00:00