Bug#473112: splashy: breaks udev - log_daemon_msg does not play well with -e switch from udev script

2008-03-28 Thread Alban Browaeys
Package: splashy
Version: 0.3.8-1
Severity: important
Tags: patch

udev use sh -e and fails in log_daemon_msg because pidof splashy fails .
The patch fix it (this only happens when splashy is started from
initramfs though the fix is rational in any case). 

Best regards
Alban


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.25-rc7-00025-gacaef06 (SMP w/1 CPU core)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages splashy depends on:
ii  initramfs-tools0.91e tools for generating an initramfs
ii  libc6  2.7-9 GNU C Library: Shared libraries
ii  libdirectfb-1.0-0  1.0.1-8   direct frame buffer graphics - sha
ii  libgcc11:4.3.0-2 GCC support library
ii  libglib2.0-0   2.16.1-2  The GLib library of C routines
ii  libmagic1  4.23-2File type determination library us
ii  libsplashy10.3.8-1   Library to draw splash screen on b
ii  lsb-base   3.2-4 Linux Standard Base 3.2 init scrip
ii  zlib1g 1:1.2.3.3.dfsg-11 compression library - runtime

splashy recommends no packages.

-- no debconf information
--- lsb-base-logging.sh.orig2008-03-28 13:28:53.0 +0100
+++ lsb-base-logging.sh 2008-03-28 13:26:57.0 +0100
@@ -114,7 +114,7 @@
 # Splashy code 

 # send log to splashy. it will show if F2 is pressed
-pidof splashy  /dev/null  splashy_update scroll $1: $2
+pidof splashy  /dev/null  splashy_update scroll $1: $2 || true
 
 # Stop splashy on *dm
 case $2 in 


Bug#473112: [Splashy-devel] Bug#473112: splashy: breaks udev - log_daemon_msg does not play well with -e switch from udev script

2008-03-28 Thread John Hughes
Alban Browaeys wrote:
 udev use sh -e and fails in log_daemon_msg because pidof splashy fails .
 The patch fix it (this only happens when splashy is started from
 initramfs though the fix is rational in any case). 
   
the patch:

--- lsb-base-logging.sh.orig2008-03-28 13:28:53.0 +0100
+++ lsb-base-logging.sh 2008-03-28 13:26:57.0 +0100
@@ -114,7 +114,7 @@
 # Splashy code 

 # send log to splashy. it will show if F2 is pressed
-pidof splashy  /dev/null  splashy_update scroll $1: $2
+pidof splashy  /dev/null  splashy_update scroll $1: $2 || true
 
 # Stop splashy on *dm
 case $2 in 

So it would be simpler to get rid of the pidof splashy call:

splashy_update scroll $1: $2 2/dev/null || true
  

But doing some tests it looks like most (all?) shells don't treat a
command that contains  as an error:

$ cat zztest
set -e
pidof noprog  echo noprog running
echo no error
$ sh -x zztest
+ set -e
+ pidof noprog
+ echo no error
no error
  

Maybe there is some other problem?

Maybe it's splashy_update that's failing?




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#473112: [Splashy-devel] Bug#473112: splashy: breaks udev - log_daemon_msg does not play well with -e switch from udev script

2008-03-28 Thread Alban Browaeys
On ven, 2008-03-28 at 15:58 +0100, John Hughes wrote:

 So it would be simpler to get rid of the pidof splashy call:
 
 splashy_update scroll $1: $2 2/dev/null || true



 But doing some tests it looks like most (all?) shells don't treat a
 command that contains  as an error:
 
 $ cat zztest
 set -e
 pidof noprog  echo noprog running
 echo no error
 $ sh -x zztest
 + set -e
 + pidof noprog
 + echo no error
 no error
   
 
 Maybe there is some other problem?
 
 Maybe it's splashy_update that's failing?


man set :
-e When this option is on, if a simple command fails for any of the
reasons  listed  in  Consequences  of Shell Errors or returns an
exit status value 0, and is not part of the compound list  fol‐
lowing  a  while,  until, or if keyword, and is not a part of an
AND or OR list, and is not a pipeline preceded by the ! reserved
word, then the shell shall immediately exit.

http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_08_01

So the behaviour for AND or OR list is not obvious for me ... 
for example :
set -e 
false  true
echo no error
returns : no error.
by the way :
false  false also returns no error so what kills the script is not
the exit status in a list ...



So basically I agree  does not trigger an error . What I found out is
that inside a function the behaviour changes :

set -e
a() {
false  true
}
a;
echo no error

fails while :
set -e
a() {
false  true || true
}
a;
echo no error
succeed.

So my patch seems needed to get things working as lsb-base-logging.sh
make the list of calls in functions.
Best regards
Alban





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]