This line is incorrect:
openlog("vyatta-conntrack", "", LOG_USER);
"" must be an integer:
void openlog(const char *ident, int option, int facility);
An integer must be any of these ORed constants together:
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.
Try again:
openlog("vyatta-conntrack", LOG_PID, LOG_USER);
Note that your syslogd configuration cannot be configured to save log level messages LOG_INFO . Try LOG_ALERT or something to debug this problem - if it works, go back to LOG_INFO and configure syslogd to save the log messages you want to keep. Adding a line, for example:
*.* /var/log/all_messages.log
will complete the task for rsyslogd(8) . Be sure to read the rsyslog.conf(5) man page if your system uses rsyslogd(8) . If your system uses a different syslog daemon, then check your system manpages.
source share