这一行是错误的:
openlog("vyatta-conntrack", "", LOG_USER);
“”应该是一个整数:
void openlog(const char *ident, int option, int facility);
整数应该是这些常量中的任何一个或一起:
LOG_CONS Write directly to system console if there is
an error while sending to system logger.
LOG_NDELAY Open the connection immediately (normally, the
connection is opened when the first message is
logged).
LOG_NOWAIT Don't wait for child processes that may have
been created while logging the message. (The
GNU C library does not create a child process,
so this option has no effect on Linux.)
LOG_ODELAY The converse of LOG_NDELAY; opening of the
connection is delayed until syslog() is
called. (This is the default, and need not be
specified.)
LOG_PERROR (Not in POSIX.1-2001.) Print to stderr as
well.
LOG_PID Include PID with each message.
用类似的东西再试一次:
openlog("vyatta-conntrack", LOG_PID, LOG_USER);
请注意,您的syslogd 配置可能未设置为保留日志级别LOG_INFO 的消息。尝试使用LOG_ALERT 或其他方法来调试此问题——如果可行,则返回LOG_INFO 并配置您的syslogd 以保留您想要保留的日志消息。添加如下一行:
*.* /var/log/all_messages.log
将为rsyslogd(8) 工作。如果您的系统使用rsyslogd(8),请务必阅读rsyslog.conf(5) 联机帮助页。如果您的系统使用不同的 syslog 守护程序,请查看系统的联机帮助页了解详细信息。