]> git.ipfire.org Git - people/ummeegge/ipfire-2.x.git/commitdiff
Rsyslog: New advanced Syslogger rsyslog
authorErik Kapfer <erik.kapfer@ipfire.org>
Thu, 21 Jun 2018 10:03:32 +0000 (12:03 +0200)
committerErik Kapfer <erik.kapfer@ipfire.org>
Thu, 21 Jun 2018 10:03:32 +0000 (12:03 +0200)
Sysklogd and Klogd are replaced by Rsyslogd.
Version includes libestr libfastjson and liblogging.

Rsyslog configuration:
    Two modules are used 'imuxsock' and 'imklog' which is the minimum to get the old sysklod ouput.
    Works in 'RSYSLOG_TraditionalFileFormat' which equals to the log output of the old sysklogd.
    A work directory will be included to /var/spool/rsyslog.
    Additional user configuration directory under /etc/rsyslog.d has been introduced too.
    One old sysklogd directive needed to be changed whereby ':omusrmsg:*' for emergency messages has been set (all old sysklogd configuration directives could be used in new config).
    Since Rsyslog drops his privileges (to already existing user 'syslogd'), syslogd user is now member of group tty (/etc/group), group dialout has also been tested but have had partly problems and didnĀ“t logged persistently.
    logrotate.conf has been adapted to Rsyslog, -HUP will be send before restart so all files should be closed before rotation.

Rsyslog initscript:
    Checks if user syslogd is part of tty group otherwise a usermod includes 'syslogd' to 'tty' (needed to be done to drop the privileges).
    Bootlog lines from sysklogd has been integrated.

syslogctrl:
    Remote logging configuration is located under /etc/rsyslog.conf and works with UDP (@) and TCP (@@).
    Rsyslog restart will be executed after configuration has been saved via logs.cgi/config.dat.

Other files/changes:
    User 'klogd' has been deleted from passwd.
    rsyslogd default.conf for 'logwatch' has been activated.
    services.cgi has been adapted to rsyslog as logging and kernel logging server and a link has also been set to related logs.cgi/config.dat.
    firstsetup has been adapted to rsyslog.

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
26 files changed:
config/etc/group
config/etc/logrotate.conf
config/etc/rsyslog.conf [new file with mode: 0644]
config/etc/syslog.conf [deleted file]
config/rootfiles/common/armv5tel/initscripts
config/rootfiles/common/i586/initscripts
config/rootfiles/common/libestr [new file with mode: 0644]
config/rootfiles/common/libfastjson [new file with mode: 0644]
config/rootfiles/common/liblogging [new file with mode: 0644]
config/rootfiles/common/logwatch
config/rootfiles/common/rsyslog [new file with mode: 0644]
config/rootfiles/common/stage2
config/rootfiles/common/sysklogd [deleted file]
config/rootfiles/common/x86_64/initscripts
config/rootfiles/common/x86_64/stage2
html/cgi-bin/services.cgi
lfs/initscripts
lfs/libestr [new file with mode: 0644]
lfs/libfastjson [new file with mode: 0644]
lfs/liblogging [new file with mode: 0644]
lfs/rsyslog [new file with mode: 0644]
make.sh
src/initscripts/system/firstsetup
src/initscripts/system/rsyslog [new file with mode: 0644]
src/initscripts/system/sysklogd [deleted file]
src/misc-progs/syslogdctrl.c

index 198b68aa36f051fb2d5af20ad19129499f52a16e..ba28e6e61a35357dbeb940345b8aef01678977e1 100644 (file)
@@ -2,7 +2,7 @@ root:x:0:root
 bin:x:1:root,bin,daemon
 daemon:x:2:root,bin,daemon
 sys:x:3:root,bin
-tty:x:5:
+tty:x:5:syslogd
 disk:x:6:root
 lp:x:7:daemon
 mem:x:8:
@@ -30,7 +30,6 @@ snort:x:101:
 logwatch:x:102:
 cron:x:104:
 syslogd:x:105:
-klogd:x:106:
 postfix:x:107:
 postdrop:x:108:
 clamav:x:109:
index d38570de5526d5113ff691c1b372696379168e62..865b2ccfdfa66aba7c1d3f32fe8fd89c3fb11642 100644 (file)
@@ -73,7 +73,8 @@ include /etc/logrotate.d
     sharedscripts
     ifempty
     postrotate
-       /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
+        /bin/kill -HUP $(cat /var/run/rsyslog.pid 2> /dev/null) 2> /dev/null || true
+        /etc/init.d/rsyslog restart >/dev/null 2>&1 || true
     endscript
 }
 
diff --git a/config/etc/rsyslog.conf b/config/etc/rsyslog.conf
new file mode 100644 (file)
index 0000000..df3eae6
--- /dev/null
@@ -0,0 +1,75 @@
+#  /etc/rsyslog.conf   Configuration file for rsyslog.
+#
+#                      For more information see
+#                      /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
+#
+
+#################
+#### MODULES ####
+#################
+
+# provides support for local system logging
+module(load="imuxsock")
+
+# provides kernel logging support (previously done by rklogd)
+module(load="imklog")
+
+###########################
+#### GLOBAL DIRECTIVES ####
+###########################
+
+#
+# Use traditional timestamp format.
+# To enable high precision timestamps, comment out the following line.
+#
+$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
+
+# Filter duplicated messages
+#$RepeatedMsgReduction on
+
+#
+# Drop privileges.
+#
+$PrivDropToUser syslogd
+$PrivDropToGroup syslogd
+
+#
+# Where to place spool and state files
+#
+$WorkDirectory /var/spool/rsyslog
+
+#
+# Include all config files in /etc/rsyslog.d/
+#
+$IncludeConfig /etc/rsyslog.d/*.conf
+
+###############
+#### RULES ####
+###############
+
+# Log all kernel messages to the console.
+# Logging much else clutters up the screen.
+#kern.*                                                        /dev/console
+
+# Log anything (except mail) of level info or higher.
+# Don't log private authentication messages!
+# local0.* any dhcpcd log (even debug) in messages
+cron.none;daemon.*;local0.*;local2.*;\
+*.info;mail.none;authpriv.*                                    -/var/log/messages
+
+# Log crons
+#cron.*                                                                -/var/log/cron.log
+
+# Everybody gets emergency messages
+*.emerg                                                                :omusrmsg:*
+
+# Display logs on tty12
+*.*                                                            /dev/tty12
+
+# Optionally log to a remote host
+#*.*                                                           @hostname.domain
+
+# Postfix logs
+mail.*                                                         -/var/log/mail
+
+
diff --git a/config/etc/syslog.conf b/config/etc/syslog.conf
deleted file mode 100644 (file)
index cdef756..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Log all kernel messages to the console.
-# Logging much else clutters up the screen.
-#kern.*                                                        /dev/console
-
-# Log anything (except mail) of level info or higher.
-# Don't log private authentication messages!
-# local0.* any dhcpcd log (even debug) in messages
-cron.none;daemon.*;local0.*;local2.*;*.info;mail.none;authpriv.*       -/var/log/messages
-
-# Log crons
-#cron.*                                                                                -/var/log/cron.log
-
-# Everybody gets emergency messages
-*.emerg                                                                                *
-
-# Display logs on tty12
-*.*                                                                                            /dev/tty12
-
-# Optionally log to a remote host
-#*.*                                                                                   @hostname.domain
-
-# Postfix logs
-mail.*                                                                         -/var/log/mail
index 9e9e1a71a50d893dae15ccbf7e324b12552993b0..1e7c655c0393a40b223fd1bc8dd10b73328c01d8 100644 (file)
@@ -80,7 +80,7 @@ etc/rc.d/init.d/static-routes
 etc/rc.d/init.d/swap
 etc/rc.d/init.d/swconfig
 etc/rc.d/init.d/sysctl
-etc/rc.d/init.d/sysklogd
+etc/rc.d/init.d/rsyslog
 etc/rc.d/init.d/template
 etc/rc.d/init.d/udev
 etc/rc.d/init.d/udev_retry
@@ -110,7 +110,7 @@ etc/rc.d/rc0.d/K82wlanclient
 #etc/rc.d/rc0.d/K84bluetooth
 #etc/rc.d/rc0.d/K85messagebus
 etc/rc.d/rc0.d/K87acpid
-etc/rc.d/rc0.d/K90sysklogd
+etc/rc.d/rc0.d/K90rsyslog
 etc/rc.d/rc0.d/S60sendsignals
 etc/rc.d/rc0.d/S70localnet
 etc/rc.d/rc0.d/S80mountfs
@@ -118,7 +118,7 @@ etc/rc.d/rc0.d/S90swap
 etc/rc.d/rc0.d/S99halt
 #etc/rc.d/rc3.d
 etc/rc.d/rc3.d/S01vnstat
-etc/rc.d/rc3.d/S10sysklogd
+etc/rc.d/rc3.d/S10rsyslog
 etc/rc.d/rc3.d/S11unbound
 etc/rc.d/rc3.d/S12acpid
 etc/rc.d/rc3.d/S15fireinfo
@@ -161,7 +161,7 @@ etc/rc.d/rc6.d/K82wlanclient
 #etc/rc.d/rc6.d/K84bluetooth
 #etc/rc.d/rc6.d/K85messagebus
 etc/rc.d/rc6.d/K87acpid
-etc/rc.d/rc6.d/K90sysklogd
+etc/rc.d/rc6.d/K90rsyslog
 etc/rc.d/rc6.d/S60sendsignals
 etc/rc.d/rc6.d/S70mountfs
 etc/rc.d/rc6.d/S80swap
index cc0e4580d8d1c65c75a3e584be48e5509a18230e..a2674ecd0a71657ed596b5c9bc3b982c974aa582 100644 (file)
@@ -79,7 +79,7 @@ etc/rc.d/init.d/sshd
 etc/rc.d/init.d/static-routes
 etc/rc.d/init.d/swap
 etc/rc.d/init.d/sysctl
-etc/rc.d/init.d/sysklogd
+etc/rc.d/init.d/rsyslog
 etc/rc.d/init.d/template
 etc/rc.d/init.d/udev
 etc/rc.d/init.d/udev_retry
@@ -109,7 +109,7 @@ etc/rc.d/rc0.d/K82wlanclient
 #etc/rc.d/rc0.d/K84bluetooth
 #etc/rc.d/rc0.d/K85messagebus
 etc/rc.d/rc0.d/K87acpid
-etc/rc.d/rc0.d/K90sysklogd
+etc/rc.d/rc0.d/K90rsyslog
 etc/rc.d/rc0.d/S60sendsignals
 etc/rc.d/rc0.d/S70localnet
 etc/rc.d/rc0.d/S80mountfs
@@ -117,7 +117,7 @@ etc/rc.d/rc0.d/S90swap
 etc/rc.d/rc0.d/S99halt
 #etc/rc.d/rc3.d
 etc/rc.d/rc3.d/S01vnstat
-etc/rc.d/rc3.d/S10sysklogd
+etc/rc.d/rc3.d/S10rsyslog
 etc/rc.d/rc3.d/S12acpid
 etc/rc.d/rc3.d/S15fireinfo
 #etc/rc.d/rc3.d/S15messagebus
@@ -160,7 +160,7 @@ etc/rc.d/rc6.d/K82wlanclient
 #etc/rc.d/rc6.d/K84bluetooth
 #etc/rc.d/rc6.d/K85messagebus
 etc/rc.d/rc6.d/K87acpid
-etc/rc.d/rc6.d/K90sysklogd
+etc/rc.d/rc6.d/K90rsyslog
 etc/rc.d/rc6.d/S60sendsignals
 etc/rc.d/rc6.d/S70mountfs
 etc/rc.d/rc6.d/S80swap
diff --git a/config/rootfiles/common/libestr b/config/rootfiles/common/libestr
new file mode 100644 (file)
index 0000000..d58e7a9
--- /dev/null
@@ -0,0 +1,6 @@
+#usr/include/libestr.h
+#usr/lib/libestr.la
+#usr/lib/libestr.so
+usr/lib/libestr.so.0
+usr/lib/libestr.so.0.0.0
+#usr/lib/pkgconfig/libestr.pc
diff --git a/config/rootfiles/common/libfastjson b/config/rootfiles/common/libfastjson
new file mode 100644 (file)
index 0000000..f7611e1
--- /dev/null
@@ -0,0 +1,13 @@
+#usr/include/libfastjson
+#usr/include/libfastjson/atomic.h
+#usr/include/libfastjson/json.h
+#usr/include/libfastjson/json_object.h
+#usr/include/libfastjson/json_object_iterator.h
+#usr/include/libfastjson/json_object_private.h
+#usr/include/libfastjson/json_tokener.h
+#usr/include/libfastjson/json_util.h
+#usr/lib/libfastjson.la
+#usr/lib/libfastjson.so
+usr/lib/libfastjson.so.4
+usr/lib/libfastjson.so.4.2.0
+#usr/lib/pkgconfig/libfastjson.pc
diff --git a/config/rootfiles/common/liblogging b/config/rootfiles/common/liblogging
new file mode 100644 (file)
index 0000000..e51bfd9
--- /dev/null
@@ -0,0 +1,10 @@
+#usr/bin/stdlogctl
+#usr/include/liblogging
+#usr/include/liblogging/stdlog.h
+#usr/lib/liblogging-stdlog.la
+#usr/lib/liblogging-stdlog.so
+usr/lib/liblogging-stdlog.so.0
+usr/lib/liblogging-stdlog.so.0.1.0
+#usr/lib/pkgconfig/liblogging-stdlog.pc
+#usr/share/man/man1/stdlogctl.1
+#usr/share/man/man3/stdlog.3
index fe67a8c8463aa3420d1b8a05915435bd1a83ed10..4be3ead3eec9c216bcfc75385dfc728a1708200a 100644 (file)
@@ -146,7 +146,7 @@ usr/share/logwatch/default.conf/services/postfix.conf
 #usr/share/logwatch/default.conf/services/qmail.conf
 #usr/share/logwatch/default.conf/services/raid.conf
 usr/share/logwatch/default.conf/services/resolver.conf
-#usr/share/logwatch/default.conf/services/rsyslogd.conf
+usr/share/logwatch/default.conf/services/rsyslogd.conf
 #usr/share/logwatch/default.conf/services/rt314.conf
 usr/share/logwatch/default.conf/services/samba.conf
 usr/share/logwatch/default.conf/services/saslauthd.conf
@@ -290,7 +290,7 @@ usr/share/logwatch/scripts/services/postfix
 #usr/share/logwatch/scripts/services/qmail-smtpd
 #usr/share/logwatch/scripts/services/raid
 usr/share/logwatch/scripts/services/resolver
-#usr/share/logwatch/scripts/services/rsyslogd
+usr/share/logwatch/scripts/services/rsyslogd
 #usr/share/logwatch/scripts/services/rt314
 usr/share/logwatch/scripts/services/samba
 usr/share/logwatch/scripts/services/saslauthd
diff --git a/config/rootfiles/common/rsyslog b/config/rootfiles/common/rsyslog
new file mode 100644 (file)
index 0000000..c0d7434
--- /dev/null
@@ -0,0 +1,43 @@
+etc/rsyslog.d
+#usr/lib/rsyslog
+#usr/lib/rsyslog/fmhash.la
+usr/lib/rsyslog/fmhash.so
+#usr/lib/rsyslog/fmhttp.la
+usr/lib/rsyslog/fmhttp.so
+#usr/lib/rsyslog/imklog.la
+usr/lib/rsyslog/imklog.so
+#usr/lib/rsyslog/immark.la
+usr/lib/rsyslog/immark.so
+#usr/lib/rsyslog/imtcp.la
+usr/lib/rsyslog/imtcp.so
+#usr/lib/rsyslog/imudp.la
+usr/lib/rsyslog/imudp.so
+#usr/lib/rsyslog/imuxsock.la
+usr/lib/rsyslog/imuxsock.so
+#usr/lib/rsyslog/lmcry_gcry.la
+usr/lib/rsyslog/lmcry_gcry.so
+#usr/lib/rsyslog/lmnet.la
+usr/lib/rsyslog/lmnet.so
+#usr/lib/rsyslog/lmnetstrms.la
+usr/lib/rsyslog/lmnetstrms.so
+#usr/lib/rsyslog/lmnsd_ptcp.la
+usr/lib/rsyslog/lmnsd_ptcp.so
+#usr/lib/rsyslog/lmregexp.la
+usr/lib/rsyslog/lmregexp.so
+#usr/lib/rsyslog/lmstrmsrv.la
+usr/lib/rsyslog/lmstrmsrv.so
+#usr/lib/rsyslog/lmtcpclt.la
+usr/lib/rsyslog/lmtcpclt.so
+#usr/lib/rsyslog/lmtcpsrv.la
+usr/lib/rsyslog/lmtcpsrv.so
+#usr/lib/rsyslog/lmzlibw.la
+usr/lib/rsyslog/lmzlibw.so
+#usr/lib/rsyslog/mmexternal.la
+usr/lib/rsyslog/mmexternal.so
+#usr/lib/rsyslog/omtesting.la
+usr/lib/rsyslog/omtesting.so
+usr/sbin/rsyslogd
+#usr/share/man/man5/rsyslog.conf.5
+#usr/share/man/man8/rsyslogd.8
+var/log/dhcpcd.log
+var/log/messages
index a5ba6ae26969ac3e53b05fda5fa8eac524d0b4b9..953255b5bf9e7f019be434e021c434e729055918 100644 (file)
@@ -42,7 +42,7 @@ etc/profile.d/umask.sh
 etc/resolv.conf
 etc/securetty
 etc/sysctl.conf
-etc/syslog.conf
+etc/rsyslog.conf
 etc/system-release
 #home
 home/nobody
diff --git a/config/rootfiles/common/sysklogd b/config/rootfiles/common/sysklogd
deleted file mode 100644 (file)
index f5d55c2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-usr/sbin/klogd
-usr/sbin/syslogd
-#usr/share/man/man5/syslog.conf.5
-#usr/share/man/man8/klogd.8
-#usr/share/man/man8/sysklogd.8
-#usr/share/man/man8/syslogd.8
-var/log/dhcpcd.log
-var/log/messages
index cc0e4580d8d1c65c75a3e584be48e5509a18230e..a2674ecd0a71657ed596b5c9bc3b982c974aa582 100644 (file)
@@ -79,7 +79,7 @@ etc/rc.d/init.d/sshd
 etc/rc.d/init.d/static-routes
 etc/rc.d/init.d/swap
 etc/rc.d/init.d/sysctl
-etc/rc.d/init.d/sysklogd
+etc/rc.d/init.d/rsyslog
 etc/rc.d/init.d/template
 etc/rc.d/init.d/udev
 etc/rc.d/init.d/udev_retry
@@ -109,7 +109,7 @@ etc/rc.d/rc0.d/K82wlanclient
 #etc/rc.d/rc0.d/K84bluetooth
 #etc/rc.d/rc0.d/K85messagebus
 etc/rc.d/rc0.d/K87acpid
-etc/rc.d/rc0.d/K90sysklogd
+etc/rc.d/rc0.d/K90rsyslog
 etc/rc.d/rc0.d/S60sendsignals
 etc/rc.d/rc0.d/S70localnet
 etc/rc.d/rc0.d/S80mountfs
@@ -117,7 +117,7 @@ etc/rc.d/rc0.d/S90swap
 etc/rc.d/rc0.d/S99halt
 #etc/rc.d/rc3.d
 etc/rc.d/rc3.d/S01vnstat
-etc/rc.d/rc3.d/S10sysklogd
+etc/rc.d/rc3.d/S10rsyslog
 etc/rc.d/rc3.d/S12acpid
 etc/rc.d/rc3.d/S15fireinfo
 #etc/rc.d/rc3.d/S15messagebus
@@ -160,7 +160,7 @@ etc/rc.d/rc6.d/K82wlanclient
 #etc/rc.d/rc6.d/K84bluetooth
 #etc/rc.d/rc6.d/K85messagebus
 etc/rc.d/rc6.d/K87acpid
-etc/rc.d/rc6.d/K90sysklogd
+etc/rc.d/rc6.d/K90rsyslog
 etc/rc.d/rc6.d/S60sendsignals
 etc/rc.d/rc6.d/S70mountfs
 etc/rc.d/rc6.d/S80swap
index 70a33d6591ce33720f9606a9348981999f95f8fb..b8cb01b67041657a9745540cba4e24b23c7ff4dd 100644 (file)
@@ -42,7 +42,7 @@ etc/profile.d/umask.sh
 etc/resolv.conf
 etc/securetty
 etc/sysctl.conf
-etc/syslog.conf
+etc/rsyslog.conf
 etc/system-release
 #home
 home/nobody
index 64fdbba05a4ee6afcaceae2caa1dbee12f485782..4014e511861a10256687bdb437678bad9e7fb386 100644 (file)
@@ -50,8 +50,7 @@ my %servicenames =(
        $Lang::tr{'web server'} => 'httpd',
        $Lang::tr{'cron server'} => 'fcron',
        $Lang::tr{'dns proxy server'} => 'unbound',
-       $Lang::tr{'logging server'} => 'syslogd',
-       $Lang::tr{'kernel logging server'} => 'klogd',
+       $Lang::tr{'logging server'} => 'rsyslog',
        $Lang::tr{'ntp server'} => 'ntpd',
        $Lang::tr{'secure shell server'} => 'sshd',
        $Lang::tr{'vpn'} => 'charon',
@@ -64,8 +63,7 @@ my %link =(
        $Lang::tr{'web server'} => $Lang::tr{'web server'},
        $Lang::tr{'cron server'} => $Lang::tr{'cron server'},
        $Lang::tr{'dns proxy server'} => $Lang::tr{'dns proxy server'},
-       $Lang::tr{'logging server'} => $Lang::tr{'logging server'},
-       $Lang::tr{'kernel logging server'} => $Lang::tr{'kernel logging server'},
+       $Lang::tr{'logging server'} => "<a href=\'logs.cgi/config.dat\'>$Lang::tr{'logging server'}</a>",
        $Lang::tr{'ntp server'} => "<a href=\'time.cgi\'>$Lang::tr{'ntp server'}</a>",
        $Lang::tr{'secure shell server'} => "<a href=\'remote.cgi\'>$Lang::tr{'secure shell server'}</a>",
        $Lang::tr{'vpn'} => "<a href=\'vpnmain.cgi\'>$Lang::tr{'vpn'}</a>",
index 0d7f40cadb8951c47ee6b18615ed4d7ac145d79f..82eb75ac68c4434e719c482f72c91327a0828a07 100644 (file)
@@ -92,13 +92,13 @@ $(TARGET) :
                install -v -m 755 $$i /etc/rc.d/helper/; \
        done
 
-       ln -sf ../init.d/sysklogd    /etc/rc.d/rc0.d/K90sysklogd
+       ln -sf ../init.d/rsyslog     /etc/rc.d/rc0.d/K90rsyslog
        ln -sf ../init.d/sendsignals /etc/rc.d/rc0.d/S60sendsignals
        ln -sf ../init.d/localnet    /etc/rc.d/rc0.d/S70localnet
        ln -sf ../init.d/mountfs     /etc/rc.d/rc0.d/S80mountfs
        ln -sf ../init.d/swap        /etc/rc.d/rc0.d/S90swap
        ln -sf ../init.d/halt        /etc/rc.d/rc0.d/S99halt
-       ln -sf ../init.d/sysklogd    /etc/rc.d/rc3.d/S10sysklogd
+       ln -sf ../init.d/rsyslog     /etc/rc.d/rc3.d/S10rsyslog
        ln -sf ../init.d/smartenabler /etc/rc.d/rc3.d/S19smartenabler
        ln -sf ../init.d/messagebus  /etc/rc.d/rc3.d/S15messagebus
        ln -sf ../init.d/messagebus  /etc/rc.d/rc0.d/K85messagebus
@@ -107,7 +107,7 @@ $(TARGET) :
        ln -sf ../init.d/bluetooth   /etc/rc.d/rc0.d/K84bluetooth
        ln -sf ../init.d/bluetooth   /etc/rc.d/rc6.d/K84bluetooth
        ln -sf ../init.d/cpufreq     /etc/rc.d/rc3.d/S18cpufreq
-       ln -sf ../init.d/sysklogd    /etc/rc.d/rc6.d/K90sysklogd
+       ln -sf ../init.d/rsyslog     /etc/rc.d/rc6.d/K90rsyslog
        ln -sf ../init.d/sendsignals /etc/rc.d/rc6.d/S60sendsignals
        ln -sf ../init.d/mountfs     /etc/rc.d/rc6.d/S70mountfs
        ln -sf ../init.d/swap        /etc/rc.d/rc6.d/S80swap
diff --git a/lfs/libestr b/lfs/libestr
new file mode 100644 (file)
index 0000000..5e2d168
--- /dev/null
@@ -0,0 +1,86 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2018  IPFire Team  <info@ipfire.org>                          #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 0.1.10
+
+THISAPP    = libestr-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = libestr
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = f4c9165a23587e77f7efe65d676d5e8e
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && ./configure    \
+               --prefix=/usr           \
+               --enable-static=no
+
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
+
diff --git a/lfs/libfastjson b/lfs/libfastjson
new file mode 100644 (file)
index 0000000..80f41af
--- /dev/null
@@ -0,0 +1,86 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2018  IPFire Team  <info@ipfire.org>                          #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 0.99.8
+
+THISAPP    = libfastjson-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = libfastjson
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = fe7b4eae1bf40499f6f92b51d7e5899e
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && ./configure    \
+               --prefix=/usr           \
+               --enable-static=no
+
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
+
diff --git a/lfs/liblogging b/lfs/liblogging
new file mode 100644 (file)
index 0000000..22ae480
--- /dev/null
@@ -0,0 +1,86 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2018  IPFire Team  <info@ipfire.org>                          #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 1.0.6
+
+THISAPP    = liblogging-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = liblogging
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = f215c7e7ac6cfd1f5dabdba08c522b29
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && ./configure    \
+               --prefix=/usr           \
+               --enable-static=no
+
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
+
diff --git a/lfs/rsyslog b/lfs/rsyslog
new file mode 100644 (file)
index 0000000..e18aa4a
--- /dev/null
@@ -0,0 +1,101 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2018  IPFire Team  <info@ipfire.org>                          #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 8.35.0
+
+THISAPP    = rsyslog-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+PROG       = rsyslog
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = 5c691d1c743a07df855a8c89bd3bc903
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+
+       cd $(DIR_APP) && ./configure    \
+               --prefix=/usr           \
+               --disable-largefile     \
+               CFLAGS="-L/lib"
+
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+
+       # Add rsyslog.d additional configuration and PKI directory
+       -mkdir -pv /etc/rsyslog.d
+       chmod 0755 /etc/rsyslog.d
+       chown -R root:root /etc/rsyslog.d
+
+       # Add dhcpd and messages logs
+       touch /var/log/dhcpcd.log
+       touch /var/log/messages
+       chmod 664 /var/log/dhcpcd.log
+       chmod 664 /var/log/messages
+       chown root:syslogd /var/log/dhcpcd.log
+       chown root:syslogd /var/log/messages
+
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
+
diff --git a/make.sh b/make.sh
index 0238cc38712ace7ca2c3dcc1600a2e3af8c6fe2d..e00fe49d46535dcfb3f2fde5973fa32cef525205 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1318,6 +1318,10 @@ buildipfire() {
   lfsmake2 hplip
   lfsmake2 cifs-utils
   lfsmake2 krb5
+  lfsmake2 libestr
+  lfsmake2 liblogging
+  lfsmake2 libfastjson
+  lfsmake2 rsyslog
   lfsmake2 samba
   lfsmake2 sudo
   lfsmake2 mc
index 0704a98dcca19c1000899c8ddd0eabe80e2db73d..1214055e6ab31e67e2690d575a2d99f21d66025b 100644 (file)
@@ -19,7 +19,7 @@ fi
 # reload inittab
 /sbin/init q
 #
-/etc/init.d/sysklogd start
+/etc/init.d/rsyslog start
 export LANG=en_US.utf8
 /usr/sbin/setup /dev/tty2 INSTALL
 if [ "${?}" == "1" ]; then
@@ -42,5 +42,5 @@ killall udevd
 /sbin/udevd --daemon
 /sbin/udevadm trigger
 /sbin/udevadm settle
-/etc/init.d/sysklogd stop
+/etc/init.d/rsyslog stop
 touch /var/ipfire/main/firstsetup_ok
diff --git a/src/initscripts/system/rsyslog b/src/initscripts/system/rsyslog
new file mode 100644 (file)
index 0000000..695c171
--- /dev/null
@@ -0,0 +1,80 @@
+#!/bin/bash
+
+#
+# Startup script for rsyslog.
+#
+# Short-Description: Enhanced system logging and kernel message trapping BINs
+#
+# $Author: ummeegge ipfire org
+# $Date: 02.02.2018
+#############################################################################
+#
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+NAME="rsyslogd"
+BIN="/usr/sbin/${NAME}"
+CONF="/etc/rsyslog.conf"
+lockfile="/var/lock/subsys/${NAME}"
+PIDFILE="/var/run/rsyslog.pid"
+DESC="enhanced syslogd"
+SYSLOGD_OPTIONS="-i ${PIDFILE}"
+
+# Exit if the package is not installed
+[ -x ${BIN} ] || exit 5
+
+# Do not start rsyslog when sysklogd is running
+if [ -e /var/run/syslogd.pid ]; then
+       echo "Shut down sysklogd before you run rsyslog"
+       exit 1
+fi
+
+# syslogd needs to be in tty group
+if ! grep -q "^tty:x:5:syslogd$" /etc/group; then
+    usermod -a -G tty syslogd 2>/dev/null
+fi
+
+# Add work dir if not presant
+if [ ! -e "/var/spool/rsyslog" ]; then
+        mkdir /var/spool/rsyslog 2>/dev/null
+fi
+
+case "${1}" in
+       start)
+               boot_mesg "Starting ${DESC}... "
+               loadproc ${BIN} ${SYSLOGD_OPTIONS}
+
+               boot_mesg "Saving Bootlog..."
+               if [ -e /var/log/bootlog ]; then
+                   mv -f /var/log/bootlog /var/log/bootlog.old
+               fi
+               dmesg -c > /var/log/bootlog
+
+               evaluate_retval && touch ${lockfile}
+       ;;
+
+       stop)
+               boot_mesg "Stopping ${DESC}... "
+               killproc ${BIN}
+               rm -f ${PIDFILE} ${lockfile}
+       ;;
+
+       restart)
+               ${0} stop
+               sleep 1
+               ${0} start
+       ;;
+
+       status)
+               statusproc ${BIN}
+       ;;
+
+       *)
+               echo "Usage: ${0} {start|stop|restart|status}"
+               exit 1
+       ;;
+esac
+
+# End $rc_base/init.d/rsyslog
+
diff --git a/src/initscripts/system/sysklogd b/src/initscripts/system/sysklogd
deleted file mode 100644 (file)
index 4482559..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/sysklogd
-#
-# Description : Sysklogd loader
-#
-# Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
-#
-# Version     : 00.00
-#
-# Notes       :
-#
-########################################################################
-
-. /etc/sysconfig/rc
-. ${rc_functions}
-
-case "${1}" in
-       start)
-               boot_mesg "Starting kernel log daemon..."
-               loadproc klogd -c 1
-
-               boot_mesg "Starting system log daemon..."
-               loadproc syslogd -m 0
-
-               boot_mesg "Saving Bootlog..."
-               if [ -e /var/log/bootlog ]; then
-                   mv -f /var/log/bootlog /var/log/bootlog.old
-               fi
-               dmesg -c > /var/log/bootlog
-               evaluate_retval
-               ;;
-       stop)
-               boot_mesg "Stopping kernel log daemon..."
-               killproc klogd
-
-               boot_mesg "Stopping system log daemon..."
-               killproc syslogd
-               ;;
-
-       reload)
-               boot_mesg "Reloading system log daemon config file..."
-               reloadproc syslogd 1
-               ;;
-
-       restart)
-               ${0} stop
-               sleep 1
-               ${0} start
-               ;;
-
-       status)
-               statusproc syslogd
-               statusproc klogd
-               ;;
-
-       *)
-               echo "Usage: ${0} {start|stop|reload|restart|status}"
-               exit 1
-               ;;
-esac
-
-# End $rc_base/init.d/sysklogd
index d73c4226518f3082086f993e0681db410d789597..dad9493239c1464f5c48ee507a8d0f451ebca7c7 100644 (file)
@@ -27,8 +27,8 @@
 #define ERR_ANY 1
 #define ERR_SETTINGS 2    /* error in settings file */
 #define ERR_ETC 3         /* error with /etc permissions */
-#define ERR_CONFIG 4      /* error updating syslogd config */
-#define ERR_SYSLOG 5      /* error restarting syslogd */
+#define ERR_CONFIG 4      /* error updating rsyslog config */
+#define ERR_SYSLOG 5      /* error restarting rsyslog */
 
 int main(void)
 {
@@ -52,7 +52,7 @@ int main(void)
 
    if (!readkeyvalues(kv, "/var/ipfire/logging/settings"))
    {
-      fprintf(stderr, "Cannot read syslog settings\n");
+      fprintf(stderr, "Cannot read rsyslog settings\n");
       exit(ERR_SETTINGS);
    }
 
@@ -106,7 +106,7 @@ int main(void)
 
    /* O_CREAT with O_EXCL will make open() fail if the file already exists -
     * mostly to prevent 2 copies running at once */
-   if ((config_fd = open( "/etc/syslog.conf.new", O_WRONLY|O_CREAT|O_EXCL, 0644 )) == -1 )
+   if ((config_fd = open( "/etc/rsyslog.conf.new", O_WRONLY|O_CREAT|O_EXCL, 0644 )) == -1 )
    {
       perror("Unable to open new config file");
       exit(ERR_CONFIG);
@@ -118,18 +118,18 @@ int main(void)
       if (strcmp(protocol, "tcp") == 0)
       {
          /* write line for TCP */
-         snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+\\)@@\\?.\\+$/\\1@@%s/' /etc/syslog.conf >&%d", hostname, config_fd);
+         snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+\\)@@\\?.\\+$/\\1@@%s/' /etc/rsyslog.conf >&%d", hostname, config_fd);
       }
       else
       {
          /* write line for UDP */
-         snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+\\)@@\\?.\\+$/\\1@%s/' /etc/syslog.conf >&%d", hostname, config_fd);
+         snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+\\)@@\\?.\\+$/\\1@%s/' /etc/rsyslog.conf >&%d", hostname, config_fd);
       }
    }
    else
    {
       /* if remote syslog has been disabled */
-      snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@@\\?.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd );
+      snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@@\\?.\\+\\)$/#\\1/' /etc/rsyslog.conf >&%d", config_fd );
    }
 
      /* if the return code isn't 0 failsafe */
@@ -137,15 +137,15 @@ int main(void)
    {
       fprintf(stderr, "sed returned bad exit code: %d\n", rc);
       close(config_fd);
-      unlink("/etc/syslog.conf.new");
+      unlink("/etc/rsyslog.conf.new");
       exit(ERR_CONFIG);
    }
    close(config_fd);
    
-   if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1)
+   if (rename("/etc/rsyslog.conf.new", "/etc/rsyslog.conf") == -1)
    {
       perror("Unable to replace old config file");
-      unlink("/etc/syslog.conf.new");
+      unlink("/etc/rsyslog.conf.new");
       exit(ERR_CONFIG);
    }
 
@@ -155,13 +155,13 @@ int main(void)
    {
       if(errno == ENOENT)
       {
-         /* pid file doesn't exists.. restart syslog */
-         if((rc = safe_system("/usr/sbin/syslogd u syslogd -m 0")) == 0 )
+         /* pid file does exists.. restart rsyslog */
+         if((safe_system("/etc/init.d/rsyslog restart >/dev/null")) == 0 )
             return 0;
          else
          {
             fprintf(stderr,
-               "Unable to restart syslogd - returned exit code %d\n", rc);
+               "Unable to restart rsyslog - returned exit code %d\n", rc);
             exit(ERR_SYSLOG);
          }
       } else {