summaryrefslogtreecommitdiff
blob: af85b1b2477cec80117cf07004686ab05a913150 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Get bootchart to mount $LOG_DIR to /lib/bootchart so our profiling
functions know where to create init_pidname.log

--- script.orig/bootchartd	2005-11-13 17:40:01.000000000 +0000
+++ script/bootchartd	2006-08-04 13:25:00.000000000 +0100
@@ -27,16 +27,15 @@
 elif [ -f $CONF ]; then
         . $CONF
 else
-        echo "$CONF missing"
+        echo "$CONF missing" >&2
         exit 1
 fi
 
-
 # Start the boot logger.
 start()
 {
 	# Make sure only a single instance is running
-	[ -f "$BOOTLOG_LOCK" ] && return
+	[ -f "/lib/bootchart/$BOOTLOG_LOCK" ] && return
 	
 	# Mount the temporary file system for log file storage.  If possible,
 	# a temporary directory is created.  In most cases though (i.e. during
@@ -49,8 +48,13 @@
 		LAZY_UMOUNT="yes"
 		mount -n -t tmpfs -o size=$TMPFS_SIZE none "$LOG_DIR" >/dev/null 2>&1
 	fi
+ 
 	cd "$LOG_DIR"
 	> "$BOOTLOG_LOCK"
+
+	# OK, now bind to a fixed directory so we can create init_pidname.log
+	mount --bind "$LOG_DIR" /lib/bootchart
+	
 	[ -n "$LAZY_UMOUNT" ] && umount -nfl "$LOG_DIR"
 
 	# Enable process accounting if configured
@@ -168,6 +172,9 @@
 		rmdir "$LOG_DIR"
 	fi
 
+	# We're done, so we can release the mount
+	umount /lib/bootchart
+
 	# Render the chart if configured (and the renderer is installed)
 	[ "$AUTO_RENDER" = "yes" -a -x /usr/bin/bootchart ] && \
 		/usr/bin/bootchart -o "$AUTO_RENDER_DIR" -f $AUTO_RENDER_FORMAT "$BOOTLOG_DEST"