Bug 102963

Summary: Post-install shell problem
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Jan Engelhardt <jengelh>
Component: InstallationAssignee: Marcus Schaefer <ms>
Status: VERIFIED DUPLICATE QA Contact: Klaus Kämpf <kkaempf>
Severity: Normal    
Priority: P5 - None    
Version: Beta 1   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: For reference, here's a screenie

Description Jan Engelhardt 2005-08-09 09:21:29 UTC
Post-install = YAST from harddisk after CD install

After the post-install has finished and we're finally going to runlevel 3/5 the
first time, 
/usr/lib/YaST2/startup/YaST2.call: line 612: [: =: unary operator expected
See shot.
Comment 1 Jan Engelhardt 2005-08-09 09:22:00 UTC
Created attachment 45237 [details]
For reference, here's a screenie
Comment 2 Lukas Ocilka 2005-08-09 20:59:22 UTC
I'll check it
Comment 3 Lukas Ocilka 2005-08-10 10:21:39 UTC
Marcus this is a bug in YaST2.call script:

--- cut ---
if [ $server_running = 1 ];then
        sleep 1 && kill $xserver_pid
        while kill -0 $xserver_pid 2>/dev/null ; do
                sleep 1
        done
fi
--- cut ---

it seems that the $server_running variable is undefined (empty) and bash cannot
handle that.

Debugging Example:
--- y2call.sh ---
#!/bin/bash

if [ $server_running = 1 ];then
    echo "1"
fi
--- y2call.sh ---

produces --> ./y2call.sh: line 3: [: =: unary operator expected

Solution (quoting):
--- y2call.sh ---
server_running=1

if [ "$server_running" = "1" ];then
    echo "1"
fi
--- y2call.sh ---

produces --> ./y2call.sh
1

And works also with the undefined $server_running variable too
Comment 4 Marcus Schaefer 2005-08-10 10:30:15 UTC
has been fixed yesterday  

*** This bug has been marked as a duplicate of 100729 ***
Comment 5 Jan Engelhardt 2005-08-10 16:35:03 UTC
Rule of thumb: put "" around every var.