summaryrefslogtreecommitdiffstats
path: root/tools/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-15 13:44:51 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-15 13:44:51 +0200
commit16ecb90c3ac88bb2261c31c990d88f97f1a1b32f (patch)
tree393807bddcfb330384ab7c2bd5aa32200571d495 /tools/syslogd.c
parent1f874c220860d3a19fb6cfb60f0902a08639f6ab (diff)
downloadrsyslog-16ecb90c3ac88bb2261c31c990d88f97f1a1b32f.tar.gz
rsyslog-16ecb90c3ac88bb2261c31c990d88f97f1a1b32f.tar.xz
rsyslog-16ecb90c3ac88bb2261c31c990d88f97f1a1b32f.zip
omfile buffers are now synchronized after inactivity
This is the first shot at this functionality. Currently, we run off a fixed counter in the rsyslogd mainloop, which needs to be restructured. But this code works, so it is a good time for a commit.
Diffstat (limited to 'tools/syslogd.c')
-rw-r--r--tools/syslogd.c44
1 files changed, 3 insertions, 41 deletions
diff --git a/tools/syslogd.c b/tools/syslogd.c
index 99bf281d..2b29cd7c 100644
--- a/tools/syslogd.c
+++ b/tools/syslogd.c
@@ -2575,7 +2575,8 @@ mainloop(void)
* powertop, for example). In that case, we primarily wait for a signal,
* but a once-a-day wakeup should be quite acceptable. -- rgerhards, 2008-06-09
*/
- tvSelectTimeout.tv_sec = (bReduceRepeatMsgs == 1) ? TIMERINTVL : 86400 /*1 day*/;
+ //tvSelectTimeout.tv_sec = (bReduceRepeatMsgs == 1) ? TIMERINTVL : 86400 /*1 day*/;
+tvSelectTimeout.tv_sec = 5; // TESTING ONLY!!! TODO: change back!!!
tvSelectTimeout.tv_usec = 0;
select(1, NULL, NULL, NULL, &tvSelectTimeout);
if(bFinished)
@@ -2610,49 +2611,11 @@ mainloop(void)
bHadHUP = 0;
continue;
}
+ execScheduled(); /* handle Apc calls (if any) */
}
ENDfunc
}
-/* If user is not root, prints warnings or even exits
- * TODO: check all dynafiles for write permission
- * ... but it is probably better to wait here until we have
- * a module interface - rgerhards, 2007-07-23
- */
-static void checkPermissions()
-{
-#if 0
- /* TODO: this function must either be redone or removed - now with the input modules,
- * there is no such simple check we can do. What we can check, however, is if there is
- * any input module active and terminate, if not. -- rgerhards, 2007-12-26
- */
- /* we are not root */
- if (geteuid() != 0)
- {
- fputs("WARNING: Local messages will not be logged! If you want to log them, run rsyslog as root.\n",stderr);
-#ifdef SYSLOG_INET
- /* udp enabled and port number less than or equal to 1024 */
- if ( AcceptRemote && (atoi(LogPort) <= 1024) )
- fprintf(stderr, "WARNING: Will not listen on UDP port %s. Use port number higher than 1024 or run rsyslog as root!\n", LogPort);
-
- /* tcp enabled and port number less or equal to 1024 */
- if( bEnableTCP && (atoi(TCPLstnPort) <= 1024) )
- fprintf(stderr, "WARNING: Will not listen on TCP port %s. Use port number higher than 1024 or run rsyslog as root!\n", TCPLstnPort);
-
- /* Neither explicit high UDP port nor explicit high TCP port.
- * It is useless to run anymore */
- if( !(AcceptRemote && (atoi(LogPort) > 1024)) && !( bEnableTCP && (atoi(TCPLstnPort) > 1024)) )
- {
-#endif
- fprintf(stderr, "ERROR: Nothing to log, no reason to run. Please run rsyslog as root.\n");
- exit(EXIT_FAILURE);
-#ifdef SYSLOG_INET
- }
-#endif
- }
-#endif
-}
-
/* load build-in modules
* very first version begun on 2007-07-23 by rgerhards
@@ -3053,7 +3016,6 @@ doGlblProcessInit(void)
int i;
DEFiRet;
- checkPermissions();
thrdInit();
if( !(Debug || NoFork) )