Your message dated Tue, 05 Sep 2006 09:32:16 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#382115: fixed in console-tools 1:0.2.3dbs-65
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: console-tools
Version: 1:0.2.3dbs-64
Severity: normal
Tags: patch

console-screen.sh init script spawns many really unncessary processes.
I'm providing patch along with commentary to fix this.

--- console-screen.sh.orig      2006-08-09 02:04:35.000000000 +0200
+++ console-screen.sh   2006-08-09 02:02:38.000000000 +0200
@@ -82,16 +82,15 @@
 
     # start vcstime
     if [ "${DO_VCSTIME}" = "yes" -a -x ${VCSTIME} ] ; then
-       echo -n Starting clock on text console: `basename ${VCSTIME}`
+       echo Starting clock on text console: ${VCSTIME}

Spawning process to canoncalize executable name seems unncessary for me...

        ${VCSTIME} ${VCSTIME_OPT} &
-       echo .

Style...  I really don't like "echo -n"; ...; echo "done" combo.
This is just personal thing, "echo" is shell built-in so it doesn't do
harm, please ignore this if you like different way.  (and it seems you
do :)

     fi
 
 
     # Global default font+sfm
     if [ "${SCREEN_FONT}" ]
        then
-       echo -n "Setting up general console font... "
+       echo "Setting up general console font."
        SCREEN_FONT="-f ${SCREEN_FONT}"
 
        # maybe use an external SFM
@@ -101,76 +100,56 @@
        # _before_ getty and so only one console running. So,
        # Set for the first 6 VCs (as they are allocated in /etc/inittab)
        NUM_CONSOLES=`fgconsole --next-available`
-       NUM_CONSOLES=`expr ${NUM_CONSOLES} - 1`
+       NUM_CONSOLES=$(($NUM_CONSOLES - 1))

$((expression)) works with dash/ash, no need for expr.


        [ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
-       for vc in `seq 0 ${NUM_CONSOLES}` 
+       i=0
+       while [ $i -lt $NUM_CONSOLES ]
            do
-           ${SETFONT} --tty=${DEVICE_PREFIX}$vc ${SETFONT_OPT} ${SCREEN_FONT} 
${SCREEN_FONT_MAP} || { echo " failed."; break; }
-           if [ "$vc" -eq ${NUM_CONSOLES} ]; then echo " done."; fi 
+           ${SETFONT} --tty=${DEVICE_PREFIX}$i ${SETFONT_OPT} ${SCREEN_FONT} 
${SCREEN_FONT_MAP} || { echo "$i failed."; break; }
+           i=$(($i + 1))
        done
     fi

seq of course spawns process... "[" and "$((expression))" is built-in.


Here goes tricky part, I wont explain this -- I dont use SFMs so I
fixed ACMs and copied changes here...  I haven't tested font+sfm
part!  (It should work, though.)
 
-    # Per-VC font+sfm
-    PERVC_FONTS="`set | grep "^SCREEN_FONT_vc[0-9]*="  | tr -d \' `"
-    if [ "${PERVC_FONTS}"  ]
+    # Per-VC SFMs
+    VCS="`set | grep '^SCREEN_FONT_vc[0-9]*=' | sed -e 's/^SCREEN_FONT_vc//' 
-e 's/=.*//'`"
+    if [ "${VCS}" ]
        then
-       echo -n "Setting up per-VC fonts: "
-       for font in ${PERVC_FONTS}
+       echo "Setting up per-VC fonts."
+       for vc in ${VCS}
          do
-           # extract VC and FONTNAME info from variable setting
-         vc=`echo $font | cut -b15- | cut -d= -f1`
          eval font=\$SCREEN_FONT_vc$vc
-         if [ X"$QUIET_PERVC" != X1 ] ; then
-             echo -n "${DEVICE_PREFIX}${vc}, "
-         fi
-           # eventually find an associated SFM
          eval sfm=\${SCREEN_FONT_MAP_vc${vc}}
          [ "$sfm" ] && sfm="-u $sfm"
-
          ${SETFONT} --tty=${DEVICE_PREFIX}$vc ${SETFONT_OPT} -f $font $sfm
        done
-       echo "done."
     fi
 

-
     # Global ACM
     [ "${APP_CHARSET_MAP}" ] && ${CHARSET} G0 ${APP_CHARSET_MAP}

ACMs start here:

-
     # Per-VC ACMs
-    PERVC_ACMS="`set | grep "^APP_CHARSET_MAP_vc[0-9]*="  | tr -d \' `"
-    if [ "${PERVC_ACMS}" ]
+    VCS="`set | grep '^APP_CHARSET_MAP_vc[0-9]*=' | sed -e 
's/^APP_CHARSET_MAP_vc//' -e 's/=.*//'`"


Here, by use of different construct I got list of numbers instead of
APP_CHARSET_MAP_vc-thing that need to be parsed in every iteration of loop.


+    if [ "${VCS}" ]
        then
-       echo -n "Setting up per-VC ACM's: "
-       for acm in ${PERVC_ACMS}
+       echo "Setting up per-VC ACM's."
+       for vc in ${VCS}
          do
-           # extract VC and FONTNAME info from variable setting
-         vc=`echo $acm | cut -b19- | cut -d= -f1`

That saves many processess per iteration...

          eval acm=\$APP_CHARSET_MAP_vc$vc

-         if [ X"$QUIET_PERVC" != X1 ] ; then
-             echo -n "${DEVICE_PREFIX}${vc} ($acm), "
-         fi

Personal style... sorry for that. ;)

-         eval "${CHARSET} --tty='${DEVICE_PREFIX}$vc' G0 '$acm'"
+         ${CHARSET} --tty="${DEVICE_PREFIX}$vc" G0 "$acm"

eval wasn't needed there, was it?

        done
-       echo "done."
     fi
 
 
     # Go to UTF-8 mode as necessary
     # 
-    ENV_FILE="/dev/null"
+    ENV_FILE=''
     [ -r /etc/environment ] && ENV_FILE="/etc/environment"
     [ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
-    for var in LANG LC_ALL LC_CTYPE ; do
-       value=$(egrep "^\s*${var}=" $ENV_FILE | tail -n1 | cut -d= -f2)
-       eval $var=$value
-    done
-    CHARMAP=`LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap`
-    if   test "$CHARMAP" = "UTF-8" 
+    [ "$ENV_FILE" ] && CHARMAP=$(set -a && . "$ENV_FILE" && locale charmap)

This is fast -- by use of auto export shell option this work
flawlessly (I hope).

+    if test "$CHARMAP" = "UTF-8" 
     then
         unicode_start 2> /dev/null || true
-
     else
         unicode_stop 2> /dev/null|| true
     fi
@@ -212,14 +191,16 @@
     # Allow user to remap keys on the console
     if [ -r /etc/console-tools/remap ]
        then
-       dumpkeys < ${DEVICE_PREFIX}1 |sed -f /etc/console-tools/remap |loadkeys 
--quiet
+       dumpkeys < ${DEVICE_PREFIX}1 | sed -f /etc/console-tools/remap | 
loadkeys --quiet

Couldn't resist.

     fi
     # Set LEDS here
     if [ "$LEDS" != "" ]
        then
-       for i in `seq 1 ${NUM_CONSOLES}`
+       i=1
+       while [ $i -lt $NUM_CONSOLES ]
          do
           setleds -D $LEDS < $DEVICE_PREFIX$i
+         i=$(($i + 1))
        done

Yet another remove-seq, use-builtins fixes.

     fi
 }


These changes save about 90 pids!  Main offenders are now consolechars
and charset by itself ("consolechars -f font -m acm" spawns 7 pids).

Please consider using parts (non-cosmetic ones) of my patch.

Thanks for your work!


Here goes patch without commentary:

--- console-screen.sh.orig      2006-08-09 02:04:35.000000000 +0200
+++ console-screen.sh   2006-08-09 02:02:38.000000000 +0200
@@ -82,16 +82,15 @@
 
     # start vcstime
     if [ "${DO_VCSTIME}" = "yes" -a -x ${VCSTIME} ] ; then
-       echo -n Starting clock on text console: `basename ${VCSTIME}`
+       echo Starting clock on text console: ${VCSTIME}
        ${VCSTIME} ${VCSTIME_OPT} &
-       echo .
     fi
 
 
     # Global default font+sfm
     if [ "${SCREEN_FONT}" ]
        then
-       echo -n "Setting up general console font... "
+       echo "Setting up general console font."
        SCREEN_FONT="-f ${SCREEN_FONT}"
 
        # maybe use an external SFM
@@ -101,76 +100,56 @@
        # _before_ getty and so only one console running. So,
        # Set for the first 6 VCs (as they are allocated in /etc/inittab)
        NUM_CONSOLES=`fgconsole --next-available`
-       NUM_CONSOLES=`expr ${NUM_CONSOLES} - 1`
+       NUM_CONSOLES=$(($NUM_CONSOLES - 1))
        [ ${NUM_CONSOLES} -eq 1 ] && NUM_CONSOLES=6
-       for vc in `seq 0 ${NUM_CONSOLES}` 
+       i=0
+       while [ $i -lt $NUM_CONSOLES ]
            do
-           ${SETFONT} --tty=${DEVICE_PREFIX}$vc ${SETFONT_OPT} ${SCREEN_FONT} 
${SCREEN_FONT_MAP} || { echo " failed."; break; }
-           if [ "$vc" -eq ${NUM_CONSOLES} ]; then echo " done."; fi 
+           ${SETFONT} --tty=${DEVICE_PREFIX}$i ${SETFONT_OPT} ${SCREEN_FONT} 
${SCREEN_FONT_MAP} || { echo "$i failed."; break; }
+           i=$(($i + 1))
        done
     fi
 
 
-    # Per-VC font+sfm
-    PERVC_FONTS="`set | grep "^SCREEN_FONT_vc[0-9]*="  | tr -d \' `"
-    if [ "${PERVC_FONTS}"  ]
+    # Per-VC SFMs
+    VCS="`set | grep '^SCREEN_FONT_vc[0-9]*=' | sed -e 's/^SCREEN_FONT_vc//' 
-e 's/=.*//'`"
+    if [ "${VCS}" ]
        then
-       echo -n "Setting up per-VC fonts: "
-       for font in ${PERVC_FONTS}
+       echo "Setting up per-VC fonts."
+       for vc in ${VCS}
          do
-           # extract VC and FONTNAME info from variable setting
-         vc=`echo $font | cut -b15- | cut -d= -f1`
          eval font=\$SCREEN_FONT_vc$vc
-         if [ X"$QUIET_PERVC" != X1 ] ; then
-             echo -n "${DEVICE_PREFIX}${vc}, "
-         fi
-           # eventually find an associated SFM
          eval sfm=\${SCREEN_FONT_MAP_vc${vc}}
          [ "$sfm" ] && sfm="-u $sfm"
-
          ${SETFONT} --tty=${DEVICE_PREFIX}$vc ${SETFONT_OPT} -f $font $sfm
        done
-       echo "done."
     fi
 
-
     # Global ACM
     [ "${APP_CHARSET_MAP}" ] && ${CHARSET} G0 ${APP_CHARSET_MAP}
 
-
     # Per-VC ACMs
-    PERVC_ACMS="`set | grep "^APP_CHARSET_MAP_vc[0-9]*="  | tr -d \' `"
-    if [ "${PERVC_ACMS}" ]
+    VCS="`set | grep '^APP_CHARSET_MAP_vc[0-9]*=' | sed -e 
's/^APP_CHARSET_MAP_vc//' -e 's/=.*//'`"
+    if [ "${VCS}" ]
        then
-       echo -n "Setting up per-VC ACM's: "
-       for acm in ${PERVC_ACMS}
+       echo "Setting up per-VC ACM's."
+       for vc in ${VCS}
          do
-           # extract VC and FONTNAME info from variable setting
-         vc=`echo $acm | cut -b19- | cut -d= -f1`
          eval acm=\$APP_CHARSET_MAP_vc$vc
-         if [ X"$QUIET_PERVC" != X1 ] ; then
-             echo -n "${DEVICE_PREFIX}${vc} ($acm), "
-         fi
-         eval "${CHARSET} --tty='${DEVICE_PREFIX}$vc' G0 '$acm'"
+         ${CHARSET} --tty="${DEVICE_PREFIX}$vc" G0 "$acm"
        done
-       echo "done."
     fi
 
 
     # Go to UTF-8 mode as necessary
     # 
-    ENV_FILE="/dev/null"
+    ENV_FILE=''
     [ -r /etc/environment ] && ENV_FILE="/etc/environment"
     [ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
-    for var in LANG LC_ALL LC_CTYPE ; do
-       value=$(egrep "^\s*${var}=" $ENV_FILE | tail -n1 | cut -d= -f2)
-       eval $var=$value
-    done
-    CHARMAP=`LANG=$LANG LC_ALL=$LC_ALL LC_CTYPE=$LC_CTYPE locale charmap`
-    if   test "$CHARMAP" = "UTF-8" 
+    [ "$ENV_FILE" ] && CHARMAP=$(set -a && . "$ENV_FILE" && locale charmap)
+    if test "$CHARMAP" = "UTF-8" 
     then
         unicode_start 2> /dev/null || true
-
     else
         unicode_stop 2> /dev/null|| true
     fi
@@ -212,14 +191,16 @@
     # Allow user to remap keys on the console
     if [ -r /etc/console-tools/remap ]
        then
-       dumpkeys < ${DEVICE_PREFIX}1 |sed -f /etc/console-tools/remap |loadkeys 
--quiet
+       dumpkeys < ${DEVICE_PREFIX}1 | sed -f /etc/console-tools/remap | 
loadkeys --quiet
     fi
     # Set LEDS here
     if [ "$LEDS" != "" ]
        then
-       for i in `seq 1 ${NUM_CONSOLES}`
+       i=1
+       while [ $i -lt $NUM_CONSOLES ]
          do
           setleds -D $LEDS < $DEVICE_PREFIX$i
+         i=$(($i + 1))
        done
     fi
 }


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (10, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17-riddly3
Locale: LANG=C, LC_CTYPE=pl_PL (charmap=ISO-8859-2)

Versions of packages console-tools depends on:
ii  debconf [debconf-2.0]      1.5.2         Debian configuration management sy
ii  libc6                      2.3.6-15      GNU C Library: Shared libraries
ii  libconsole                 1:0.2.3dbs-64 Shared libraries for Linux console
ii  sysvinit                   2.86.ds1-15   System-V-like init utilities

Versions of packages console-tools recommends:
ii  console-common                0.7.60     Basic infrastructure for text cons
ii  console-data                  2:1.0-2    Keymaps, fonts, charset maps, fall

-- no debconf information


--- End Message ---
--- Begin Message ---
Source: console-tools
Source-Version: 1:0.2.3dbs-65

We believe that the bug you reported is fixed in the latest version of
console-tools, which is due to be installed in the Debian FTP archive:

console-tools-dev_0.2.3dbs-65_i386.deb
  to pool/main/c/console-tools/console-tools-dev_0.2.3dbs-65_i386.deb
console-tools_0.2.3dbs-65.dsc
  to pool/main/c/console-tools/console-tools_0.2.3dbs-65.dsc
console-tools_0.2.3dbs-65.tar.gz
  to pool/main/c/console-tools/console-tools_0.2.3dbs-65.tar.gz
console-tools_0.2.3dbs-65_i386.deb
  to pool/main/c/console-tools/console-tools_0.2.3dbs-65_i386.deb
kbd-compat_0.2.3dbs-65_all.deb
  to pool/main/c/console-tools/kbd-compat_0.2.3dbs-65_all.deb
libconsole_0.2.3dbs-65_i386.deb
  to pool/main/c/console-tools/libconsole_0.2.3dbs-65_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Alastair McKinstry <[EMAIL PROTECTED]> (supplier of updated console-tools 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue,  5 Sep 2006 16:46:25 +0100
Source: console-tools
Binary: kbd-compat console-tools-dev libconsole console-tools
Architecture: source all i386
Version: 1:0.2.3dbs-65
Distribution: unstable
Urgency: low
Maintainer: Alastair McKinstry <[EMAIL PROTECTED]>
Changed-By: Alastair McKinstry <[EMAIL PROTECTED]>
Description: 
 console-tools - Linux console and font utilities
 console-tools-dev - Development files for Linux console and font manipulation
 kbd-compat - Wrappers around console-tools for backward compatibility with `kb
 libconsole - Shared libraries for Linux console and font manipulation
Closes: 366272 382115 382595 384118 384785 386038 386134
Changes: 
 console-tools (1:0.2.3dbs-65) unstable; urgency=low
 .
   * Remove dependency on sysvinit, to allow for upstart. Closes: #386134.
   * Remove reference to <asm/kbio.h> which has been removed from the
     sparc kernel. Closes: #386038.
   * Fix comment typo in unicode_start.
   * Fix defkeymap location in loadkeys map page. Closes: #382595.
   * Include lct-9.html in the docs. Closes: #384118.
   * Patch from Karol Lewandowski for console-screen.sh to remove
     unnecessary process spawns. Closes: #382115.
   * Add LSB logging support to console-screen.sh, patch by
     David Hardeman. Closes: #384785.
   * console-screen.sh: Don't set fonts on tty0. Closes: #366272.
Files: 
 11dd6d74da7156aac39367f8fbf75bef 641 base optional 
console-tools_0.2.3dbs-65.dsc
 59516db94e167b76a1b850f609331361 1490751 base optional 
console-tools_0.2.3dbs-65.tar.gz
 14e7a3dcaf9a6bdcae5807f46b3e9423 43728 utils optional 
kbd-compat_0.2.3dbs-65_all.deb
 c6c34f647ff9e114850dc7533bff4d24 296748 utils optional 
console-tools_0.2.3dbs-65_i386.deb
 a710a079d3ba883741c6442defec8cf5 129680 libs optional 
libconsole_0.2.3dbs-65_i386.deb
 da1041f11f5e28fe52b8cad034026ceb 86344 devel optional 
console-tools-dev_0.2.3dbs-65_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFE/aU5QTK/kCo4XFcRAoPvAJ43lUh/PLwpJohOtQbTJVy+FJLXGQCg1WXv
aS86NJr5AqOwgFCHJ8K6RWA=
=49ck
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to