openrc-discuss

Re: Execute shell scripts on events

Roy Marples

Fri Jan 22 16:17:36 2010

Hi

On 20/01/2010 18:40, andi wrote:
Is there the possibility to execute a user defined shellscript, when
some events occur?

The idea is : i'd like to let my box speak out what's happening via
speech-dispatcher and it's commandline tool "spd-say".

For example : when a daemon has startet, a script called
"/lib64/rc/eventscripts/service-started.sh" is called with $svcname
as $1. The same should be done for "service-failed",
"service-stopped" etc....

Now one could run `spd-say "$1 service failed to start"` via the
script "/lib64/rc/eventscripts/service-failed.sh" and `spd-say "$1
service started"` via the script
"/lib64/rc/eventscripts/service-started.sh" ....

No, there is no support presently for that.
You would need to patch /lib/rc/sh/runscript.sh and wrap the commands there.

Thanks

Roy

References:
Execute shell scripts on eventsandi
Archive administrator: postmaster@marples.name