On Fri, 2007-03-30 at 02:15 +0200, Jörg Sommer wrote:
> Hello Guus, hello Ziga

Hi Jörg (and sorry for the late reply),

> [...]
> And there you see, dash tries to open /dev/null. The corresponding code
> is the following: (dash-0.5.3/src/jobs.c)

Thanks for getting to the bottom of this!

> [...]
> For job control bootchart needs a heavy rewrite, but I also think it can
> gain something. The other way is to try to redirect the shell error to
> /dev/null.
> 
> What do you think Ziga?

How about we avoid the udev problem (missing /dev/null) by starting the
loggers before udev is started?  This is a simple change, we just need
to make sure the start() function is run in foreground (see diff below).

Once the loggers are started, we no longer need to fork any background
processes, thus avoiding the dash problem.  Getting rid of any
remaining /dev/null references should be easy.

Please give it a try and let me know how that goes.


Thanks,
-- 
Ziga


Index: bootchartd
===================================================================
--- bootchartd  (revision 395)
+++ bootchartd  (working copy)
@@ -59,17 +59,13 @@
                accton kernel_pacct
        fi
        
-       # Wait for /proc to be mounted
-       while [ ! -f /proc/stat ]; do sleep $SAMPLE_PERIOD; done
-       sleep $SAMPLE_PERIOD
-
        #
        # Run loggers in background
        #
        log_output "cat /proc/stat" proc_stat.log &
 
        # /proc/diskstats is available in 2.6 kernels
-       [ -f /proc/diskstats ] && log_output "cat /proc/diskstats" 
proc_diskstats.log &
+       log_output "cat /proc/diskstats" proc_diskstats.log &
 
        log_output "cat /proc/*/stat" proc_ps.log &
        #log_output "ps -eww -o pid,ppid,s,pcpu,comm,cmd" ps.log &
@@ -227,7 +223,7 @@
        # init(1).
        IN_INIT="yes"
        echo "Starting bootchart logging"
-       start &
+       start
        
        # Optionally, an alternative init(1) process may be specified using
        # the kernel command line (e.g. "bootchart_init=/sbin/initng")




Reply via email to