On 10/23/14 22:28, Worik Stanton wrote:
> On 24/10/14 14:53, Nick Holland wrote:
>> On 10/23/14 21:36, worik wrote:
>>> "Processes local and package scripts in /etc/rc.d" is listed as the last
>>> thing rc does after boot.
>>>
>>> What does "Processes" mean in this context?
>>
>> like "processing food" -- do whatever needs to be done.
>> (not my best analogy, I'll admit)
>>
> 
> [snip]
> 
>> Look at the /etc/rc script...yes it does execute each of the rc.d
>> scripts, and yes it DOES pass "start" to them:
> 
> [snip]
> 
>> now look how start_daemon is invoked...
> 
> Interesting.  In /etc/rc start_daemon is called for specific named
> scripts.  Except that (at line 520) it runs it for all scripts in
> $pkg_scripts

note here, because I get this confused myself: pkg_scripts are for added
PACKAGES.  Not stock stuff.
PLUS...stock stuff is enabled in one way (daemon_flags="") vs. being
added to pkg_scripts.

> My shell scripting is really bad (I am going to have to up my game there
> if I am going to stick around here) but it seems it is set to an empty
> string in rc.conf

yep.  Now it exists...but is empty.
YOU get to set that.

> (Mis)reading the FAQ I thought it meant *all* scripts in /etc/rc.d were
> "Processed". .  It actually says "...local and packaged scripts...".  So
> if a package wants to be sure it is run at startup does it write that
> into the rc.conf where mine says...

processed...as appropriate.  That may mean "ignore". :)

> # rc.d(8) packages scripts
> # started in the specified order and stopped in reverse order
> 
> pkg_scripts=
> 
> I installed postgresql (with pkg_add) and it did not change this, I had
> to change /etc/rc.local by hand.  Is there some reason why postgresql
> should not be started after a reboot?  Have I completely got the wrong
> end of the stick?

read through that section closer...  for things you want to start and
stop in the "normal" OpenBSD way, put them in rc.conf.local.  rc.local
is for things that the "normal" way isn't appropriate for.  For example,
I maintain a system where there is a daemon installed that is not
perfectly stable -- it just shuts down once in a while.  It would work
just fine from its rc.d script -- until it stops.  So, I've got a little
script that runs it in a loop; when it crashes, wait a few seconds, then
re-launch, and that's invoked in rc.local.

Yes, there are lots of reasons why various packages should not be
started at boot, and even more reasons why the ORDER of applications
starting is critical, and something that only an administrator will
know.  For reasons of order alone, I don't think you will ever see
pkg_add start daemons automatically.

I know many DBAs who prefer that database engines are started manually.
 I'm not personally in agreement with that, I like my systems to fire up
automatically at boot (something about enjoying uninterrupted
vacations), but whatever, and having seen some really unstable apps, in
some cases there might be good arguments for this, though the better
logic would be "fix your damn app!".

Other packages have both daemon and userland modes -- rsync is one of
those.  You certainly don't want rsync running as a daemon just because
you installed rsync.

In a hostile network environment, you don't want unconfigured apps
starting at boot.  Install, configure, test, THEN configure to start at
boot (then reboot to make sure it really works).

Nick.

Reply via email to