Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Joe Slater <jslater@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 1/1] sysvinit: modify bootlog location
Date: Wed, 8 May 2013 16:03:58 -0700	[thread overview]
Message-ID: <1368054238-21389-1-git-send-email-jslater@windriver.com> (raw)

The default location for bootlog is volatile,
so we change it to something that is not.
---
 meta/recipes-core/sysvinit/sysvinit/bootlogd.init |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
index f8f07a0..4422166 100755
--- a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
+++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -37,6 +37,19 @@ case "$0" in
 		;;
 esac
 
+# default /var/log/boot is not an option since /var/log becomes
+# /var/volatile/log
+logfile=/var/local/bootlogd.log
+
+#
+# Create initial log files
+#
+if [ ! -f "$logfile" ] && touch "$logfile" >/dev/null 2>&1; then
+	echo "(Nothing has been logged yet.)" >| "$logfile"
+	chown root:adm "$logfile"
+	chmod 640 "$logfile"
+fi
+
 case "$ACTION" in
 	start)
 		echo -n "Starting $DESC: "
@@ -44,9 +57,9 @@ case "$ACTION" in
 		then
 			umask 027
 			start-stop-daemon --start --quiet \
-				--exec $DAEMON -- -r
+				--exec $DAEMON -- -r -l $logfile
 		else
-			$DAEMON -r
+			$DAEMON -r -l $logfile
 		fi
 		echo "$NAME."
 		;;
@@ -70,7 +83,7 @@ case "$ACTION" in
 		echo -n "Restarting $DESC: "
 		start-stop-daemon --stop --quiet --exec $DAEMON
 		sleep 1
-		start-stop-daemon --start --quiet --exec $DAEMON
+		start-stop-daemon --start --quiet --exec $DAEMON -- -l $logfile
 		echo "$NAME."
 		;;
 	*)
-- 
1.7.3.4




             reply	other threads:[~2013-05-08 23:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08 23:03 Joe Slater [this message]
2013-05-10  9:42 ` [PATCH 1/1] sysvinit: modify bootlog location Burton, Ross
2013-05-10 22:00   ` Saul Wold
2013-05-13 22:36     ` Slater, Joseph
2013-05-14  3:25       ` ChenQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368054238-21389-1-git-send-email-jslater@windriver.com \
    --to=jslater@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox