1 Commits

Author SHA1 Message Date
Jay Larson
3a84f67f3d The following changes were made:
* Added defaults file in usr/share/sysklogd (managed by usher)
  * Added init script
  * Added syslog.conf (managed by usher)
2017-05-05 17:17:45 -05:00
5 changed files with 106 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ DESC = This package implements two system log daemons. The syslogd daemon \
is an enhanced version of the standard Berkeley utility program. The klogd \ is an enhanced version of the standard Berkeley utility program. The klogd \
daemon listens to kernel message sources and is responsible for prioritizing \ daemon listens to kernel message sources and is responsible for prioritizing \
and processing operating system messages. and processing operating system messages.
SNAPVER = 2 SNAPVER = 3
ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1)
TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n')
@@ -55,7 +55,15 @@ $(ROOT): $(SRCDIR)/syslogd
mkdir -v $(ROOT); \ mkdir -v $(ROOT); \
fi fi
@cd $(SRCDIR) && make install DESTDIR=$(ROOT) BINDIR=/sbin @cd $(SRCDIR) && make install DESTDIR=$(ROOT) BINDIR=/sbin && \
install -v -d -m 755 $(ROOT)/etc/{default,init.d} && \
install -v -d -m 755 $(ROOT)/usr/share/sysklogd && \
install -v -m 644 $(PWD)/SNAP/sysklogd.default \
$(ROOT)/usr/share/sysklogd/sysklogd.default && \
install -v -m 644 $(PWD)/SNAP/sysklogd.init \
$(ROOT)/etc/init.d/sysklogd && \
install -v -m 644 $(PWD)/SNAP/syslog.conf \
$(ROOT)/usr/share/sysklogd/syslog.conf
test: $(ROOT) test: $(ROOT)
@cd $(SRCDIR); \ @cd $(SRCDIR); \

3
SNAP/sysklogd.default Normal file
View File

@@ -0,0 +1,3 @@
# Options for sysklogd
# Add '-r' to enable remote logging
SYSKLOGD_OPTIONS='-m 0'

53
SNAP/sysklogd.init Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: $syslog
# Required-Start: localnet
# Required-Stop: $local_fs sendsignals
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts kernel and system log daemons.
# Description: Starts kernel and system log daemons.
### END INIT INFO
. /lib/lsb/init-functions
[ -f /etc/default/sysklogd ] && . /etc/default/sysklogd
case "$1" in
start)
log_info_msg "Starting system log daemon"
start_daemon /sbin/syslogd $SYSKLOGD_OPTIONS && log_success_msg || \
log_failure_msg
log_info_msg "Starting kernel log daemon"
start_daemon /sbin/klogd -c 1 && log_success_msg || log_failure_msg
;;
stop)
log_info_msg "Stopping kernel log daemon"
killproc /sbin/klogd && log_success_msg || log_failure_msg
log_info_msg "Stopping system log daemon"
killproc /sbin/syslogd && log_success_msg || log_failure_msg
;;
reload)
log_info_msg "Reloading system log daemon config file"
pid=`pidofproc syslogd`
kill -HUP "${pid}" && log_success_msg || log_failure_msg
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
statusproc /sbin/syslogd
statusproc klogd
;;
*)
echo "Usage: $0 [start|stop|reload|restart|status]"
exit 1
;;
esac
exit 0

27
SNAP/syslog.conf Normal file
View File

@@ -0,0 +1,27 @@
# Configuration for sysklogd
# Standard log files
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
# Mail configuration
mail.info -/var/log/mail.info
mail.warn -/var/log/mail.warn
mail.err -/var/log/mail.err
# Catch all logs
*.=debug;\
auth,authpriv.none;\
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
# Logging of emergency messages
*.emerg -/var/log/kern.log

View File

@@ -2,22 +2,25 @@
set -e set -e
CONF="auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
#*.emerg *
*.emerg -/var/log/kern.log"
case $1 in case $1 in
preinst) preinst)
exit 0 exit 0
;; ;;
postinst) postinst)
if [ ! -f ${TARGET}/etc/syslog.conf ]; then if [ ! -f ${TARGET}/etc/syslog.conf ]; then
echo "${CONF}" > ${TARGET}/etc/syslog.conf install -m 644 ${TARGET}/usr/share/sysklogd/syslog.conf \
${TARGET}/etc/syslog.conf
fi
if [ ! -f ${TARGET}/etc/default/sysklogd ]; then
install -m 644 ${TARGET}/usr/share/sysklogd/sysklogd.default \
${TARGET}/etc/default/sysklogd
fi
if [[ ! ${TARGET} ]]; then
/etc/init.d/sysklogd restart
update-rc enable sysklogd
else
chroot ${TARGET} 'update-rc enable sysklogd'
fi fi
;; ;;
prerm) prerm)