shithub: riscv

Download patch

ref: 1c0ba2019ece868b7ec75090df31ab77b6087355
parent: 04a8392f8c7c75f585d48360774c6f1faa950f0c
author: Matthew Veety <[email protected]>
date: Mon Dec 7 12:59:53 EST 2015

made sure that rcmain.local runs independent of the existence  of $home/lib/profile. Documented /rc/lib/rcmain, /rc/lib/rcmain.local, $home/lib/profile in rc(1) and the first two in namespace(4)

--- a/rc/lib/rcmain
+++ b/rc/lib/rcmain
@@ -16,17 +16,17 @@
 }
 fn sigexit
 if(! ~ $#cflag 0){
-	if(flag l && /bin/test -r $home/lib/profile){
+	if(flag l){
 		if(/bin/test -r /rc/lib/rcmain.local) . /rc/lib/rcmain.local
-		. $home/lib/profile
+		if(/bin/test -r $home/lib/profile) . $home/lib/profile
 	}
 	status=''
 	eval $cflag
 }
 if not if(flag i){
-	if(flag l && /bin/test -r $home/lib/profile){
+	if(flag l){
 		if(/bin/test -r /rc/lib/rcmain.local) . /rc/lib/rcmain.local
-		. $home/lib/profile
+		if(/bin/test -r $home/lib/profile) . $home/lib/profile
 	}
 	status=''
 	if(! ~ $#* 0) . $*
--- a/sys/man/1/rc
+++ b/sys/man/1/rc
@@ -973,6 +973,19 @@
 .PD
 .SH SOURCE
 .B /sys/src/cmd/rc
+.SH FILES
+.TF $home/lib/profile
+.TP
+.B $home/lib/profile
+the user's local rc start script
+.TF /rc/lib/rcmain
+.TP
+.B /rc/lib/rcmain
+System rc start script
+.TF /rc/lib/rcmain.local
+.TP
+.B /rc/lib/rcmain.local
+Site specific system rc start script
 .SH "SEE ALSO"
 Tom Duff,
 ``Rc \- The Plan 9 Shell''.
--- a/sys/man/4/namespace
+++ b/sys/man/4/namespace
@@ -153,6 +153,10 @@
 Startup code for
 .IR rc (1).
 .TP
+.B /rc/lib/rcmain.local
+Site local startup code for
+.IR rc (1).
+.TP
 .B /lib
 Collections of data, generally not parts of programs.
 .TP