From d0b7d600da518778b2a5d7c08785ea328fbaf2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20B=C3=A9langer?= Date: Sun, 5 Jun 2011 23:23:57 -0400 Subject: Clean up ANSI codes from /var/log/boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Bélanger Signed-off-by: Tom Gundersen --- rc.multi | 9 ++++++--- rc.single | 10 +++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/rc.multi b/rc.multi index 60bb835..e5ac000 100755 --- a/rc.multi +++ b/rc.multi @@ -26,8 +26,11 @@ fi run_hook multi_end -/bin/touch /var/log/boot -kill $(/bin/cat /run/bootlogd.pid) -/bin/rm /run/bootlogd.pid +if [[ -f /run/bootlogd.pid ]]; then + touch /var/log/boot + kill $(< /run/bootlogd.pid) + rm -f /run/bootlogd.pid + sed -i -r -e 's/\^\[\[[0-9]?;?[0-9]?[0-9]?;?[0-9]?[0-9]?[ms]//g' \ + -e 's/\^\[(\[151|%)G//g' /var/log/boot # vim: set ts=2 sw=2 noet: diff --git a/rc.single b/rc.single index c754eb1..bb27ddf 100755 --- a/rc.single +++ b/rc.single @@ -50,9 +50,13 @@ if [[ $RUNLEVEL = 1 ]]; then exec init -t1 S fi -touch /var/log/boot -kill $(< /run/bootlogd.pid) -rm /run/bootlogd.pid +if [[ -f /run/bootlogd.pid ]]; then + touch /var/log/boot + kill $(< /run/bootlogd.pid) + rm -f /run/bootlogd.pid + sed -i -r -e 's/\^\[\[[0-9]?;?[0-9]?[0-9]?;?[0-9]?[0-9]?[ms]//g' \ + -e 's/\^\[(\[151|%)G//g' /var/log/boot +fi # End of file # vim: set ts=2 sw=2 noet: -- cgit v1.2.3 From 49932857b8bc41c2e494bea1ee278fffa724519d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20B=C3=A9langer?= Date: Fri, 3 Jun 2011 23:06:48 -0400 Subject: Removed superfluous dollar sign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Bélanger Signed-off-by: Tom Gundersen --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index 27e53d0..adf4ea9 100644 --- a/functions +++ b/functions @@ -71,7 +71,7 @@ if [[ $USECOLOR =~ yes|YES ]]; then C_FAIL="\e[1;31m" # failed C_DONE="${C_MAIN}" # completed C_BKGD="\e[1;35m" # backgrounded - C_H1="${$C_MAIN}" # highlight text 1 + C_H1="${C_MAIN}" # highlight text 1 C_H2="\e[1;36m" # highlight text 2 fi fi -- cgit v1.2.3 From 32047175759770ac0b37a1fede68a13e2b4d4fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20B=C3=A9langer?= Date: Fri, 3 Jun 2011 23:18:50 -0400 Subject: Add logrotate config file to rotate /var/log/boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Bélanger Signed-off-by: Tom Gundersen --- Makefile | 3 ++- bootlog | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 bootlog diff --git a/Makefile b/Makefile index ff7d907..c568b13 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ VER := $(shell git describe) -DIRS := /etc/rc.d /etc/conf.d /etc/rc.d/functions.d /sbin /etc/bash_completion.d /usr/share/zsh/site-functions +DIRS := /etc/rc.d /etc/conf.d /etc/rc.d/functions.d /etc/logrotate.d /sbin /etc/bash_completion.d /usr/share/zsh/site-functions minilogd: minilogd.o @@ -9,6 +9,7 @@ installdirs: install: minilogd installdirs install -m644 -t $(DESTDIR)/etc inittab rc.conf install -m755 -t $(DESTDIR)/etc rc.local rc.local.shutdown rc.multi rc.shutdown rc.single rc.sysinit + install -m644 -t $(DESTDIR)/etc/logrotate.d bootlog install -m644 -t $(DESTDIR)/etc/rc.d functions install -m755 -t $(DESTDIR)/etc/rc.d hwclock network netfs install -m755 -t $(DESTDIR)/sbin minilogd rc.d diff --git a/bootlog b/bootlog new file mode 100644 index 0000000..b97af0b --- /dev/null +++ b/bootlog @@ -0,0 +1,9 @@ +/var/log/boot { + compress + rotate 1 + size=+1024k + notifempty + missingok + copytruncate + noolddir +} -- cgit v1.2.3