Alan McKinnon <alan.mckin...@gmail.com> writes:

>> Then tap into the fifo with a perl script that is written to be able
>> to sort and write the syslog output according to various regex that
>> may be part of startup cmd or fed in later during the running script.
>
> I don't know rsyslog at all (I use syslog-ng), but certain concepts
> are stable and universal.

Please reread my OP or maybe I should attempt to clarify what must be
a poorly written question.

I'm not asking help on anything about writing to a named pipe or
anything about the functioning of rsyslog... I know that part.

Not asking  about the bulk of  the perl scripting, such  as sorting by
regex, reading from fifo, etc (are all understood [at least well enough]).

I want an overview/outline of how one goes about attaching a script to
the operations such as start/stop of a daemon

Even there... the additions necessary to the scripts in
/etc/init.d... are understood.

I guess I want to know if its even advisable to attach custom
scripting to a daemon or if there is a well worn path for doing that.

Assuming its not clear off the wall then:

Where I'm weak is the part where the custom script checks if the
daemon is running, before the script itself starts.  That part would
need to be something pretty fool proof... maybe just grep ps output
for the daemon?

And where the custom script sends syslog (and sysadmin) a message  in
the event the script itself is killed or dies for some unexpected
reason. Something like an EXIT `trap' in shell scripting... (how its
done is perl)



Reply via email to