RE: Please review: rc file changes
-Original Message- From: Aled Morris [mailto:[EMAIL PROTECTED]] Sent: 01 September 1999 16:51 It does apply in the UK - two spaces is pretty standard. I guess this isn't an Americanism (for once!) Not everywhere in the UK, or maybe it's an age related thing. I was never taught to use double-spaces and never have used them. Rich -- Rich Wood Home: [EMAIL PROTECTED], [EMAIL PROTECTED] Work: [EMAIL PROTECTED], [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
RE: Please review: rc file changes
-Original Message- From: Aled Morris [mailto:al...@routers.co.uk] Sent: 01 September 1999 16:51 It does apply in the UK - two spaces is pretty standard. I guess this isn't an Americanism (for once!) Not everywhere in the UK, or maybe it's an age related thing. I was never taught to use double-spaces and never have used them. Rich -- Rich Wood Home: r...@dynamite.org, r...@freebsd.org.uk Work: r...@ruh-bath.swest.nhs.uk, r...@systemagic.co.uk To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Sat, 28 Aug 1999, Matthew Dillon wrote: :I've never heard of that. I've always found that two spaces : after end-of-sentence punctuation makes things easier to read! : :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Doesn't apply here in Europe. I vote against putting in too much starsstripes dependent stuff... ;-) Andrzej Bialecki // [EMAIL PROTECTED] WebGiro AB, Sweden (http://www.webgiro.com) // --- // -- FreeBSD: The Power to Serve. http://www.freebsd.org // --- Small Embedded FreeBSD: http://www.freebsd.org/~picobsd/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Wed, 1 Sep 1999, Andrzej Bialecki wrote: On Sat, 28 Aug 1999, Matthew Dillon wrote: :I've never heard of that. I've always found that two spaces : after end-of-sentence punctuation makes things easier to read! : :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Doesn't apply here in Europe. I vote against putting in too much starsstripes dependent stuff... ;-) Andrzej Bialecki It does apply in the UK - two spaces is pretty standard. I guess this isn't an Americanism (for once!) Aled To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Wed 1999-09-01 (16:40), Andrzej Bialecki wrote: :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Doesn't apply here in Europe. I vote against putting in too much starsstripes dependent stuff... ;-) I was about to mention something about Britain, but I suppose we can't go about calling them European. (: And (at least in my school, which tries its best to appear British and colonial, and more recently my university) here in .za the convention persists. Of course, we could, like me, just never use more than one sentence per paragraph (making sure we use the correct conjunctions), which has always caused havoc in my brief involvement in user education and documentation. I'd also like to advocate the return of the semi-colon; it is underused. (Follow-ups to -chat) Neil -- Neil Blakey-Milner [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Sat, 28 Aug 1999, Matthew Dillon wrote: :I've never heard of that. I've always found that two spaces : after end-of-sentence punctuation makes things easier to read! : :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Doesn't apply here in Europe. I vote against putting in too much starsstripes dependent stuff... ;-) Andrzej Bialecki // ab...@webgiro.com WebGiro AB, Sweden (http://www.webgiro.com) // --- // -- FreeBSD: The Power to Serve. http://www.freebsd.org // --- Small Embedded FreeBSD: http://www.freebsd.org/~picobsd/ To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Wed, 1 Sep 1999, Andrzej Bialecki wrote: On Sat, 28 Aug 1999, Matthew Dillon wrote: :I've never heard of that. I've always found that two spaces : after end-of-sentence punctuation makes things easier to read! : :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Doesn't apply here in Europe. I vote against putting in too much starsstripes dependent stuff... ;-) Andrzej Bialecki It does apply in the UK - two spaces is pretty standard. I guess this isn't an Americanism (for once!) Aled To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Wed 1999-09-01 (16:40), Andrzej Bialecki wrote: :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Doesn't apply here in Europe. I vote against putting in too much starsstripes dependent stuff... ;-) I was about to mention something about Britain, but I suppose we can't go about calling them European. (: And (at least in my school, which tries its best to appear British and colonial, and more recently my university) here in .za the convention persists. Of course, we could, like me, just never use more than one sentence per paragraph (making sure we use the correct conjunctions), which has always caused havoc in my brief involvement in user education and documentation. I'd also like to advocate the return of the semi-colon; it is underused. (Follow-ups to -chat) Neil -- Neil Blakey-Milner n...@rucus.ru.ac.za To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Sat, 28 Aug 1999 16:46:11 MST, Doug wrote: Hoping I'm running out of nits, :-) Hi Doug, I've had a week-end away from a keyboard to think about this. The only reason we have to use case statements for case-insensitive variable testing is because sh(1) doesn't offer any upper/lower case handling parameter expansions (something like ${foo~lower} for example). When sh(1) _does_ offer something like this, a lot more work will be involved in using it once your proposed changes have gone in. Therefore, I propose that we create functions isyes() and isno() to wrap up the case-handling logic. This means we end up using if isyes(${foo}); then ... fi Later, when upper/lower case handling is available, we could either change the internals of the isyes() and isno() functions, or replace their invocations with case ${foo~lower} in yes) ... ;; *) ... ;; esac Wotchathink? Ciao, Sheldon. PS: I just finished off rc.network; what a bitch. :-) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
I've had a week-end away from a keyboard to think about this. The only reason we have to use case statements for case-insensitive variable testing is because sh(1) doesn't offer any upper/lower case handling Also so that common settings can be added. Besides "yes" and "no" there could be other forms of wanting and not wanting. -- -- David([EMAIL PROTECTED] -or- [EMAIL PROTECTED]) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Mon, 30 Aug 1999, David O'Brien wrote: I've had a week-end away from a keyboard to think about this. The only reason we have to use case statements for case-insensitive variable testing is because sh(1) doesn't offer any upper/lower case handling Also so that common settings can be added. Besides "yes" and "no" there could be other forms of wanting and not wanting. I'm all but done with the rc* files and moving on to the other places in /etc that use test currently. There are 6 states that take 99% of the cases into account: yes no !yes !no presence-of-a-variable absence-of-a-variable Frankly, I'm not sure what the proposed functions get us. Current tools take all of those possible conditions into account, and adding custom hacks for common cases will increase the likelihood of people writing extremely non-portable scripts with them. Maybe I'm missing something though... Also, keep in mind that it's not just case sensitivity that we're working with here. It's also the fact that case is a sh builtin, as opposed to test which is not. If you want to see what I've got so far check out http://gorean.org/rcfiles/ Doug -- "My mama told me, my mama said, 'don't cry.' She said, 'you're too young a man to have as many women you got.' I looked at my mother dear and didn't even crack a smile. I said, 'If women kill me, I don't mind dyin!'" - John Belushi as "Joliet" Jake Blues, "I Don't Know" To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Sat, 28 Aug 1999 16:46:11 MST, Doug wrote: Hoping I'm running out of nits, :-) Hi Doug, I've had a week-end away from a keyboard to think about this. The only reason we have to use case statements for case-insensitive variable testing is because sh(1) doesn't offer any upper/lower case handling parameter expansions (something like ${foo~lower} for example). When sh(1) _does_ offer something like this, a lot more work will be involved in using it once your proposed changes have gone in. Therefore, I propose that we create functions isyes() and isno() to wrap up the case-handling logic. This means we end up using if isyes(${foo}); then ... fi Later, when upper/lower case handling is available, we could either change the internals of the isyes() and isno() functions, or replace their invocations with case ${foo~lower} in yes) ... ;; *) ... ;; esac Wotchathink? Ciao, Sheldon. PS: I just finished off rc.network; what a bitch. :-) To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
I've had a week-end away from a keyboard to think about this. The only reason we have to use case statements for case-insensitive variable testing is because sh(1) doesn't offer any upper/lower case handling Also so that common settings can be added. Besides yes and no there could be other forms of wanting and not wanting. -- -- David(obr...@nuxi.com -or- obr...@freebsd.org) To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Mon, 30 Aug 1999, David O'Brien wrote: I've had a week-end away from a keyboard to think about this. The only reason we have to use case statements for case-insensitive variable testing is because sh(1) doesn't offer any upper/lower case handling Also so that common settings can be added. Besides yes and no there could be other forms of wanting and not wanting. I'm all but done with the rc* files and moving on to the other places in /etc that use test currently. There are 6 states that take 99% of the cases into account: yes no !yes !no presence-of-a-variable absence-of-a-variable Frankly, I'm not sure what the proposed functions get us. Current tools take all of those possible conditions into account, and adding custom hacks for common cases will increase the likelihood of people writing extremely non-portable scripts with them. Maybe I'm missing something though... Also, keep in mind that it's not just case sensitivity that we're working with here. It's also the fact that case is a sh builtin, as opposed to test which is not. If you want to see what I've got so far check out http://gorean.org/rcfiles/ Doug -- My mama told me, my mama said, 'don't cry.' She said, 'you're too young a man to have as many women you got.' I looked at my mother dear and didn't even crack a smile. I said, 'If women kill me, I don't mind dyin!' - John Belushi as Joliet Jake Blues, I Don't Know To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Sheldon Hearn wrote: Hi folks, What follows is a diff that presents Doug's changes (which must have required quite a bit of effort, thanks!) in a slightly different format which I think the grumpies here might prefer. Specifically, case statements look more like what a lot of folks are used to seeing, and conditionals that don't need to be case sensitive have not been converted to case statements. I think the effort which Doug has put into this is great and would make for a better rc. It's a pity that a few cosmetic issues generated so much pooh-pooh'ing. :-( It seems to me the changes are mostly cosmetic anyway, so naturally people complain about the cosmetics. I don't thing the [Yy][Ee][Ss] stuff is really nessecary. This is unix, and unix is case-sensitive. It should be obvious that the options is either YES or NO. Anyway, if it is so, I think readability (if that's important) could be made by adding two functions: isyes and isno, to be used as if isyes ${thisvariable} case $1 of [Yy][Ee][Ss]) exit 0 ;; *) exit 1 ;; esac Leif To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Sheldon Hearn wrote: Hi folks, What follows is a diff that presents Doug's changes (which must have required quite a bit of effort, thanks!) in a slightly different format which I think the grumpies here might prefer. Specifically, case statements look more like what a lot of folks are used to seeing, and conditionals that don't need to be case sensitive have not been converted to case statements. I think the effort which Doug has put into this is great and would make for a better rc. It's a pity that a few cosmetic issues generated so much pooh-pooh'ing. :-( It seems to me the changes are mostly cosmetic anyway, so naturally people complain about the cosmetics. I don't thing the [Yy][Ee][Ss] stuff is really nessecary. This is unix, and unix is case-sensitive. It should be obvious that the options is either YES or NO. Anyway, if it is so, I think readability (if that's important) could be made by adding two functions: isyes and isno, to be used as if isyes ${thisvariable} case $1 of [Yy][Ee][Ss]) exit 0 ;; *) exit 1 ;; esac Leif To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Sun, 29 Aug 1999 12:40:20 +0200, Leif Neland wrote: if isyes ${thisvariable} case $1 of [Yy][Ee][Ss]) exit 0 ;; *) exit 1 ;; esac I hope you mean in instead of of and return instead of exit. :-) I like this. One of the reasons I like it so much is because it will make Doug's changes more friendly towards a future migration to a new case-insensitive test(1) comparison (or even better, new case-handling sh(1) variable expansions) easier. Ciao, Sheldon. To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999 at 11:23:06AM -0700, Doug wrote: On Fri, 27 Aug 1999, Nate Williams wrote: Sentences are supposed to have two spaces before you start the next sentence. Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I did this change over on the FDP in the Handbook, thinking it didn't make any difference either. Then I got deluged with e-mail from people telling me that lots of editors use the double space as part of their heuristic to determine where sentences start and end. And I turned it back :-) N -- [intentional self-reference] can be easily accommodated using a blessed, non-self-referential dummy head-node whose own object destructor severs the links. -- Tom Christiansen in [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999, Doug wrote: -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I've never heard of that. I've always found that two spaces after end-of-sentence punctuation makes things easier to read! (Don't think I don't appreciate this, I just love to nitpick. :) -- |Chris Costello [EMAIL PROTECTED] |To iterate is human; to recurse, divine. ` To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999, Doug wrote: -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I've never heard of that. I've always found that two spaces after end-of-sentence punctuation makes things easier to read! (Don't think I don't appreciate this, I just love to nitpick. :) I vote for two spaces after the period before the start of a new sentence. Even in the digital age, I've always found that the two spaces make for better reading of text. I think that most of our formatting tools do this too (please don't flame me if I'm wrong :-). -Mike -- Mike Pritchard [EMAIL PROTECTED] or [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
:I've never heard of that. I've always found that two spaces : after end-of-sentence punctuation makes things easier to read! : :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make :for better reading of text. I think that most of our formatting :tools do this too (please don't flame me if I'm wrong :-). : :-Mike :-- :Mike Pritchard :[EMAIL PROTECTED] or [EMAIL PROTECTED] I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Two spaces has been burned into my brain since high school! (I wonder if I can sue?) GRIN. For proof, just look at all the postings I've ever made to these lists. I'm not nitpicking... I couldn't care less what other people do. But I think it's an amusing generational effect. -Matt Matthew Dillon [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Nik Clayton wrote: On Fri, Aug 27, 1999 at 11:23:06AM -0700, Doug wrote: On Fri, 27 Aug 1999, Nate Williams wrote: Sentences are supposed to have two spaces before you start the next sentence. Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I did this change over on the FDP in the Handbook, thinking it didn't make any difference either. Then I got deluged with e-mail from people telling me that lots of editors use the double space as part of their heuristic to determine where sentences start and end. And I turned it back :-) Okey dokey, I can take a hint. :) Doug To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Matthew Dillon wrote: I guess they don't teach manual typewriting classes any more :-) Actually I took that class in Jr. High School, way back in '77. It was the only good advice my Jr. High guidance counselor gave me. Doug To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Today Doug wrote: Matthew Dillon wrote: I guess they don't teach manual typewriting classes any more :-) Actually I took that class in Jr. High School, way back in '77. It was the only good advice my Jr. High guidance counselor gave me. Doug When I was in 8th grade (1964-65) you passed typing or you didn't go on to 9th grade, it was part of the district's required curriculum. I had a friend that ended up in summer school just to take typing. A single space after a period counted as two or three "incorrect characters" as I recall. -- Jack O'NeillSystems Administrator / Systems Analyst [EMAIL PROTECTED] Crystal Wind Communications, Inc. Finger [EMAIL PROTECTED] for my PGP key. PGP Key fingerprint = F6 C4 E6 D4 2F 15 A7 67 FD 09 E9 3C 5F CC EB CD enriched, vcard, HTML messages /dev/null -- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Cleaned up this post a little for the final (?) version of rc.diff. Back by popular demand, double spaces after the periods! Well, partly by popular demand and partly because I think it bouys my argument for a space after the case options. :) Note the changed URL for the real file. Without further comment this is the final verion of the rc file diff, but I will submit it along with the rest when I'm done. Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 1. -f - -r wherever it makes sense 2. value ) instead of value) for case statements 3. All cases of [, test, ; then, etc. converted to: if [ blah ]; then 4. Made # Comment # commands more consistent 5. Stripped whitespace off the end of a few lines 6. Tuned up a few of the comments in the file, as well as error output. I also was more rigorous about making whitespace consisten on this pass. Removing double spaces, converting spaces to tabs, etc. The attached diff is to rc, and was generated with -u. You can view the actual file at http://gorean.org/rcfiles/rc. I would appreciate y'all reviewing these changes for style, substance, or anything else relevant to the matter at hand. My hope is that any modifications can be discussed prior to my doing the rest of the work, which I plan to tackle this weekend. There are also a few questions sprinkled into the file, comments or suggestions on those are welcome. This version of the file is tested lightly, which is to say that I booted with it after my upgrade to the most recent sources on -current tonight. Obviously more rigorous testing will be necessary before this gets committed, although the changes are extremely straightforward. Questions: 1. Under what circumstances would $early_nfs_mounts be set? The only mention of this variable that I could find is in /etc/rc, and I can't see where it would be set. 2. Does the following constitute a security hole? # Make a bounds file for msgs(1) if there isn't one already # "Delete important files with symlink" security hole? # if [ ! -f /var/msgs/bounds ]; then echo 0 /var/msgs/bounds fi 3. Do we want to move to 'logger' instead of echo for the various little statements in the rc* files during boot? I for one would highly recommend this change, since it makes remote administration TONS easier. However the last time it came up I seem to remember it being one of those "religious" issues... I see this as step 3. of the project, and will go ahead with it after step 2. is done if there is no objection. 3. Anything else I should be looking at in this phase of the game? Doug --- /usr/src/etc/rc Sat Aug 28 13:51:10 1999 +++ rc Sat Aug 28 14:08:25 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. stty status '^T' # Set shell to ignore SIGINT (2), but not children; # shell catches SIGQUIT (3) and returns to single user after fsck. +# trap : 2 trap : 3 # shouldn't be needed -HOME=/; export HOME +HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -export PATH +export HOME PATH # BOOTP diskless boot. We have to run the rc file early in order to # retarget various config files. # -if [ -f /etc/rc.diskless1 ]; then +if [ -r /etc/rc.diskless1 ]; then dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2 /dev/null` if [ ${dlv:=0} != 0 ]; then . /etc/rc.diskless1 @@ -34,59 +35,68 @@ # If there is a global system configuration file, suck it in. # -if [ -f /etc/defaults/rc.conf ]; then +if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf -elif [ -f /etc/rc.conf ]; then +elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi # Configure ccd devices. -if [ -f /etc/ccd.conf ]; then +# +if [ -r /etc/ccd.conf ]; then ccdconfig -C fi -if [ "${start_vinum}" = "YES" ]; then +case ${start_vinum} in +[Yy][Ee][Ss] ) vinum start -elif [ -n "${vinum_drives}" ]; then - vinum read ${vinum_drives} -fi + ;; +* ) + if [ -n "${vinum_drives}" ]; then + vinum read ${vinum_drives} + fi + ;; +esac swapon -a -if [ "$1" = "autoboot" ]; then +case $1 in +autoboot ) echo Automatic reboot in progress... fsck -p case $? in - 0) + 0 ) ;; - 2) + 2 ) exit 1 ;; - 4) + 4 ) reboot echo "reboot failed... help!" exit 1
Re: Please review: rc file changes
On Sat, Aug 28, 1999, Tim Vanderhoek wrote: A sentence ends .Ar here . But this new one has a single space preceeding it. Does adding a space after the `.' at the end of your line help? Please, no trailing white space :-)! Seriously, I think that all of the current mdoc macros that allow puncuation characters to be specified screw this up and only add one space. Mdoc should be fixed to add two spaces in this case, and then if the man page author really does only want one space, they can do it with the existing Ns macro (no space). -Mike -- Mike Pritchard [EMAIL PROTECTED] or [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Doug wrote: Okey dokey, I can take a hint. :) Can you take another one, regarding the unnecessary spaces after the values in your "case"s? i.e., that they should be taken out and shot? :-) -- Ben Smithurst| PGP: 0x99392F7D [EMAIL PROTECTED] | key available from keyservers and | [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Doug wrote in list.freebsd-hackers: 2. value ) instead of value) for case statements Maybe I missed it, but what exactly is the reason for that change? I do not like it, it makes the case lines look strange. And I think there was a policy that style should not be changed if there's no good reason. Apart from that -- Good work! :) Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:[EMAIL PROTECTED]) "In jedem Stück Kohle wartet ein Diamant auf seine Geburt" (Terry Pratchett) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Ben Smithurst wrote: Doug wrote: Okey dokey, I can take a hint. :) Can you take another one, regarding the unnecessary spaces after the values in your "case"s? i.e., that they should be taken out and shot? :-) *sigh* I am constantly flabbergasted by what people think of as "important" around here. However, yes, I really can take the hint, and having seen no words of support on this I will revert the change. Hoping I'm running out of nits, Doug To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Sat, 28 Aug 1999, Doug wrote: Ben Smithurst wrote: Doug wrote: Okey dokey, I can take a hint. :) Can you take another one, regarding the unnecessary spaces after the values in your "case"s? i.e., that they should be taken out and shot? :-) *sigh* I am constantly flabbergasted by what people think of as "important" around here. However, yes, I really can take the hint, and having seen no words of support on this I will revert the change. Hoping I'm running out of nits, Heh. This thread is as good as the 'Jordan got bitten by Radius' one :) Doug -- :{ [EMAIL PROTECTED] Andy Farkas System Administrator Speednet Communications http://www.speednet.com.au/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999 at 11:23:06AM -0700, Doug wrote: On Fri, 27 Aug 1999, Nate Williams wrote: Sentences are supposed to have two spaces before you start the next sentence. Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I did this change over on the FDP in the Handbook, thinking it didn't make any difference either. Then I got deluged with e-mail from people telling me that lots of editors use the double space as part of their heuristic to determine where sentences start and end. And I turned it back :-) N -- [intentional self-reference] can be easily accommodated using a blessed, non-self-referential dummy head-node whose own object destructor severs the links. -- Tom Christiansen in 37514...@cs.colorado.edu To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999, Doug wrote: -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I've never heard of that. I've always found that two spaces after end-of-sentence punctuation makes things easier to read! (Don't think I don't appreciate this, I just love to nitpick. :) -- |Chris Costello ch...@calldei.com |To iterate is human; to recurse, divine. ` To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999, Doug wrote: -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I've never heard of that. I've always found that two spaces after end-of-sentence punctuation makes things easier to read! (Don't think I don't appreciate this, I just love to nitpick. :) I vote for two spaces after the period before the start of a new sentence. Even in the digital age, I've always found that the two spaces make for better reading of text. I think that most of our formatting tools do this too (please don't flame me if I'm wrong :-). -Mike -- Mike Pritchard m...@freebsd.org or m...@mpp.pro-ns.net To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Sat, Aug 28, 1999 at 05:45:05AM -0500, Mike Pritchard wrote: I vote for two spaces after the period before the start of a new sentence. Even in the digital age, I've always found that the two spaces make for better reading of text. I think that most of our formatting tools do this too (please don't flame me if I'm wrong :-). The manpages screw it up sometimes. [It's probably fair to assume you know when they do, but anyways... -- A sentence ends .Ar here . But this new one has a single space preceeding it. -- -- This is my .signature which gets appended to the end of my messages. To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Sat, Aug 28, 1999, Tim Vanderhoek wrote: A sentence ends .Ar here . But this new one has a single space preceeding it. Does adding a space after the `.' at the end of your line help? -- |Chris Costello ch...@calldei.com |**FLASH** Energizer Bunny arrested, charged with battery. `-- To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
:I've never heard of that. I've always found that two spaces : after end-of-sentence punctuation makes things easier to read! : :I vote for two spaces after the period before the start of a new sentence. :Even in the digital age, I've always found that the two spaces make :for better reading of text. I think that most of our formatting :tools do this too (please don't flame me if I'm wrong :-). : :-Mike :-- :Mike Pritchard :m...@freebsd.org or m...@mpp.pro-ns.net I guess they don't teach manual typewriting classes any more :-) It *had* to be two spaces or you got seriously marked down! Two spaces has been burned into my brain since high school! (I wonder if I can sue?) GRIN. For proof, just look at all the postings I've ever made to these lists. I'm not nitpicking... I couldn't care less what other people do. But I think it's an amusing generational effect. -Matt Matthew Dillon dil...@backplane.com To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Nik Clayton wrote: On Fri, Aug 27, 1999 at 11:23:06AM -0700, Doug wrote: On Fri, 27 Aug 1999, Nate Williams wrote: Sentences are supposed to have two spaces before you start the next sentence. Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. I did this change over on the FDP in the Handbook, thinking it didn't make any difference either. Then I got deluged with e-mail from people telling me that lots of editors use the double space as part of their heuristic to determine where sentences start and end. And I turned it back :-) Okey dokey, I can take a hint. :) Doug To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Matthew Dillon wrote: I guess they don't teach manual typewriting classes any more :-) Actually I took that class in Jr. High School, way back in '77. It was the only good advice my Jr. High guidance counselor gave me. Doug To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Today Doug wrote: Matthew Dillon wrote: I guess they don't teach manual typewriting classes any more :-) Actually I took that class in Jr. High School, way back in '77. It was the only good advice my Jr. High guidance counselor gave me. Doug When I was in 8th grade (1964-65) you passed typing or you didn't go on to 9th grade, it was part of the district's required curriculum. I had a friend that ended up in summer school just to take typing. A single space after a period counted as two or three incorrect characters as I recall. -- Jack O'NeillSystems Administrator / Systems Analyst j...@germanium.xtalwind.net Crystal Wind Communications, Inc. Finger j...@germanium.xtalwind.net for my PGP key. PGP Key fingerprint = F6 C4 E6 D4 2F 15 A7 67 FD 09 E9 3C 5F CC EB CD enriched, vcard, HTML messages /dev/null -- To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Cleaned up this post a little for the final (?) version of rc.diff. Back by popular demand, double spaces after the periods! Well, partly by popular demand and partly because I think it bouys my argument for a space after the case options. :) Note the changed URL for the real file. Without further comment this is the final verion of the rc file diff, but I will submit it along with the rest when I'm done. Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 1. -f - -r wherever it makes sense 2. value ) instead of value) for case statements 3. All cases of [, test, ; then, etc. converted to: if [ blah ]; then 4. Made # Comment # commands more consistent 5. Stripped whitespace off the end of a few lines 6. Tuned up a few of the comments in the file, as well as error output. I also was more rigorous about making whitespace consisten on this pass. Removing double spaces, converting spaces to tabs, etc. The attached diff is to rc, and was generated with -u. You can view the actual file at http://gorean.org/rcfiles/rc. I would appreciate y'all reviewing these changes for style, substance, or anything else relevant to the matter at hand. My hope is that any modifications can be discussed prior to my doing the rest of the work, which I plan to tackle this weekend. There are also a few questions sprinkled into the file, comments or suggestions on those are welcome. This version of the file is tested lightly, which is to say that I booted with it after my upgrade to the most recent sources on -current tonight. Obviously more rigorous testing will be necessary before this gets committed, although the changes are extremely straightforward. Questions: 1. Under what circumstances would $early_nfs_mounts be set? The only mention of this variable that I could find is in /etc/rc, and I can't see where it would be set. 2. Does the following constitute a security hole? # Make a bounds file for msgs(1) if there isn't one already # Delete important files with symlink security hole? # if [ ! -f /var/msgs/bounds ]; then echo 0 /var/msgs/bounds fi 3. Do we want to move to 'logger' instead of echo for the various little statements in the rc* files during boot? I for one would highly recommend this change, since it makes remote administration TONS easier. However the last time it came up I seem to remember it being one of those religious issues... I see this as step 3. of the project, and will go ahead with it after step 2. is done if there is no objection. 3. Anything else I should be looking at in this phase of the game? Doug--- /usr/src/etc/rc Sat Aug 28 13:51:10 1999 +++ rc Sat Aug 28 14:08:25 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. stty status '^T' # Set shell to ignore SIGINT (2), but not children; # shell catches SIGQUIT (3) and returns to single user after fsck. +# trap : 2 trap : 3 # shouldn't be needed -HOME=/; export HOME +HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -export PATH +export HOME PATH # BOOTP diskless boot. We have to run the rc file early in order to # retarget various config files. # -if [ -f /etc/rc.diskless1 ]; then +if [ -r /etc/rc.diskless1 ]; then dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2 /dev/null` if [ ${dlv:=0} != 0 ]; then . /etc/rc.diskless1 @@ -34,59 +35,68 @@ # If there is a global system configuration file, suck it in. # -if [ -f /etc/defaults/rc.conf ]; then +if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf -elif [ -f /etc/rc.conf ]; then +elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi # Configure ccd devices. -if [ -f /etc/ccd.conf ]; then +# +if [ -r /etc/ccd.conf ]; then ccdconfig -C fi -if [ ${start_vinum} = YES ]; then +case ${start_vinum} in +[Yy][Ee][Ss] ) vinum start -elif [ -n ${vinum_drives} ]; then - vinum read ${vinum_drives} -fi + ;; +* ) + if [ -n ${vinum_drives} ]; then + vinum read ${vinum_drives} + fi + ;; +esac swapon -a -if [ $1 = autoboot ]; then +case $1 in +autoboot ) echo Automatic reboot in progress... fsck -p case $? in - 0) + 0 ) ;; - 2) + 2 ) exit 1 ;; - 4) + 4 ) reboot echo reboot failed... help! exit 1 ;; - 8)
Re: Please review: rc file changes
On Sat, Aug 28, 1999, Tim Vanderhoek wrote: A sentence ends .Ar here . But this new one has a single space preceeding it. Does adding a space after the `.' at the end of your line help? Please, no trailing white space :-)! Seriously, I think that all of the current mdoc macros that allow puncuation characters to be specified screw this up and only add one space. Mdoc should be fixed to add two spaces in this case, and then if the man page author really does only want one space, they can do it with the existing Ns macro (no space). -Mike -- Mike Pritchard m...@freebsd.org or m...@mpp.pro-ns.net To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Doug wrote: Okey dokey, I can take a hint. :) Can you take another one, regarding the unnecessary spaces after the values in your cases? i.e., that they should be taken out and shot? :-) -- Ben Smithurst| PGP: 0x99392F7D b...@scientia.demon.co.uk | key available from keyservers and | ben+...@scientia.demon.co.uk To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Doug wrote in list.freebsd-hackers: 2. value ) instead of value) for case statements Maybe I missed it, but what exactly is the reason for that change? I do not like it, it makes the case lines look strange. And I think there was a policy that style should not be changed if there's no good reason. Apart from that -- Good work! :) Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:o...@dorifer.heim3.tu-clausthal.de) In jedem Stück Kohle wartet ein Diamant auf seine Geburt (Terry Pratchett) To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Ben Smithurst wrote: Doug wrote: Okey dokey, I can take a hint. :) Can you take another one, regarding the unnecessary spaces after the values in your cases? i.e., that they should be taken out and shot? :-) *sigh* I am constantly flabbergasted by what people think of as important around here. However, yes, I really can take the hint, and having seen no words of support on this I will revert the change. Hoping I'm running out of nits, Doug To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Sat, 28 Aug 1999, Doug wrote: Ben Smithurst wrote: Doug wrote: Okey dokey, I can take a hint. :) Can you take another one, regarding the unnecessary spaces after the values in your cases? i.e., that they should be taken out and shot? :-) *sigh* I am constantly flabbergasted by what people think of as important around here. However, yes, I really can take the hint, and having seen no words of support on this I will revert the change. Hoping I'm running out of nits, Heh. This thread is as good as the 'Jordan got bitten by Radius' one :) Doug -- :{ an...@speednet.com.au Andy Farkas System Administrator Speednet Communications http://www.speednet.com.au/ To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Thu, Aug 26, 1999, Doug wrote: 2. value ) instead of value) for case statements Why? What's wrong with `value)'? Nothing functionally, but I find case statements much easier to read with the extra whitespace. Would that not cause problems? [A-Z]* ) # ... matches "ZOUNDS " but not "ZOUNDS" ? ;; I'd think it might have trouble with that whitespace. And to quote sh(1)'s man page: The syntax of the case command is case word in pattern) list ;; esac -- |Chris Costello [EMAIL PROTECTED] |When a program is being tested, it is too late to make design changes. `-- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Chris Costello wrote: On Thu, Aug 26, 1999, Doug wrote: 2. value ) instead of value) for case statements Why? What's wrong with `value)'? Nothing functionally, but I find case statements much easier to read with the extra whitespace. Would that not cause problems? Nope. As most things shell it (rightly) ignores the whitespace. Take a look at this little script to prove it to yourself: #!/bin/sh VAR=foo case $VAR in foo ) echo "I don't care about whitespace" ;; foo) echo "OOoops, guess I do" ;; esac VAR='foo ' case $VAR in foo ) echo "D'oh! I see the whitespace in the variable" ;; foo) echo "D'oh! I don't see the whitespace in the variable" ;; 'foo ' ) echo "I see what I am supposed to see" ;; esac Doug To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Doug wrote in list.freebsd-hackers: [...] 2. value ) instead of value) for case statements [...] case $? in -0) +0 ) ;; -2) +2 ) exit 1 ;; -4) +4 ) reboot echo "reboot failed... help!" exit 1 ;; [...] Why?!? I like the existing "case" style _much_ better, it's more readable and emphasizes the structure. Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:[EMAIL PROTECTED]) "In jedem Stück Kohle wartet ein Diamant auf seine Geburt" (Terry Pratchett) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999, Oliver Fromme wrote: Why?!? I like the existing "case" style _much_ better, it's more readable and emphasizes the structure. I agree 100%. Regards Oliver -- |Chris Costello [EMAIL PROTECTED] |A computer scientist is someone who fixes things that aren't broken. ` To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Hi folks, What follows is a diff that presents Doug's changes (which must have required quite a bit of effort, thanks!) in a slightly different format which I think the grumpies here might prefer. Specifically, case statements look more like what a lot of folks are used to seeing, and conditionals that don't need to be case sensitive have not been converted to case statements. I think the effort which Doug has put into this is great and would make for a better rc. It's a pity that a few cosmetic issues generated so much pooh-pooh'ing. :-( Ciao, Sheldon. Index: rc === RCS file: /home/ncvs/src/etc/rc,v retrieving revision 1.194 diff -u -d -r1.194 rc --- rc 1999/08/25 16:01:33 1.194 +++ rc 1999/08/27 12:26:46 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. stty status '^T' # Set shell to ignore SIGINT (2), but not children; # shell catches SIGQUIT (3) and returns to single user after fsck. +# trap : 2 trap : 3 # shouldn't be needed -HOME=/; export HOME +HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -export PATH +export HOME PATH # BOOTP diskless boot. We have to run the rc file early in order to # retarget various config files. # -if [ -f /etc/rc.diskless1 ]; then +if [ -r /etc/rc.diskless1 ]; then dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2 /dev/null` if [ ${dlv:=0} != 0 ]; then . /etc/rc.diskless1 @@ -34,22 +35,28 @@ # If there is a global system configuration file, suck it in. # -if [ -f /etc/defaults/rc.conf ]; then +if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf -elif [ -f /etc/rc.conf ]; then +elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi # Configure ccd devices. -if [ -f /etc/ccd.conf ]; then +# +if [ -r /etc/ccd.conf ]; then ccdconfig -C fi -if [ "${start_vinum}" = "YES" ]; then +case ${start_vinum} in +[Yy][Ee][Ss]) vinum start -elif [ -n "${vinum_drives}" ]; then - vinum read ${vinum_drives} -fi + ;; +*) + if [ -n "${vinum_drives}" ]; then + vinum read ${vinum_drives} + fi + ;; +esac swapon -a @@ -94,35 +101,39 @@ # root normally must be read/write, but if this is a BOOTP NFS # diskless boot it does not have to be. # - -if [ "${root_rw_mount}" != "NO" ]; then +case ${root_rw_mount} in +[Nn][Oo]) + ;; +*) mount -u -o rw / -fi + ;; +esac if [ $? != 0 ]; then echo "Filesystem mount failed, startup aborted" + echo "Mounting root filesystem rw failed, startup aborted" exit 1 fi umount -a /dev/null 21 -if [ "${early_nfs_mounts}" != "YES" ]; then - mount -a -t nonfs -else +case ${early_nfs_mounts} in +[Yy][Ee][Ss]) mount -a -fi + ;; +*) + mount -a -t nonfs + ;; +esac if [ $? != 0 ]; then - echo "Filesystem mount failed, startup aborted" + echo "Mounting /etc/fstab filesystems failed, startup aborted" exit 1 fi # Run custom disk mounting function here # - -if [ -n "${diskless_mount}" ]; then - if [ -f "${diskless_mount}" ]; then - sh ${diskless_mount} - fi +if [ -n "${diskless_mount}" -a -r "${diskless_mount}" ]; then + sh ${diskless_mount} fi adjkerntz -i @@ -148,46 +159,64 @@ fi # Add additional swapfile, if configured. -if [ "${swapfile}" != "NO" -a -w "${swapfile}" -a -b /dev/vn0b ]; then - echo "Adding ${swapfile} as additional swap." - vnconfig /dev/vn0b ${swapfile} swapon /dev/vn0b -fi +# +case ${swapfile} in +[Nn][Oo]) + ;; +*) + if [ -w "${swapfile}" -a -b /dev/vn0b ]; then + echo "Adding ${swapfile} as additional swap." + vnconfig /dev/vn0b ${swapfile} swapon /dev/vn0b + fi + ;; +esac -# set sysctl variables early as we can -if [ -f /etc/rc.sysctl ]; then +# Set sysctl variables as early as we can +# +if [ -r /etc/rc.sysctl ]; then . /etc/rc.sysctl fi -# configure serial devices -if [ -f /etc/rc.serial ]; then +# Configure serial devices +# +if [ -r /etc/rc.serial ]; then . /etc/rc.serial fi -# start up PC-card configuration -if [ -f /etc/rc.pccard ]; then +# Start up PC-card configuration +# +if [ -r /etc/rc.pccard ]; then . /etc/rc.pccard fi -# start up the initial network configuration. -if [ -f /etc/rc.network ]; then +# Start up the initial network configuration. +# +if [ -r /etc/rc.network ]; then . /etc/rc.network # We only need to do this once. network_pass1 fi -echo -n "Mounting NFS file systems" -mount -a -t nfs -echo . +case ${early_nfs_mounts} in +[Yy][Ee][Ss]) + ;; +*)
Re: Please review: rc file changes
Sheldon Hearn wrote in list.freebsd-hackers: What follows is a diff that presents Doug's changes (which must have required quite a bit of effort, thanks!) Yeah -- Thanks Doug! Specifically, case statements look more like what a lot of folks are used to seeing, and conditionals that don't need to be case sensitive have not been converted to case statements. The case statements have another advantage over if/test -- case is a shell-builtin, test is not. Therefore, "case" is more efficient. I'd vote for using "case" instead of if/test where possible. I think the effort which Doug has put into this is great and would make for a better rc. It's a pity that a few cosmetic issues generated so much pooh-pooh'ing. :-( I'm very sorry that the suggestions in my previous mail caused a wrong impression. I appreciate Doug's work very much. Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:[EMAIL PROTECTED]) "In jedem Stück Kohle wartet ein Diamant auf seine Geburt" (Terry Pratchett) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
[...] 2. value ) instead of value) for case statements [...] case $? in - 0) + 0 ) ;; - 2) + 2 ) exit 1 ;; - 4) + 4 ) reboot echo "reboot failed... help!" exit 1 ;; [...] Why?!? I like the existing "case" style _much_ better, it's more readable and emphasizes the structure. And it is more conformant to 'style(9)', which says that the case statements line up with the switch statement. (Although that's for C code, in this case I believe the sh code can be compliant indirectly...) Nate To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Doug wrote: Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 1. -f - -r wherever it makes sense 2. value ) instead of value) for case statements 3. All cases of [, test, ; then, etc. converted to: if [ blah ]; then 4. Made # Comment # commands more consistent 5. Stripped whitespace off the end of a few lines The attached diff is to rc, and was generated with -ubB to ease understanding of the substantive changes. You can view the actual file at http://gorean.org/rc. I would appreciate y'all reviewing these changes for style, substance, or anything else relevant to the matter at hand. My hope is that any modifications can be discussed prior to my doing the rest of the work, which I plan to tackle this weekend. There are also a few questions sprinkled into the file, comments or suggestions on those are welcome. This version of the file is tested lightly, which is to say that I booted with it after my upgrade to the most recent sources on -current tonight. Obviously more rigorous testing will be necessary before this gets committed, although the changes are extremely straightforward. Questions: 1. Under what circumstances would $early_nfs_mounts be set? The only mention of this variable that I could find is in /etc/rc, and I can't see where it would be set. 2. Do we want to move to 'logger' instead of echo for the various little statements in the rc* files during boot? I for one would highly recommend this change, since it makes remote administration TONS easier. However the last time it came up I seem to remember it being one of those "religious" issues... 3. Anything else I should be looking at in this phase of the game? Ok, revised diff attached. I made the case indentation change and some of sheldon's suggestions are incorporated. I also neglected to mention previously that I tuned up a few of the comments in the file, as well as error output. I also was more rigorous about making whitespace consisten on this pass. Removing double spaces, converting spaces to tabs, etc. This is much more like what I want the final version to look like. All of the above still applies, except that due to the more "normal" indentation a straight diff -u is more readable. Assuming this works for everyone, I will proceed with the other rc*, etc. scripts, except rc.network which sheldon informed me he is currently working on. Doug --- /usr/src/etc/rc Thu Aug 26 20:56:36 1999 +++ rc Fri Aug 27 09:52:39 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. stty status '^T' # Set shell to ignore SIGINT (2), but not children; # shell catches SIGQUIT (3) and returns to single user after fsck. +# trap : 2 trap : 3 # shouldn't be needed -HOME=/; export HOME +HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -export PATH +export HOME PATH -# BOOTP diskless boot. We have to run the rc file early in order to +# BOOTP diskless boot. We have to run the rc file early in order to # retarget various config files. # -if [ -f /etc/rc.diskless1 ]; then +if [ -r /etc/rc.diskless1 ]; then dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2 /dev/null` if [ ${dlv:=0} != 0 ]; then . /etc/rc.diskless1 @@ -34,59 +35,68 @@ # If there is a global system configuration file, suck it in. # -if [ -f /etc/defaults/rc.conf ]; then +if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf -elif [ -f /etc/rc.conf ]; then +elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi # Configure ccd devices. -if [ -f /etc/ccd.conf ]; then +# +if [ -r /etc/ccd.conf ]; then ccdconfig -C fi -if [ "${start_vinum}" = "YES" ]; then +case ${start_vinum} in +[Yy][Ee][Ss] ) vinum start -elif [ -n "${vinum_drives}" ]; then - vinum read ${vinum_drives} -fi + ;; +* ) + if [ -n "${vinum_drives}" ]; then + vinum read ${vinum_drives} + fi + ;; +esac swapon -a -if [ "$1" = "autoboot" ]; then +case $1 in +autoboot ) echo Automatic reboot in progress... fsck -p case $? in - 0) + 0 ) ;; - 2) + 2 ) exit 1 ;; - 4) + 4 ) reboot echo "reboot failed... help!" exit 1 ;; - 8) + 8 ) echo "Automatic file system check
Re: Please review: rc file changes
[ I'm nit-picking here, feel free to ignore ] Doug--- /usr/src/etc/rc Thu Aug 26 20:56:36 1999 +++ rcFri Aug 27 09:52:39 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. Sentences are supposed to have two spaces before you start the next sentence. Thanks for doing this! Nate To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Doug wrote: Ok, revised diff attached. I made the case indentation change and some of sheldon's suggestions are incorporated. I also neglected to mention previously that I tuned up a few of the comments in the file, as well as error output. I also was more rigorous about making whitespace consisten on this pass. Removing double spaces, converting spaces to tabs, etc. This is Why only one space after full stops? I find two much more readable. In general though, I like the case insensitivity and the -r v. -f. David To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Nate Williams wrote: [ I'm nit-picking here, feel free to ignore ] A) You're in really good company. :) B) I expected a lot of nits to be picked on this project, which is why I wanted to do a "first draft" and solicit comments. I'm not overly concerned about getting _my_ way on a lot of these things, so long as we get a style that is consistent and that everyone can live with. Doug--- /usr/src/etc/rc Thu Aug 26 20:56:36 1999 +++ rc Fri Aug 27 09:52:39 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. Sentences are supposed to have two spaces before you start the next sentence. Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. Thanks for doing this! My pleasure actually. This project is something that I've wanted to see accomplished for several years. I'm happy that the momentum is swiging this way finally. Doug -- "My mama told me, my mama said, 'don't cry.' She said, 'you're too young a man to have as many women you got.' I looked at my mother dear and didn't even crack a smile. I said, 'If women kill me, I don't mind dyin!'" - John Belushi as "Joliet" Jake Blues, "I Don't Know" To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Maybe this is nit-picking, too, buth those are just my 0.02 Euros... Doug wrote in list.freebsd-hackers: -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file I'd prefer to keep it with two spaces, to improve readability. case $? in -0) +0 ) ;; -2) +2 ) exit 1 ;; -4) +4 ) I have yet to see a good reason for adding those spaces. I don't like them, but that's just me... Apart from the above -- Good work, Doug! Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:[EMAIL PROTECTED]) "In jedem Stück Kohle wartet ein Diamant auf seine Geburt" (Terry Pratchett) To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
On Thu, Aug 26, 1999, Doug wrote: Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 2. value ) instead of value) for case statements Why? What's wrong with `value)'? -- |Chris Costello ch...@calldei.com |Don't compare floating point numbers solely for equality. `- To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Chris Costello wrote: On Thu, Aug 26, 1999, Doug wrote: Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 2. value ) instead of value) for case statements Why? What's wrong with `value)'? Nothing functionally, but I find case statements much easier to read with the extra whitespace. Doug To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Thu, Aug 26, 1999, Doug wrote: 2. value ) instead of value) for case statements Why? What's wrong with `value)'? Nothing functionally, but I find case statements much easier to read with the extra whitespace. Would that not cause problems? [A-Z]* ) # ... matches ZOUNDS but not ZOUNDS ? ;; I'd think it might have trouble with that whitespace. And to quote sh(1)'s man page: The syntax of the case command is case word in pattern) list ;; esac -- |Chris Costello ch...@calldei.com |When a program is being tested, it is too late to make design changes. `-- To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Chris Costello wrote: On Thu, Aug 26, 1999, Doug wrote: 2. value ) instead of value) for case statements Why? What's wrong with `value)'? Nothing functionally, but I find case statements much easier to read with the extra whitespace. Would that not cause problems? Nope. As most things shell it (rightly) ignores the whitespace. Take a look at this little script to prove it to yourself: #!/bin/sh VAR=foo case $VAR in foo ) echo I don't care about whitespace ;; foo) echo OOoops, guess I do ;; esac VAR='foo ' case $VAR in foo ) echo D'oh! I see the whitespace in the variable ;; foo) echo D'oh! I don't see the whitespace in the variable ;; 'foo ' ) echo I see what I am supposed to see ;; esac Doug To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Doug wrote in list.freebsd-hackers: [...] 2. value ) instead of value) for case statements [...] case $? in -0) +0 ) ;; -2) +2 ) exit 1 ;; -4) +4 ) reboot echo reboot failed... help! exit 1 ;; [...] Why?!? I like the existing case style _much_ better, it's more readable and emphasizes the structure. Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:o...@dorifer.heim3.tu-clausthal.de) In jedem Stück Kohle wartet ein Diamant auf seine Geburt (Terry Pratchett) To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, Aug 27, 1999, Oliver Fromme wrote: Why?!? I like the existing case style _much_ better, it's more readable and emphasizes the structure. I agree 100%. Regards Oliver -- |Chris Costello ch...@calldei.com |A computer scientist is someone who fixes things that aren't broken. ` To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Doug wrote: If looking at the before and after seperately, the indentation of the case statements is IMHO bizzare and unlike anything I've seen before... eg: Changing this: if [ $1 = autoboot ]; then echo Automatic reboot in progress... fsck -p case $? in 0) ;; 2) exit 1 ;; 4) reboot echo reboot failed... help! exit 1 ;; 8) echo Automatic file system check failed... help! exit 1 ;; 12) echo Reboot interrupted exit 1 ;; 130) # interrupt before catcher installed exit 1 ;; *) echo Unknown error in reboot exit 1 ;; esac else echo Skipping disk checks ... fi To this: case $1 in autoboot ) echo Automatic reboot in progress... fsck -p case $? in 0 ) ;; 2 ) exit 1 ;; 4 ) reboot echo reboot failed... help! exit 1 ;; 8 ) echo Automatic file system check failed... help! exit 1 ;; 12 ) echo Reboot interrupted exit 1 ;; 130 ) # interrupt before catcher installed exit 1 ;; * ) echo Unknown error in reboot exit 1 ;; esac ;; * ) echo Skipping disk checks ... ;; esac In particular, the valuespace) and the hiding of the values in with the body. I presume the negative indent at the end is a typo... Cheers, -Peter To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Hi folks, What follows is a diff that presents Doug's changes (which must have required quite a bit of effort, thanks!) in a slightly different format which I think the grumpies here might prefer. Specifically, case statements look more like what a lot of folks are used to seeing, and conditionals that don't need to be case sensitive have not been converted to case statements. I think the effort which Doug has put into this is great and would make for a better rc. It's a pity that a few cosmetic issues generated so much pooh-pooh'ing. :-( Ciao, Sheldon. Index: rc === RCS file: /home/ncvs/src/etc/rc,v retrieving revision 1.194 diff -u -d -r1.194 rc --- rc 1999/08/25 16:01:33 1.194 +++ rc 1999/08/27 12:26:46 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. stty status '^T' # Set shell to ignore SIGINT (2), but not children; # shell catches SIGQUIT (3) and returns to single user after fsck. +# trap : 2 trap : 3 # shouldn't be needed -HOME=/; export HOME +HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -export PATH +export HOME PATH # BOOTP diskless boot. We have to run the rc file early in order to # retarget various config files. # -if [ -f /etc/rc.diskless1 ]; then +if [ -r /etc/rc.diskless1 ]; then dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2 /dev/null` if [ ${dlv:=0} != 0 ]; then . /etc/rc.diskless1 @@ -34,22 +35,28 @@ # If there is a global system configuration file, suck it in. # -if [ -f /etc/defaults/rc.conf ]; then +if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf -elif [ -f /etc/rc.conf ]; then +elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi # Configure ccd devices. -if [ -f /etc/ccd.conf ]; then +# +if [ -r /etc/ccd.conf ]; then ccdconfig -C fi -if [ ${start_vinum} = YES ]; then +case ${start_vinum} in +[Yy][Ee][Ss]) vinum start -elif [ -n ${vinum_drives} ]; then - vinum read ${vinum_drives} -fi + ;; +*) + if [ -n ${vinum_drives} ]; then + vinum read ${vinum_drives} + fi + ;; +esac swapon -a @@ -94,35 +101,39 @@ # root normally must be read/write, but if this is a BOOTP NFS # diskless boot it does not have to be. # - -if [ ${root_rw_mount} != NO ]; then +case ${root_rw_mount} in +[Nn][Oo]) + ;; +*) mount -u -o rw / -fi + ;; +esac if [ $? != 0 ]; then echo Filesystem mount failed, startup aborted + echo Mounting root filesystem rw failed, startup aborted exit 1 fi umount -a /dev/null 21 -if [ ${early_nfs_mounts} != YES ]; then - mount -a -t nonfs -else +case ${early_nfs_mounts} in +[Yy][Ee][Ss]) mount -a -fi + ;; +*) + mount -a -t nonfs + ;; +esac if [ $? != 0 ]; then - echo Filesystem mount failed, startup aborted + echo Mounting /etc/fstab filesystems failed, startup aborted exit 1 fi # Run custom disk mounting function here # - -if [ -n ${diskless_mount} ]; then - if [ -f ${diskless_mount} ]; then - sh ${diskless_mount} - fi +if [ -n ${diskless_mount} -a -r ${diskless_mount} ]; then + sh ${diskless_mount} fi adjkerntz -i @@ -148,46 +159,64 @@ fi # Add additional swapfile, if configured. -if [ ${swapfile} != NO -a -w ${swapfile} -a -b /dev/vn0b ]; then - echo Adding ${swapfile} as additional swap. - vnconfig /dev/vn0b ${swapfile} swapon /dev/vn0b -fi +# +case ${swapfile} in +[Nn][Oo]) + ;; +*) + if [ -w ${swapfile} -a -b /dev/vn0b ]; then + echo Adding ${swapfile} as additional swap. + vnconfig /dev/vn0b ${swapfile} swapon /dev/vn0b + fi + ;; +esac -# set sysctl variables early as we can -if [ -f /etc/rc.sysctl ]; then +# Set sysctl variables as early as we can +# +if [ -r /etc/rc.sysctl ]; then . /etc/rc.sysctl fi -# configure serial devices -if [ -f /etc/rc.serial ]; then +# Configure serial devices +# +if [ -r /etc/rc.serial ]; then . /etc/rc.serial fi -# start up PC-card configuration -if [ -f /etc/rc.pccard ]; then +# Start up PC-card configuration +# +if [ -r /etc/rc.pccard ]; then . /etc/rc.pccard fi -# start up the initial network configuration. -if [ -f /etc/rc.network ]; then +# Start up the initial network configuration. +# +if [ -r /etc/rc.network ]; then . /etc/rc.network # We only need to do this once. network_pass1 fi -echo -n Mounting NFS file systems -mount -a -t nfs -echo . +case ${early_nfs_mounts} in +[Yy][Ee][Ss]) + ;; +*) + echo -n Mounting NFS file systems +
Re: Please review: rc file changes
Sheldon Hearn wrote in list.freebsd-hackers: What follows is a diff that presents Doug's changes (which must have required quite a bit of effort, thanks!) Yeah -- Thanks Doug! Specifically, case statements look more like what a lot of folks are used to seeing, and conditionals that don't need to be case sensitive have not been converted to case statements. The case statements have another advantage over if/test -- case is a shell-builtin, test is not. Therefore, case is more efficient. I'd vote for using case instead of if/test where possible. I think the effort which Doug has put into this is great and would make for a better rc. It's a pity that a few cosmetic issues generated so much pooh-pooh'ing. :-( I'm very sorry that the suggestions in my previous mail caused a wrong impression. I appreciate Doug's work very much. Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:o...@dorifer.heim3.tu-clausthal.de) In jedem Stück Kohle wartet ein Diamant auf seine Geburt (Terry Pratchett) To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Oliver Fromme wrote: Doug wrote in list.freebsd-hackers: [...] 2. value ) instead of value) for case statements [...] case $? in -0) +0 ) ;; -2) +2 ) exit 1 ;; -4) +4 ) reboot echo reboot failed... help! exit 1 ;; [...] Why?!? I like the existing case style _much_ better, it's more readable and emphasizes the structure. Ok, universal acclaim in both public and private mail is for: case $foo in optinon ) as opposed to: case $foo in option ) so I'll modify that one. It actually improves readability in some cases, although the latter is a matter of personal style. I would really prefer to stick with option ) vs. option) though, but if it becomes a show-stopper I can compromise on that one too. All I ask is that people give it a chance first. :) Keep those cards and letters coming, Doug To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
[...] 2. value ) instead of value) for case statements [...] case $? in - 0) + 0 ) ;; - 2) + 2 ) exit 1 ;; - 4) + 4 ) reboot echo reboot failed... help! exit 1 ;; [...] Why?!? I like the existing case style _much_ better, it's more readable and emphasizes the structure. And it is more conformant to 'style(9)', which says that the case statements line up with the switch statement. (Although that's for C code, in this case I believe the sh code can be compliant indirectly...) Nate To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Doug wrote: Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 1. -f - -r wherever it makes sense 2. value ) instead of value) for case statements 3. All cases of [, test, ; then, etc. converted to: if [ blah ]; then 4. Made # Comment # commands more consistent 5. Stripped whitespace off the end of a few lines The attached diff is to rc, and was generated with -ubB to ease understanding of the substantive changes. You can view the actual file at http://gorean.org/rc. I would appreciate y'all reviewing these changes for style, substance, or anything else relevant to the matter at hand. My hope is that any modifications can be discussed prior to my doing the rest of the work, which I plan to tackle this weekend. There are also a few questions sprinkled into the file, comments or suggestions on those are welcome. This version of the file is tested lightly, which is to say that I booted with it after my upgrade to the most recent sources on -current tonight. Obviously more rigorous testing will be necessary before this gets committed, although the changes are extremely straightforward. Questions: 1. Under what circumstances would $early_nfs_mounts be set? The only mention of this variable that I could find is in /etc/rc, and I can't see where it would be set. 2. Do we want to move to 'logger' instead of echo for the various little statements in the rc* files during boot? I for one would highly recommend this change, since it makes remote administration TONS easier. However the last time it came up I seem to remember it being one of those religious issues... 3. Anything else I should be looking at in this phase of the game? Ok, revised diff attached. I made the case indentation change and some of sheldon's suggestions are incorporated. I also neglected to mention previously that I tuned up a few of the comments in the file, as well as error output. I also was more rigorous about making whitespace consisten on this pass. Removing double spaces, converting spaces to tabs, etc. This is much more like what I want the final version to look like. All of the above still applies, except that due to the more normal indentation a straight diff -u is more readable. Assuming this works for everyone, I will proceed with the other rc*, etc. scripts, except rc.network which sheldon informed me he is currently working on. Doug--- /usr/src/etc/rc Thu Aug 26 20:56:36 1999 +++ rc Fri Aug 27 09:52:39 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. stty status '^T' # Set shell to ignore SIGINT (2), but not children; # shell catches SIGQUIT (3) and returns to single user after fsck. +# trap : 2 trap : 3 # shouldn't be needed -HOME=/; export HOME +HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin -export PATH +export HOME PATH -# BOOTP diskless boot. We have to run the rc file early in order to +# BOOTP diskless boot. We have to run the rc file early in order to # retarget various config files. # -if [ -f /etc/rc.diskless1 ]; then +if [ -r /etc/rc.diskless1 ]; then dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2 /dev/null` if [ ${dlv:=0} != 0 ]; then . /etc/rc.diskless1 @@ -34,59 +35,68 @@ # If there is a global system configuration file, suck it in. # -if [ -f /etc/defaults/rc.conf ]; then +if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf -elif [ -f /etc/rc.conf ]; then +elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi # Configure ccd devices. -if [ -f /etc/ccd.conf ]; then +# +if [ -r /etc/ccd.conf ]; then ccdconfig -C fi -if [ ${start_vinum} = YES ]; then +case ${start_vinum} in +[Yy][Ee][Ss] ) vinum start -elif [ -n ${vinum_drives} ]; then - vinum read ${vinum_drives} -fi + ;; +* ) + if [ -n ${vinum_drives} ]; then + vinum read ${vinum_drives} + fi + ;; +esac swapon -a -if [ $1 = autoboot ]; then +case $1 in +autoboot ) echo Automatic reboot in progress... fsck -p case $? in - 0) + 0 ) ;; - 2) + 2 ) exit 1 ;; - 4) + 4 ) reboot echo reboot failed... help! exit 1 ;; - 8) + 8 ) echo Automatic file system check failed... help!
Re: Please review: rc file changes
[ I'm nit-picking here, feel free to ignore ] Doug--- /usr/src/etc/rc Thu Aug 26 20:56:36 1999 +++ rcFri Aug 27 09:52:39 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. Sentences are supposed to have two spaces before you start the next sentence. Thanks for doing this! Nate To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Doug wrote: Ok, revised diff attached. I made the case indentation change and some of sheldon's suggestions are incorporated. I also neglected to mention previously that I tuned up a few of the comments in the file, as well as error output. I also was more rigorous about making whitespace consisten on this pass. Removing double spaces, converting spaces to tabs, etc. This is Why only one space after full stops? I find two much more readable. In general though, I like the case insensitivity and the -r v. -f. David To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Fri, 27 Aug 1999, Nate Williams wrote: [ I'm nit-picking here, feel free to ignore ] A) You're in really good company. :) B) I expected a lot of nits to be picked on this project, which is why I wanted to do a first draft and solicit comments. I'm not overly concerned about getting _my_ way on a lot of these things, so long as we get a style that is consistent and that everyone can live with. Doug--- /usr/src/etc/rc Thu Aug 26 20:56:36 1999 +++ rc Fri Aug 27 09:52:39 1999 @@ -8,24 +8,25 @@ # and the console is the controlling terminal. # Note that almost all the user-configurable behavior is no longer in -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file # first before contemplating any changes here. Sentences are supposed to have two spaces before you start the next sentence. Well, that was definitely the old typographical convention, but in the digital age it's fallen into disfavor. It was easier to delete the second space to make them all consistent, but I can go with double spaces if that's the consensus. Thanks for doing this! My pleasure actually. This project is something that I've wanted to see accomplished for several years. I'm happy that the momentum is swiging this way finally. Doug -- My mama told me, my mama said, 'don't cry.' She said, 'you're too young a man to have as many women you got.' I looked at my mother dear and didn't even crack a smile. I said, 'If women kill me, I don't mind dyin!' - John Belushi as Joliet Jake Blues, I Don't Know To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
Maybe this is nit-picking, too, buth those are just my 0.02 Euros... Doug wrote in list.freebsd-hackers: -# this file, but rather in /etc/defaults/rc.conf. Please check this file +# this file, but rather in /etc/defaults/rc.conf. Please check that file I'd prefer to keep it with two spaces, to improve readability. case $? in -0) +0 ) ;; -2) +2 ) exit 1 ;; -4) +4 ) I have yet to see a good reason for adding those spaces. I don't like them, but that's just me... Apart from the above -- Good work, Doug! Regards Oliver -- Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany (Info: finger userinfo:o...@dorifer.heim3.tu-clausthal.de) In jedem Stück Kohle wartet ein Diamant auf seine Geburt (Terry Pratchett) To Unsubscribe: send mail to majord...@freebsd.org with unsubscribe freebsd-hackers in the body of the message
Re: Please review: rc file changes
On Thu, Aug 26, 1999, Doug wrote: Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 2. value ) instead of value) for case statements Why? What's wrong with `value)'? -- |Chris Costello [EMAIL PROTECTED] |Don't compare floating point numbers solely for equality. `- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Please review: rc file changes
Chris Costello wrote: On Thu, Aug 26, 1999, Doug wrote: Greetings, As previously discussed, here is a first draft of the rc* script mods. I consider the first step in this process to be Jordan's cleanup of the variable syntax. This is step 2, which most notably converts test's dealing with variables to case wherever possible. It also does the following. 2. value ) instead of value) for case statements Why? What's wrong with `value)'? Nothing functionally, but I find case statements much easier to read with the extra whitespace. Doug To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message