baselayout-2 - prefixed instead of buffered output

25 Apr 2007 • 1 min read

baselayout buffers einfo and friends output when running in parallel, so messages don't get mixed up with other services. It does this by storing each einfo command in a file and then processes them when it obtains a lock.

baselayout-2 now buffers stdout and stderr to a file which means the errors are aligned too, so the output should be pretty much perfect.

This is not without any downsides. Firstly, the buffer files take space. Secondly, the buffered output can look a little strange when a long running init script, like say a wireless interface scanning for AP's, suddenly appears in one go.

ciaranm proposed an alternative - prefixing each line with the init script name. He was even kind enough to point to some sample C++ code which did just this for paludis. So after writing a C equivalent (not that hard) baselayout can now do the same. We even colour code for extra prettiness as you can see below 😄

This is toggled through RC_PREFIX="yes" and works independently of RC_PARALLEL.