rcorder issue

Polytropon freebsd at edvax.de
Thu Oct 31 08:29:33 UTC 2013


On Thu, 31 Oct 2013 11:42:41 +0330, takCoder wrote:
> Hi all,
> 
> My question is: May it cause a problem, for rcorder or else, to have a
> sub-folder in rc.d/ path ?

First, the things you are refering to are directories and
subdirectories. "Folder" is technically wrong. The correct
term is directory. A "folder" is the name of a visual
representation (usually an icon) that represents a directory
within a GUI concept. The relations that reflect that
difference are "is a" vs. "represents a". :-)



> I've faced a doubt around this rcorder process.. I think i have heard that
> we should not have sub-folders in "rc.d"s' as it may cause rcorder a
> problem.. this one is apart from the fact that rc.d should only contain
> shells which are to be run automatically on startup..

That's correct. From /etc/rc, you can see:

	files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`

It's about _files_, so * will usually be resolved by the
shell to any entry found in the specified directory. In
case that a subdirectory is found, any future operation
will be done on _that subdirectory_ instead of a file
(that is maybe contained in that subdirectory). That's
why it's suggested to put the rc.d scripts without any
"deeper nesting" into /etc/rc.d and /usr/local/etc/rc.d
respectively. Similarly, non-OS scripts are processed
from the /usr/local/etc/rc.d directory (and other directories
the user might have added).



> But now I can't  be sure about it as i can't remember it clearly or find
> it.. One of my mates created a sub-folder in his system's rc.d folder, so
> he can run his preferred scripts there in his required order, using
> /etc/rc.

It would also be possible to add a custom /opt/rc.d
directory and add this to the local_startup vairable
in /etc/rc.conf, for example:

	local_startup="/usr/local/etc/rc.d /opt/rc.d"

This will cause additional directories to be sourced.
Note that I'm an optimist and therefore often (ab)use
the Solaris-ism (Solarism?) of /opt. :-)

Of course, it would also be valid to do something like
this (even though I haven't tested that specific case):

	local_startup="/usr/local/etc/rc.d /usr/local/etc/rc.d/bob"

In this example, /usr/local/etc/rc.d/bob contains further
rc.d-style scripts.



> Thank you all in advance, for any tips you may offer on this. :)

Use the correct terminology for all the things. ;-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list