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>
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:
logwatch:x:102:
cron:x:104:
syslogd:x:105:
-klogd:x:106:
postfix:x:107:
postdrop:x:108:
clamav:x:109:
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
}
--- /dev/null
+# /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
+
+
+++ /dev/null
-# 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
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
#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
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
#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
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
#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
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
#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
--- /dev/null
+#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
--- /dev/null
+#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
--- /dev/null
+#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
#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
#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
--- /dev/null
+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
etc/resolv.conf
etc/securetty
etc/sysctl.conf
-etc/syslog.conf
+etc/rsyslog.conf
etc/system-release
#home
home/nobody
+++ /dev/null
-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
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
#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
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
#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
etc/resolv.conf
etc/securetty
etc/sysctl.conf
-etc/syslog.conf
+etc/rsyslog.conf
etc/system-release
#home
home/nobody
$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',
$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>",
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
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
--- /dev/null
+###############################################################################
+# #
+# 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)
+
--- /dev/null
+###############################################################################
+# #
+# 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)
+
--- /dev/null
+###############################################################################
+# #
+# 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)
+
--- /dev/null
+###############################################################################
+# #
+# 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)
+
lfsmake2 hplip
lfsmake2 cifs-utils
lfsmake2 krb5
+ lfsmake2 libestr
+ lfsmake2 liblogging
+ lfsmake2 libfastjson
+ lfsmake2 rsyslog
lfsmake2 samba
lfsmake2 sudo
lfsmake2 mc
# 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
/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
--- /dev/null
+#!/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
+
+++ /dev/null
-#!/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
#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)
{
if (!readkeyvalues(kv, "/var/ipfire/logging/settings"))
{
- fprintf(stderr, "Cannot read syslog settings\n");
+ fprintf(stderr, "Cannot read rsyslog settings\n");
exit(ERR_SETTINGS);
}
/* 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);
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 */
{
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);
}
{
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 {