Added ability to change syslog to async logging.

This commit is contained in:
Christian Schmidt
2010-03-16 21:09:44 +01:00
parent 0cc5df4e29
commit 6945083ea5
2 changed files with 11 additions and 1 deletions

View File

@@ -123,9 +123,13 @@ int main(void)
close(config_fd);
/* Replace the logging option*/
safe_system("grep -v '/var/log/messages' < /etc/syslog.conf.new > /etc/syslog.conf.tmp && mv /etc/syslog.conf.tmp /etc/syslog.conf.new");
if (strcmp(ENABLE_ASYNCLOG,"on"))
snprintf(command, STRING_SIZE-1, "printf '%s -/var/log/messages' >> /etc/syslog.conf.new", varmessages );
else
snprintf(command, STRING_SIZE-1, "printf '%s /var/log/messages' >> /etc/syslog.conf.new", varmessages );
safe_system(command);
if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1)