[Bug 498380] New: yast2-installation stage.sh scripts buggy because it _sources_ external scripts.
http://bugzilla.novell.com/show_bug.cgi?id=498380 Summary: yast2-installation stage.sh scripts buggy because it _sources_ external scripts. Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: vogt@itwm.fraunhofer.de QAContact: jsrain@novell.com Found By: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.8) Gecko/2009032600 SUSE/3.0.8-1.1.1 Firefox/3.0.8 Hello, I'm currently using Yast hooks to run some scripts after the first boot. The so called "SecondStage" in installation. This is documented here: http://svn.opensuse.org/svn/yast/trunk/installation/startup/doc/stage.ps But there is a bug IMHO. In the script: pxe1:/usr/lib/YaST2/startup/common # ll /usr/lib/YaST2/startup/common/stage.sh -rwxr-xr-x 1 root root 2497 Apr 24 18:30 /usr/lib/YaST2/startup/common/stage.sh which is part of package: pxe1:/usr/lib/YaST2/startup/common # rpm -qf /usr/lib/YaST2/startup/common/stage.sh yast2-installation-2.17.43-1.2 The script stage.sh contains the lines: #----[ callStages ]--------# function callStages () { #----------------------------------------------- # call the scripts saved in STAGE_LIST # --- for file in ${STAGE_LIST[*]};do if [ -x $file ];then . $file fi done } Please remove the . before that. Thus I propose this patch: --- stage.sh.org 2009-04-27 11:51:44.000000000 +0200 +++ stage.sh 2009-04-27 11:51:52.000000000 +0200 @@ -70,7 +70,7 @@ # --- for file in ${STAGE_LIST[*]};do if [ -x $file ];then - . $file + $file fi done } Why? Every shell script is sourced, thats ridiculous. First you cannot put anything else that bash scripts in there. (perl,python,binaries???) Then you are modifiying the runtime environment. from the _calling_ process over every successive source call. Every exit <no> in such a script then terminates all other script, it will look like YaST2.Second-Stage has terminated. (Maybe, not tested) Anyway. I think this "bug" is a copy paste bug. The scripts in the directory are all sourced (like a shared libary in bash, which is ok) But the code which then executes the _external_ scripts source them too. This is wrong. Please remove the "." regards, Martin Reproducible: Always Steps to Reproduce: 1.write script with a exit 0, name it S00_autoyast_one 2.write a script with echo "hello world" S01_autoyast_two 3. Actual Results: "hello world" never gets printed Expected Results: All scripts are executed, and the caler environment should be untouched. (Who is programming with sideeffects?= I used the Hook Mechanism for some time now, but I only ever used one script, which terminated with a defined error code. Thus my other script never gets called. Took me some time until I found out why. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=498380
Zheng Chen
http://bugzilla.novell.com/show_bug.cgi?id=498380
Lukas Ocilka
http://bugzilla.novell.com/show_bug.cgi?id=498380
User aschnell@novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=498380#c1
Arvin Schnell
http://bugzilla.novell.com/show_bug.cgi?id=498380
User vogt@itwm.fraunhofer.de added comment
http://bugzilla.novell.com/show_bug.cgi?id=498380#c2
--- Comment #2 from Martin Vogt
participants (1)
-
bugzilla_noreply@novell.com