Hi Jan.
Hi everyone.
Currently AI doesn't copy the logfile if the install fails because
of the DDU or install errors. How come? I would like to fix this.
Mary also filed bug 16088 against Driver-Update on this very issue.
But I wonder why AI wasn't copying the logfile on errors even
before Driver-Update came along. All I can come up with is:
- if /a wasn't mounted, the copy could generate additional errors.
(Seems like a small issue to me.)
Th original idea behind this behavior was that if the installation
fails,
then we should take the shortest path to abort in order to leave the
system
as untouched as possible for the inspection.
OK...
Also target BE is left mounted on /a in this case (assuming the
failure happened
after BE was created and mounted).
Sure, and it is important that this functionality remains.
In that case, we wanted to avoid cascade of error messages not related
to the failure itself - they would be confusing and could mask the real
problem - as an recent example, see
https://defect.opensolaris.org/bz/show_bug.cgi?id=11500#c8
OK. I suspected this, but wanted to make sure there wasn't some
other reason as well...
Does anyone have a good reason why I shouldn't attempt to copy the
logfile to /a whether or not any install errors occurred?
I can see that we could make this step more robust by checking for
presence of /a/var/sadm/system/logs directory first and copy log files
only if it exists.
Yes, I was thinking along these lines as well.
Looking at existing ls_transfer() code [1], in case target directory
does not exist,
ls_transfer() calls mkdirp(3GEN) to create it. We could either go with
such
approach or change the behavior as described above. That would work,
since
/var/sadm/system/logs/ directory is currently being delivered by
pkg://opensolaris.org/service/management/sysidtool package.
What I thought to be best would be to check to see if /a existed and if
it did, then to transfer the log.
I moved the ls_transfer() call to above the test/exit for failure, and
now check for INSTALLED_ROOT_DIR before calling ls_transfer(). See
attached.
However, when I tested this I realized that there is an ICT called
earlier which does the transfer as well, so the log is actually
transfered twice! So even when I remove the log file move from
auto_install.c, it is still done and still gives errors when the ICT
does it. I need to investigate where the ICT is coming from to know
whether or not I can remove it as part of my fix. (If it is code that
is common to other installer components, I may be better off leaving it
alone.)
I am also wondering if we need to enhance current error handling to
account
for situations like some of DDU failures which if my understanding
is correct
are being treated as 'non-fatal' errors ?
Currently, if the DDU is unsuccessful at installing at least one
needed package to the booted environment, a warning is issued but the
install continues. The idea here is that if something critical was
missing the install would fail anyhow, but the install should be
attempted.
If the DDU is unsuccessful at installing at least one needed package
to the target, there is a chance the system might not be bootable.
In this case the install terminates abnormally, to give the user a
chance to inspect the system before rebooting. There is a message
displayed about this just before termination.
Please feel free to let me know if you have ideas to enhance/improve
this.
I have taken a closer look at the implementation and how user is
informed and I think that user is given appropriate guidance on console
and in log file about what to do in case DDU does not succeed. To be
honest,
at this point I don't have any suggestions which would improve the
existing
behavior.
OK, thanks for taking a look.
Jack
Jan
References:
[1]
http://src.opensolaris.org/source/xref/caiman/slim_source/usr/src/lib/liblogsvc/ls_main.c#ls_transfer
*** auto_install.c Tue Jun 1 15:47:47 2010
--- auto_install.c.new Tue Jun 1 15:47:41 2010
***************
*** 2025,2049 ****
(void) ai_teardown_manifest_state();
/*
- * If the installation failed, abort now and let the user inspect
- * the system
- */
-
- if (auto_install_failed)
- exit(AI_EXIT_FAILURE);
-
- /*
* Transfer /tmp/install_log file now that it is complete.
* Subsequent messages are not captured in copy of log file
* tranfered to destination.
*/
! if (ls_transfer("/", INSTALLED_ROOT_DIR) != LS_E_SUCCESS) {
! auto_log_print(gettext(
! "Could not transfer log file to the target\n"));
}
/*
* Unmount installed boot environment
*/
if (om_unmount_target_be() != OM_SUCCESS) {
--- 2025,2051 ----
(void) ai_teardown_manifest_state();
/*
* Transfer /tmp/install_log file now that it is complete.
* Subsequent messages are not captured in copy of log file
* tranfered to destination.
*/
! if (access(INSTALLED_ROOT_DIR, F_OK) == 0) {
! if (ls_transfer("/", INSTALLED_ROOT_DIR) != LS_E_SUCCESS) {
! auto_log_print(gettext(
! "Could not transfer log file to the target\n"));
! }
}
/*
+ * If the installation failed, abort now and let the user inspect
+ * the system
+ */
+
+ if (auto_install_failed)
+ exit(AI_EXIT_FAILURE);
+
+ /*
* Unmount installed boot environment
*/
if (om_unmount_target_be() != OM_SUCCESS) {
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss