Bug 141016 - If installation fails unusable system is booted
Summary: If installation fails unusable system is booted
Status: RESOLVED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Installation (show other bugs)
Version: Alpha 4
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Jiri Srain
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-24 23:19 UTC by Michael Stather
Modified: 2006-08-10 11:17 UTC (History)
2 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stather 2005-12-24 23:19:08 UTC
When stage 2 (after the reboot after copying CD 1) of the installation fails (in my case it was a samages CD so I pressed "Cancel") the installer quits but the system continues to boot, in my case into a totally unusable system. It should say "installation failed" just like with stage 1.
Comment 1 Ladislav Slezák 2006-01-03 09:16:11 UTC
During the second stage linuxrc is not running so it's not possible to display the error message and go back. You just have half installed system, nothing more. What should we do? Ask user Reboot/Shutdown/Continue? Start the second stage again during the next boot?

Stano, any idea how to solve the problem better?
Comment 2 Stanislav Visnovsky 2006-01-10 07:34:59 UTC
To ask if the user wants to restart the installation might be a good idea.

We need to handle 2 cases: if a user aborts the installation or if YaST 
crashes.
Comment 4 Jiri Srain 2006-01-11 16:28:35 UTC
If YaST is aborted, the information is written to yast.inf.
Comment 8 Marcus Schaefer 2006-01-12 11:13:49 UTC
What Do you think about the following patch:

Index: YaST2.call
===================================================================
--- YaST2.call	(revision 26986)
+++ YaST2.call	(working copy)
@@ -318,6 +318,17 @@
 			$Y2_MODE
 	fi
 	Y2_EXIT_CODE=$?
+	Y2_ABORT_MESSAGE="YaST seems to be aborted abnormally !"
+	if [ -f /etc/yast.inf ];then
+		if [ -s /etc/yast.inf ];then
+			cat /etc/yast.inf | grep -q -i "Aborted: 1"
+			if [ $? = 0 ];then
+				log "\t$Y2_ABORT_MESSAGE"
+			fi
+		else
+			log "\t$Y2_ABORT_MESSAGE"
+		fi
+	fi
 	if [ $SELECTED_MEDIUM = "SSH" ];then
 		log "\tPreparing SSH installation for reboot"
 		echo $Y2_EXIT_CODE > /tmp/YaST2_ssh_installation_finished
Comment 9 Marcus Schaefer 2006-01-17 11:03:53 UTC
any news here ?
Comment 10 Jiri Srain 2006-01-23 08:40:10 UTC
I guess you should also check for the exit code.

I suggest following:

If therhe is Aborted: 1 is in yast.inf, installation was aborted.

Else if the exit code is non-zero, YaST failed/crashed.

Else everything went fine.

Missing yast.inf needn't mean that something strange happened.
Comment 11 Marcus Schaefer 2006-01-23 10:31:53 UTC
The time I was starting to rewrite the scripts someone told me not to
handle the exit code from yast (y2base) I don't know why but are you
sure I can handle it the same was as I did for any other command ? which
means everything != 0 is an error ?

if yast.inf exists but is empty, this is an error as well, isn't it ?

Please see the changed patch:

Index: YaST2.call
===================================================================
--- YaST2.call  (revision 27191)
+++ YaST2.call  (working copy)
@@ -318,6 +318,33 @@
                        $Y2_MODE
        fi
        Y2_EXIT_CODE=$?
+       Y2_ABORT_MESSAGE="YaST seems to be aborted abnormally !"
+       Y2_OK_MESSAGE="YaST procedure ended successfully"
+       if [ ! $Y2_EXIT_CODE = 0 ];then
+               #=============================================
+               # YaST error code handling
+               #---------------------------------------------
+               log "\t$Y2_ABORT_MESSAGE"
+       elif [ -f /etc/yast.inf ];then
+               #=============================================
+               # YaST error code ok, check yast.inf contents
+               #---------------------------------------------
+               if [ -s /etc/yast.inf ];then
+                       # yast.inf exists and countains Aborted...
+                       cat /etc/yast.inf | grep -q -i "Aborted: 1"
+                       if [ $? = 0 ];then
+                               log "\t$Y2_ABORT_MESSAGE"
+                       fi
+               else
+                       # yast.inf exists but is empty...
+                       log "\t$Y2_ABORT_MESSAGE"
+               fi
+       else
+               #=============================================
+               # YaST ended successfully
+               #---------------------------------------------
+               log "\t$Y2_OK_MESSAGE"
+       fi
        if [ $SELECTED_MEDIUM = "SSH" ];then
                log "\tPreparing SSH installation for reboot"
                echo $Y2_EXIT_CODE > /tmp/YaST2_ssh_installation_finished
Comment 12 Jiri Srain 2006-01-23 10:48:38 UTC
Sorry, you are right about the exit codes. So it would be better to chech on some well-known codes (which a process returns in case of SIGSEGV, ABR and similar signals).

If yast.inf doesn't exist after 2nd stage of installation, it does not mean an error. yast.inf is primarily used to pass information from YaST to Linuxrc (during 1st stage of installation). During 2nd stage (if I didn't miss anything in the code) it is written only in case of abort.
Comment 13 Marcus Schaefer 2006-01-23 10:55:19 UTC
- what are these codes in case of YaST ?

- the patch above checks if yast.inf exists and if it is not empty. if
  it exists and is empty this is an error as well or is this check invalid ?
Comment 14 Jiri Srain 2006-01-23 11:50:45 UTC
Regarding yast.inf: The only chech should be:

It exists and contains the line "Aborted: 1"


Don't know about the exit codes, even YaST modules should be able to change the exit code of the whole y2base process.
Comment 15 Marcus Schaefer 2006-01-23 12:04:05 UTC
ok, done
Comment 16 Michael Stather 2006-04-03 22:36:47 UTC
It doesn´t work in beta9. The installer hung at the online update (I submitted a bug report for it), then I switched to console #1 and pressed CTRL+C and the installation "continued". IMHO it should stop and say that something went wrong instead of creating a half-finished system.
Comment 17 Marcus Schaefer 2006-04-04 09:32:46 UTC
Jiri ?
Comment 18 Lukas Ocilka 2006-04-21 10:56:12 UTC
Michael, please, provide YaST logs for the error mentioned in comment #16.
You might also tell us which bug you have filed if YaST logs are there :)
Thanks.
Comment 19 Michael Stather 2006-04-21 11:01:41 UTC
Fortunately this didn´t occur any more in RC1 :)
So I don´t have the logs for beta9 there anymore because it worked.
But apart from that this bug is still valid. Just press CTRL+C somewhere in the stage 2 and see what happens :(
Comment 20 Lukas Ocilka 2006-04-21 13:38:53 UTC
K: could you, please, try that if you have a time? (see comment #19)
Comment 21 Jiri Srain 2006-08-10 11:17:11 UTC
AK, according to comment 19 and no more reports resolving this bug as FIXED.