此行是錯誤的:
openlog("vyatta-conntrack", "", LOG_USER);
的 「」 應該已經整數:
void openlog(const char *ident, int option, int facility);
的整數應該是任何這些常量OR連起來的:
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
將完成的工作。如果您的系統使用,請務必閱讀rsyslog.conf(5)
聯機幫助頁。如果您的系統使用不同的syslog守護進程,那麼請檢查系統的聯機幫助頁以獲取詳細信息。
請參閱http://www.linuxselfhelp.com/gnu/glibc/html_chapter/libc_18.html –