From owner-cvs-all Sat Dec 12 11:14:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA18992 for cvs-all-outgoing; Sat, 12 Dec 1998 11:14:58 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from apollo.backplane.com (apollo.backplane.com [209.157.86.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA18984 for ; Sat, 12 Dec 1998 11:14:54 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.1/8.9.1) id LAA46284; Sat, 12 Dec 1998 11:14:50 -0800 (PST) (envelope-from dillon) Date: Sat, 12 Dec 1998 11:14:50 -0800 (PST) From: Matthew Dillon Message-Id: <199812121914.LAA46284@apollo.backplane.com> To: "Jordan K. Hubbard" Cc: shmit@kublai.com, dima@best.net, des@flood.ping.uio.no, committers@FreeBSD.ORG Subject: proposed diffs for /etc/rc.local (was Re: /etc/rc.local ) References: <24130.913454380@zippy.cdrom.com> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk :> /etc/rc, remove references to rc.local by install scripts, and move it :> out of the source tree and into the attic. : :Hmmm. That's an idea. What do others think? Leave the hooks in to :execute it if found but otherwise take the "template" version out of :the tree completely. : :- Jordan Here's an (untestd) proposal. I changed the ordering slightly, too, updating motd prior to running /etc/rc.devfs to keep things neat. rc.local now contains nothing substantial beyond comments. I recommend keeping the rc.local in the CVS tree but not installing it in /etc if /etc already has one. What code, if any, do we have to adjust to change the way rc.local is installed? make install already seems to do the right thing, and if I understand sysinstall correctly it does the right thing too. (untested) diff included below. -Matt Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet Communications & God knows what else. (Please include original email in any response) Index: rc =================================================================== RCS file: /home/ncvs/src/etc/rc,v retrieving revision 1.162 diff -c -r1.162 rc *** rc 1998/12/11 08:25:12 1.162 --- rc 1998/12/12 19:04:22 *************** *** 352,362 **** echo . fi # Run rc.devfs if present to customify devfs [ -f /etc/rc.devfs ] && sh /etc/rc.devfs # Do traditional (but rather obsolete) rc.local file if it exists. ! [ -f /etc/rc.local ] && sh /etc/rc.local # Raise kernel security level. This should be done only after `fsck' has # repaired local file systems if you want the securelevel to be greater than 1. --- 352,377 ---- echo . fi + if [ "X${update_motd}" != X"NO" ]; then + T=/tmp/_motd + rm -f $T + uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T + awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T + cp $T /etc/motd + chmod 644 /etc/motd + rm -f $T + fi + # Run rc.devfs if present to customify devfs [ -f /etc/rc.devfs ] && sh /etc/rc.devfs # Do traditional (but rather obsolete) rc.local file if it exists. ! ! if [ -f /etc/rc.local ]; then ! echo -n 'starting local daemons:' ! sh /etc/rc.local ! echo '.' ! fi # Raise kernel security level. This should be done only after `fsck' has # repaired local file systems if you want the securelevel to be greater than 1. Index: rc.conf =================================================================== RCS file: /home/ncvs/src/etc/rc.conf,v retrieving revision 1.64 diff -c -r1.64 rc.conf *** rc.conf 1998/12/01 21:36:32 1.64 --- rc.conf 1998/12/12 19:04:23 *************** *** 170,175 **** --- 170,176 ---- ldconfig_paths_aout="/usr/lib/compat/aout /usr/X11R6/lib/aout /usr/local/lib/aout" # a.out shared library search paths kern_securelevel_enable="NO" # kernel security level (see init(8)), kern_securelevel="-1" # range: -1..2 ; `-1' is the most insecure + update_motd="YES" # update version info in /etc/motd (or NO) ############################################################## ### Allow local configuration override at the very end here ## Index: rc.local =================================================================== RCS file: /home/ncvs/src/etc/rc.local,v retrieving revision 1.25 diff -c -r1.25 rc.local *** rc.local 1997/06/25 15:15:13 1.25 --- rc.local 1998/12/12 19:04:23 *************** *** 3,24 **** # # $Id: rc.local,v 1.25 1997/06/25 15:15:13 ache Exp $ # - # If there is a global system configuration file, suck it in. - #if [ -f /etc/rc.conf ]; then - # . /etc/rc.conf - #fi - - T=/tmp/_motd - rm -f $T - uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T - awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T - cp $T /etc/motd - chmod 644 /etc/motd - rm -f $T - - echo -n 'starting local daemons:' - - # put your local stuff here - - echo '.' --- 3,15 ---- # # $Id: rc.local,v 1.25 1997/06/25 15:15:13 ache Exp $ # + # put your local stuff here or in /usr/local/etc/rc.d. If you put stuff + # here and want to make it programmer, bring in /etc/rc.conf and add + # your custom variables to /etc/rc.conf.local + # + # if [ -f /etc/rc.conf ]; then + # . /etc/rc.conf + # fi + # + # ... additional startup conditionals ... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message