FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Studio User

 
 
LinkBack Thread Tools
 
Old 06-01-2010, 11:23 AM
Hans de Goede
 
Default Ignore errors upon restoring /lib and /usr after unmounting filesystems

Ignore errors upon restoring /lib and /usr after unmounting filesystems,
otherwise these errors always get reported when rebooting before we've
reached stage2. Instead add proper error checking to the execution of
mdadm.

Related: rhbz#598222
---
loader/shutdown.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/loader/shutdown.c b/loader/shutdown.c
index 8177399..cc8a85f 100644
--- a/loader/shutdown.c
+++ b/loader/shutdown.c
@@ -29,6 +29,7 @@
#include <sys/reboot.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <unistd.h>

#include "init.h"
@@ -50,7 +51,7 @@ static void performTerminations(void) {
}

static void performUnmounts(void) {
- int ignore;
+ int status;
struct stat st_buf;

printf("disabling swap...
");
@@ -62,23 +63,22 @@ static void performUnmounts(void) {
/* We've lost /mnt/runtime where /lib is a link to put the old
/lib back so that our mdadm invocation below works. */
if (stat("/lib64", &st_buf) == 0) {
- if (unlink("/lib64"))
- perror("unlink /lib64");
- if (rename("/lib64_old", "/lib64"))
- perror("rename /lib64_old /lib64");
+ unlink("/lib64");
+ rename("/lib64_old", "/lib64");
} else {
- if (unlink("/lib"))
- perror("unlink /lib");
- if (rename("/lib_old", "/lib"))
- perror("rename /lib_old /lib");
+ unlink("/lib");
+ rename("/lib_old", "/lib");
}
- if (unlink("/usr"))
- perror("unlink /usr");
- if (rename("/usr_old", "/usr"))
- perror("rename /usr_old /usr");
+ unlink("/usr");
+ rename("/usr_old", "/usr");

printf("waiting for mdraid sets to become clean...
");
- ignore = system("/sbin/mdadm --wait-clean --scan");
+ status = system("/sbin/mdadm --wait-clean --scan");
+ if (!WIFEXITED(status))
+ printf("Error: mdadm did not terminate normally
");
+ else if (WEXITSTATUS(status))
+ printf("Error: mdadm exited with status: %d
",
+ WEXITSTATUS(status));
}

static void performReboot(reboot_action rebootAction) {
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org