Packetwatch.net

Syslog-ng in OpenBSD 4.2



Last modified: Jul. 26, 2008

Contents
1 - Summary
2 - Syslog-ng Installation
3 - Service Configuration
4 - Service Check


1 - Summary

This little guide will show you how to install syslog-ng in OpenBSD 4.2. For
this guide to work you will need to be running OpenBSD 4.2.


2 - Syslog-ng Installation

Download the newest syslog-ng package from the OpenBSD ftp site. The newest
version is 1.6.8. Now, install syslog-ng.

# sudo pkg_add syslog-ng-1.6.8.tgz


3 - Service Configuration

Edit the /etc/rc network script so that syslog-ng will start when the system
starts up and not syslog.

# sudo vi /etc/rc

Comment out the following lines:

  syslogd_flags="${syslogd_flags} -a /var/named/dev/log"
  syslogd_flags="${syslogd_flags} -a /var/empty/dev/log"
  syslogd ${syslogd_flags}

Add the following right below where you commented out the previous line:

  syslog_ng_flags="-p /var/run/syslog-ng.pid"
  /usr/local/sbin/syslog-ng ${syslog_ng_flags}

Configure /etc/rc.conf, so the syslog-ng service will start at boot time.

# sudo vi /etc/rc.conf

Modify to have the following

  #syslogd_flags=
  syslog_ng_flags=

You can now create your own syslog-ng.conf file if you like. You can use the
following for your source.

  source local { internal(); pipe("/dev/klog" log_prefix("kernel: ")); unix-dgram("/dev/log"); };

# sudo cp /etc/syslog-ng/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf.original
# sudo vi /etc/syslog-ng/syslog-ng.conf

Stop the syslog service, and then reboot the computer.

# sudo kill -9 `cat /var/run/syslogd.pid`
# sudo shutdown -r now


4 - Service Check

Log in like normal, and check to see that the syslog-ng service is running.
That's it, now you have syslog-ng running on OpenBSD 4.2.

# sudo ls -1 /var/run/syslog-ng.pid
/var/run/syslog-ng.pid


Last modified: Thu Jan 1 00:00:00 1970 UTC
Packetwatch Research 2002-2017.