[arch-projects] [PATCH] [initscripts] Avoid error message when switch runlevels.

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Sat Jun 4 20:22:23 EDT 2011


Going from multi to single and going back to multi, bootlogd is not running.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
---
 rc.multi  |    8 +++++---
 rc.single |    8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/rc.multi b/rc.multi
index 60bb835..7af9279 100755
--- a/rc.multi
+++ b/rc.multi
@@ -26,8 +26,10 @@ 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
+	/bin/touch /var/log/boot
+	kill $(< /run/bootlogd.pid)
+	/bin/rm -f /run/bootlogd.pid
+fi
 
 # vim: set ts=2 sw=2 noet:
diff --git a/rc.single b/rc.single
index 92b8f53..6a8cc29 100755
--- a/rc.single
+++ b/rc.single
@@ -48,9 +48,11 @@ if [[ $RUNLEVEL = 1 ]]; then
 	exec /sbin/init -t1 S
 fi
 
-/bin/touch /var/log/boot
-kill $(/bin/cat /run/bootlogd.pid)
-/bin/rm /run/bootlogd.pid
+if [[ -f /run/bootlogd.pid ]]; then
+	/bin/touch /var/log/boot
+	kill $(< /run/bootlogd.pid)
+	/bin/rm -f /run/bootlogd.pid
+fi
 
 # End of file
 # vim: set ts=2 sw=2 noet:
-- 
1.7.5.2



More information about the arch-projects mailing list