summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index a8a733d6..d8d09117 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -21,7 +21,7 @@
* For further information, please see http://www.rsyslog.com
*
* rsyslog - An Enhanced syslogd Replacement.
- * Copyright 2003-2012 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2003-2013 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of rsyslog.
*
@@ -417,12 +417,10 @@ finalize_it:
* function is also passed to the runtime library as the generic error
* message handler. -- rgerhards, 2008-04-17
*/
-rsRetVal
-submitErrMsg(int iErr, uchar *msg)
+void
+submitErrMsg(const int severity, const int iErr, const uchar *msg)
{
- DEFiRet;
- iRet = logmsgInternal(iErr, LOG_SYSLOG|LOG_ERR, msg, 0);
- RETiRet;
+ logmsgInternal(iErr, LOG_SYSLOG|(severity & 0x07), msg, 0);
}
@@ -436,7 +434,7 @@ submitMsgWithDfltRatelimiter(msg_t *pMsg)
* to log a message orginating from the syslogd itself.
*/
rsRetVal
-logmsgInternal(int iErr, int pri, uchar *msg, int flags)
+logmsgInternal(const int iErr, const int pri, const uchar *msg, int flags)
{
uchar pszTag[33];
msg_t *pMsg;
@@ -484,7 +482,6 @@ logmsgInternal(int iErr, int pri, uchar *msg, int flags)
* message to the queue engine.
*/
ratelimitAddMsg(internalMsg_ratelimiter, NULL, pMsg);
- //submitMsgWithDfltRatelimiter(pMsg);
}
finalize_it:
RETiRet;
@@ -1056,7 +1053,7 @@ finalize_it:
* the time being (remember that we want to restructure config processing at large!).
* rgerhards, 2009-10-27
*/
-rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName, struct cnfparamvals *queueParams)
+rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName, struct nvlst *lst)
{
struct queuefilenames_s *qfn;
uchar *qfname = NULL;
@@ -1072,7 +1069,7 @@ rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName, struct cnfpara
/* name our main queue object (it's not fatal if it fails...) */
obj.SetName((obj_t*) (*ppQueue), pszQueueName);
- if(queueParams == NULL) { /* use legacy parameters? */
+ if(lst == NULL) { /* use legacy parameters? */
/* ... set some properties ... */
# define setQPROP(func, directive, data) \
CHKiRet_Hdlr(func(*ppQueue, data)) { \
@@ -1129,7 +1126,7 @@ rsRetVal createMainQueue(qqueue_t **ppQueue, uchar *pszQueueName, struct cnfpara
# undef setQPROPstr
} else { /* use new style config! */
qqueueSetDefaultsRulesetQueue(*ppQueue);
- qqueueApplyCnfParam(*ppQueue, queueParams);
+ qqueueApplyCnfParam(*ppQueue, lst);
}
/* ... and finally start the queue! */
@@ -1253,6 +1250,7 @@ doHUP(void)
queryLocalHostname(); /* re-read our name */
ruleset.IterateAllActions(ourConf, doHUPActions, NULL);
+ lookupDoHUP();
}
@@ -1342,6 +1340,11 @@ static void printVersion(void)
#else
printf("\tuuid support:\t\t\t\tNo\n");
#endif
+#ifdef HAVE_JSON_OBJECT_NEW_INT64
+ printf("\tNumber of Bits in RainerScript integers: 64\n");
+#else
+ printf("\tNumber of Bits in RainerScript integers: 32 (due to too-old json-c lib)\n");
+#endif
printf("\nSee http://www.rsyslog.com for more information.\n");
}
@@ -1359,7 +1362,7 @@ InitGlobalClasses(void)
/* Intialize the runtime system */
pErrObj = "rsyslog runtime"; /* set in case the runtime errors before setting an object */
CHKiRet(rsrtInit(&pErrObj, &obj));
- CHKiRet(rsrtSetErrLogger(submitErrMsg)); /* set out error handler */
+ rsrtSetErrLogger(submitErrMsg);
/* Now tell the system which classes we need ourselfs */
pErrObj = "glbl";
@@ -1772,7 +1775,7 @@ int realMain(int argc, char **argv)
* of other options, we do this during the inital option processing.
* rgerhards, 2008-04-04
*/
- while((ch = getopt(argc, argv, "46a:Ac:dDef:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) {
+ while((ch = getopt(argc, argv, "46a:Ac:dDef:g:hi:l:m:M:nN:op:qQr::s:S:t:T:u:vwx")) != EOF) {
switch((char)ch) {
case '4':
case '6':
@@ -1790,6 +1793,7 @@ int realMain(int argc, char **argv)
case 'q': /* add hostname if DNS resolving has failed */
case 'Q': /* dont resolve hostnames in ACL to IPs */
case 's':
+ case 'S': /* Source IP for local client to be used on multihomed host */
case 'T': /* chroot on startup (primarily for testing) */
case 'u': /* misc user settings */
case 'w': /* disable disallowed host warnings */
@@ -1881,6 +1885,13 @@ int realMain(int argc, char **argv)
case 'a':
fprintf(stderr, "rsyslogd: error -a is no longer supported, use module imuxsock instead");
break;
+ case 'S': /* Source IP for local client to be used on multihomed host */
+ if(glbl.GetSourceIPofLocalClient() != NULL) {
+ fprintf (stderr, "rsyslogd: Only one -S argument allowed, the first one is taken.\n");
+ } else {
+ glbl.SetSourceIPofLocalClient((uchar*)arg);
+ }
+ break;
case 'f': /* configuration file */
ConfFile = (uchar*) arg;
break;