[Splashy-devel] Bug#451846: splashy: garbage in non-splashy init scripts

Luca Capello luca at pca.it
Wed Nov 28 23:24:52 UTC 2007


tags 451846 + patch
thanks

Hi Luis!

On Mon, 19 Nov 2007 03:33:25 +0100, Luis Mondesi wrote:
> Would you mind trying the latest lsb-base-logging.sh script from our git repo?
>
> http://git.debian.org/?p=splashy/splashy.git;a=blob_plain;f=scripts/
> lsb-base-logging.sh;h=64fcf3629bf5f46c2fcef268c83187a889b1f15d
>
> Just drop that file replacing /etc/lsb-base-logging.sh

As Yaroslav already reported, this doesn't change anything.

However, I forgot to add that I experienced the problem when splashy was
not running (because no fb was available and the kernel option 'splash'
was not set).  So I investigate a bit more and I found that we've two
bugs here...

1) the modified log_daemon_msg() should not execute splashy code when
   splashy is not running.  This is what happens in log_end_msg(), so I
   propose a similar patch.  However, I don't see why even in
   log_end_msg() the pidof call is in parenthesis, so I removed it:

--8<---------------cut here---------------start------------->8---
diff --git a/scripts/lsb-base-logging.sh b/scripts/lsb-base-logging.sh
index 64fcf36..9a6ddd3 100644
--- a/scripts/lsb-base-logging.sh
+++ b/scripts/lsb-base-logging.sh
@@ -51,7 +51,7 @@ log_end_msg () {
 
     # It makes no sense for us to send this step if splashy is not running
     # Although then splashy_update would just return
-    (pidof splashy > /dev/null) || return $1; 
+    pidof splashy > /dev/null || return $1; 
 
     # Get progress percentage of this script
     # was calculated by update-progress-steps
@@ -112,7 +112,11 @@ log_daemon_msg () {
 
     ##############################################################
     # Splashy code 
-   
+
+    # It makes no sense for us to send this step if splashy is not running
+    # Although then splashy_update would just return
+    pidof splashy > /dev/null || return $1; 
+
     # send log to splashy. it will show if F2 is pressed
     pidof splashy > /dev/null && splashy_update "scroll $1: $2"
 
--8<---------------cut here---------------end--------------->8---


2) splash_chvt seems not to accept option 'auto', the following untested
   patch [1] check for option being a number only when it's not 'auto':

--8<---------------cut here---------------start------------->8---
diff --git a/src/splashy_main.c b/src/splashy_main.c
index 6bb5182..7edcc97 100644
--- a/src/splashy_main.c
+++ b/src/splashy_main.c
@@ -69,13 +69,18 @@ main (int argc, char *argv[])
         
         if ( g_ascii_strncasecmp (basename(argv[0]),"splashy_chvt",12) == 0 )
         {
-                char *c = argv[1];
-                for (c = argv[1]; *c != '\0'; c++)
-                        if ( ! isdigit(*c) )
+                if ( g_ascii_strncasecmp (argv[1],"auto",4) != 0 )
+                {
+                        char *c = argv[1];
+                        for (c = argv[1]; *c != '\0'; c++)
                         {
-                                g_printerr ("%s\n", USAGE);
-                                return 1;
+                                if ( ! isdigit(*c) )
+                                {
+                                        g_printerr ("%s\n", USAGE);
+                                        return 1;
+                                }
                         }
+                }
                 /* behave like chvt */
                 splashy_chvt (atoi(argv[1]));
                 return 0;
--8<---------------cut here---------------end--------------->8---

Please consider for inclusion, TIA.

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453349





More information about the Splashy-devel mailing list