1 AUTHOR: Thomas Trepl <ttrepl@yahoo.de>
5 LICENSE: GNU Free Documentation License Version 1.2
7 SYNOPSIS: Setup ULOG daemon
9 DESCRIPTION: How to setup the ULOG daemon
11 PREREQUISITES: Kernel >= 2.4.18-pre8 recommended
12 otherwise a patch required
16 Introduction to ULOG daemon
18 The ULOG the user space log facility for iptables. With this package, you can store
19 the log entries normally stored in the kernel.log file in another file which
21 Download location for the ULOG daemon package:
23 ftp://ftp.netfilter.org/pub/ulogd/ulogd-1.02.tar.bz2
25 If you have a kernel older than 2.4.18-pre8 than the ulog-patch is required. For
26 this, see the netfilter page (http://www.netfilter.org).
31 Extract the source package by executing this command
33 tar -xjf <your-pkg-dir>/ulogd-1.02.tar.bz2
35 Than, you should have the directory 'ulogd-1.02' in the current directory.
40 CD into the directory newly created by the above tar command and do a
42 ./configure --prefix=/usr --sysconfdir=/etc
44 As all of the LFS/BLFS packages we will go to install this package in /usr, too.
45 If you don't want that, just leave the --prefix out - than it will be installed
46 in /usr/local. With the --sysconfdir=/etc we ensure, that the configuration file
47 will be stored in /etc and not in /usr/etc.
52 After configuring we do the well known sequence of
57 Creating startup script
58 -----------------------
60 To start the ULOG daemon when system is (re-)started, create the startup script:
62 cat > /etc/rc.d/init.d/ulogd <<"EOF"
64 # Begin $rc_base/init.d/ulogd
65 # Based on sysklogd script from LFS-3.1 and earlier.
66 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
67 source /etc/sysconfig/rc
72 echo "Starting ULOG daemon..."
77 echo "Stopping ULOG daemon..."
82 echo "Reloading ULOG daemon..."
96 echo "Usage: $0 {start|stop|reload|restart|status}"
100 # End $rc_base/init.d/ulogd
103 Don't forget to make it executable by issuing
105 chmod 754 /etc/rc.d/init.d/ulogd
107 and create the links for the different runlevels:
109 ln -sf ../init.d/ulogd /etc/rc.d/rc0.d/K95ulogd
110 ln -sf ../init.d/ulogd /etc/rc.d/rc1.d/K95ulogd
111 ln -sf ../init.d/ulogd /etc/rc.d/rc2.d/K95ulogd
112 ln -sf ../init.d/ulogd /etc/rc.d/rc3.d/S12ulogd
113 ln -sf ../init.d/ulogd /etc/rc.d/rc4.d/S12ulogd
114 ln -sf ../init.d/ulogd /etc/rc.d/rc5.d/S12ulogd
115 ln -sf ../init.d/ulogd /etc/rc.d/rc6.d/K95ulogd
117 Patching the conf-file
118 ----------------------
120 With the first installation, you will get a configuration file placed in
121 /etc/ulogd.conf. This configuration file is usable (at least for me) but there
122 are some links to wrong directories in it. Simply do a
124 sed -i -e 's;/usr/local/;/usr/;g' /etc/ulogd.conf
126 to remove the /usr/local directory references and insert the /usr instead. If
127 you have installed your ULOG daemon un /usr/local, than of course, do not do
130 Example for firewall scripts
131 ----------------------------
133 In my firewall start script, there is a definition which allowes me to do an
134 outbound connection to port 888 (cddb). In (seldom activated) verbose mode, my
135 script will generate the following lines to enable this:
137 /usr/sbin/iptables -A OUTPUT -o ppp+ -p tcp --dport 888 \
138 -j ULOG --ulog-prefix "ACCEPT:O:CDDB "
139 /usr/sbin/iptables -A OUTPUT -o ppp+ -p tcp --dport 888 -j ACCEPT
141 Note the rest of the first command, which is folded into the second line. This
142 is the definition to pass the log info to ULOG.
147 When using the default configuration file, there will be two new logfiles in
148 /var/log. This logfiles are
150 ulogd.log - for logging ulogd's activities
152 ulogd.syslogemu - there will the log infos go to
157 CHANGELOG: 1.0 Creation