I like this rc.firsttime, but having to append to it is a bit awkard. How about rc.firsttime.local for site specific use?
Index: etc/rc =================================================================== RCS file: /cvs/src/etc/rc,v retrieving revision 1.342 diff -u -p -r1.342 rc --- etc/rc 1 Oct 2010 20:51:32 -0000 1.342 +++ etc/rc 3 Oct 2010 23:32:55 -0000 @@ -822,12 +822,15 @@ if [ X"${krb5_slave_kdc}" = X"YES" ]; th # Remember to enable hpropd in inetd.conf fi -# If rc.firstime exists, run it just once, and make sure it is deleted -if [ -f /etc/rc.firsttime ]; then - mv /etc/rc.firsttime /etc/rc.firsttime.run - . /etc/rc.firsttime.run 2>&1 | mail -s 'rc.firsttime output' root -fi -rm -f /etc/rc.firsttime.run +# If rc.firsttime or rc.firsttime.local exist, run each just once, +# and make sure they are deleted +for f in /etc/rc.firsttime /etc/rc.firsttime.local ; do + if [ -f $f ]; then + mv $f $f.run + . $f.run 2>&1 | mail -s "$f output" root + fi + rm -f $f.run +done [ -f /etc/rc.local ] && . /etc/rc.local Index: share/man/man8/rc.8 =================================================================== RCS file: /cvs/src/share/man/man8/rc.8,v retrieving revision 1.27 diff -u -p -r1.27 rc.8 --- share/man/man8/rc.8 26 Sep 2010 06:27:45 -0000 1.27 +++ share/man/man8/rc.8 3 Oct 2010 23:17:54 -0000 @@ -38,6 +38,7 @@ .Sh SYNOPSIS .Nm /etc/rc .Nm /etc/rc.firsttime +.Nm /etc/rc.firsttime.local .Nm /etc/rc.local .Nm /etc/rc.securelevel .Sh DESCRIPTION @@ -54,6 +55,7 @@ script, which runs commands and daemons The .Nm rc.securelevel , .Nm rc.firsttime , +.Nm rc.firsttime.local , and .Nm rc.local scripts hold commands which are pertinent only to a specific site. @@ -127,8 +129,10 @@ See .Xr securelevel 7 for the effects of setting the security level. .Pp -If +If any of .Nm rc.firsttime +or +.Nm rc.firsttime.local exists, it is executed once and then deleted. Any output is mailed to root. Do not install @@ -136,10 +140,8 @@ Do not install from .Pa siteXX.tgz during a system install since the installer may write to it too. -Rather, install an -.Pa install.site -script and let that script append the required commands to -.Nm rc.firsttime . +.Nm rc.firsttime.local +is intented for site specific use and is not touched by the installer. .Pp .Nm rc.local is executed towards the end of @@ -212,6 +214,8 @@ System daemon configuration database. Site specific daemon configuration database. .It Pa /etc/rc.firsttime Commands run on the first boot after creation. +.It Pa /etc/rc.firsttime.local +Site specific commands run on the first boot after creation. .It Pa /etc/rc.securelevel Commands run before the security level changes. .It Pa /etc/rc.shutdown