]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/misc-progs/syslogdctrl.c
Added ability to change syslog to async logging.
[people/pmueller/ipfire-2.x.git] / src / misc-progs / syslogdctrl.c
index 9880ee2ee60d7af4ab0168843d6a87abd944b53a..0e10e160b5379599b2bb08f6eaa1377e89fdd416 100644 (file)
@@ -123,9 +123,13 @@ int main(void)
    close(config_fd);
    
    /* Replace the logging option*/
    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");
      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 );
      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)
      safe_system(command);
 
    if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1)