3 Commits

Author SHA1 Message Date
Jay Larson
9a40963b05 The following changes were made:
* Updated /etc/default/sysklogd
  * Updated init script
2017-05-17 10:34:53 -05:00
Jay Larson
4e9f1aae29 Corrected permissions for etc/init.d/sysklogd 2017-05-05 17:21:42 -05:00
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 126 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 = 5
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 755 $(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); \

7
SNAP/sysklogd.default Normal file
View File

@@ -0,0 +1,7 @@
# Options for sysklogd
# Options for syslogd
SYSLOGD_OPTIONS="-m 0"
# Options for klogd
KLOGD_OPTINS="-c 1"

69
SNAP/sysklogd.init Executable file
View File

@@ -0,0 +1,69 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: $syslog
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network sendsignals
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts kernel and system log daemons.
# X-Required: true
### END INIT INFO
SYSLOGD="/sbin/syslogd"
KLOGD="/sbin/klogd"
. /lib/lsb/init-functions
[ -r /etc/default/sysklogd ] && . /etc/default/sysklogd
case "$1" in
start)
log_init_msg "Starting system log daemon"
start_daemon "$SYSLOGD" "$SYSLOGD_OPTIONS" && log_success_msg || \
log_failure_msg
log_init_msg "Starting kernel log daemon"
start_daemon "$KLOGD" "$KLOGD_OPTIONS" && log_success_msg || log_failure_msg
;;
stop)
log_init_msg "Stopping kernel log daemon"
killproc /sbin/klogd && log_success_msg || log_failure_msg
log_init_msg "Stopping system log daemon"
killproc /sbin/syslogd && log_success_msg || log_failure_msg
;;
reload)
log_init_msg "Reloading system log daemon config file"
killproc "$SYSLOGD" -HUP && log_success_msg || log_failure_msg
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
pid=$(pidofproc "$SYSLOGD");
if [ "$?" -ne 0 ]; then
echo "System log daemon is not runing"
else
echo "System log daemon running with PID: $pid"
fi
pid=$(pidofproc "$KLOGD");
if [ "$?" -ne 0 ]; then
echo "Kernel log daemon is not runing"
else
echo "Kernel log daemon running with PID: $pid"
fi
;;
*)
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)