diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-10-23 14:46:47 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-10-23 14:46:47 +0200 |
commit | 6334d335d89ae5df344f833c5095e9dea2abf6fb (patch) | |
tree | 9cd1a8de9e3b94e72b38b0612ba4d90cadccd81d /runtime/module-template.h | |
parent | cf38fc81759b01af5125b1a05e0d6fe8e2e1bc21 (diff) | |
download | rsyslog-6334d335d89ae5df344f833c5095e9dea2abf6fb.tar.gz rsyslog-6334d335d89ae5df344f833c5095e9dea2abf6fb.tar.xz rsyslog-6334d335d89ae5df344f833c5095e9dea2abf6fb.zip |
added configuration directive "HUPisRestart"
...which enables to configure HUP to be either a full restart
or "just" a leightweight way to close open files
Diffstat (limited to 'runtime/module-template.h')
-rw-r--r-- | runtime/module-template.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/runtime/module-template.h b/runtime/module-template.h index eb39b587..6f7d877c 100644 --- a/runtime/module-template.h +++ b/runtime/module-template.h @@ -481,6 +481,33 @@ static rsRetVal afterRun(void)\ } -/* - * vi:set ai: +/* doHUP() + * This function is optional. Currently, it is available to output plugins + * only, but may be made available to other types of plugins in the future. + * A plugin does not need to define this entry point. If if does, it gets + * called when a non-restart type of HUP is done. A plugin should register + * this function so that it can close files, connection or other ressources + * on HUP - if it can be assume the user wanted to do this as a part of HUP + * processing. Note that the name "HUP" has historical reasons, it stems back + * to the infamous SIGHUP which was sent to restart a syslogd. We still retain + * that legacy, but may move this to a different signal. + * rgerhards, 2008-10-22 + */ +#define CODEqueryEtryPt_doHUP \ + else if(!strcmp((char*) name, "doHUP")) {\ + *pEtryPoint = doHUP;\ + } +#define BEGINdoHUP \ +static rsRetVal doHUP(instanceData __attribute__((unused)) *pData)\ +{\ + DEFiRet; + +#define CODESTARTdoHUP + +#define ENDdoHUP \ + RETiRet;\ +} + + +/* vim:set ai: */ |