What my rotate.pl really do is to rotate all .gz files (rotated by newsyslog) back to human-readable normal file and move them away from /var/log/ to another location with proper /date/month/day format for ease of reading.

Delaying initialization of a daemon on startup

I am using Samba to allow easier access to my freeBSD box from my windows box and all is fine when I start the samba daemons smbd and nmbd manually. However when I place the init script in /usr/local/etc/rc.d there appears to be a conflict with one of the other init scripts in that directory (I know this because when I disable/chmod-x all other scripts in /usr/local/etc/rc.d, the samba daemons runs fine). The other init scripts are for apache and mysql, my money would be on it being apache causing the problems... but this is aside...

I'm now after a method of delaying the execution/initilization of httpd/mysqld when I boot up (or alternatively delaying init of smb).

What software would I use to achieve this aim?
I read through the info on cron (I'm not overly familiar with cron) and can't see how it could be used to run a process 'x' amount of time after boot up .

Many thanks in advance,
Jez

PS - what does 'rc.d' stand for??? And why is the etc directory called 'etc'???

You can implement some sort of System V style by renaming your smbfs.sh to ysmbfs.sh and nmbd.sh to znmbd.sh so they have lower priority. Keep in mind, the order is: 0-9 -> A-Z -> a-z. You also can rename whatever script that should have the highest priority by putting a 0 as the 1st character of the startup script.

Really, FreeBSD supposed to be the big brother among the 3 (Net, Open and Free), but some of the implementation they are using is really outdated and inefficient. Just to name a few: Old version of Perl, old version of X and poor rc (init mechanism). NetBSD beats FreeBSD in all 3 of these categories.

Ah yes, this makes sense - I remember reading something about this method for ordering init script execution somewhere (perhaps periodic man?). Thanks I will try this and see how it goes. This in fact makes good sense, taking the following into account...

I narrowed the problem down to the apache rc script as the cause of the nmbd rc init coredump, so it appears the problem was that the httpd init script was still running when the smbd init script was called and there was a clash of some kind.

Another quick question - I notice that the periodic scripts have a similar 'alphachronological' init sequence:

I must admit I do like FreeBSD in its 'logically correct' simplicity compared against linux which seems to throw files all over the place (as you've remarked on regarding hier(7) in various posts vis-a-vis linux inconsistent hierarchy/directory structuring).

>> Would it be in keeping with the FreeBSD 'schema' to use this style for rc scripts?

Yes, just to compensate FreeBSD's poor/outdated rc mechanism for local scripts at /usr/local/etc/rc.d/ but not with /etc/rc*.
I bet FreeBSD will steal/implement NetBSD way of doing all this rc stuffs approach sooner or later.
So what the hell is all about NetBSD in this category?
NetBSD doesn't use /usr/local/etc/rc.d. /etc/rc.local also is not recommended (that is for OpenBSD). NetBSD implement a kickass way of start/stop boot scripts all in one centralize place -> /etc/rc.d/scriptname_here. Like ports system, in /etc/rc.d/*, all the script dependencies are checked and all scripts are highly linked together. All these are controlled by a script at /etc/rc.subr. Say you start a script by running "/etc/rc.d/script_name start", all the require scripts will first be started/checked. If they haven't started, you will be asked to start those scripts prior to starting your script_name start.
So as you can see, in FreeBSD, renaming sciptname to 010.scriptname.sh helps controlling the startup order but it doesn't check for dependencies.