Ryan Nowakowski <[EMAIL PROTECTED]> writes:
> I need some way to log every action that is performed during the
> install including app/hotfix installs and perl script runs. Has
> anyone else found a good way to do this?
Pretty much everything is run directly by todo.pl, so you can put the
logging logic there.
Below is a patch which redirects all output from todo.pl, and anything
it runs, to C:\\netinst\\logs\\todo.txt. It always appends to the log
file, so you may want to delete it. It directs all output to the log
file, instead of the screen, so it will be hard to tell when the
script stops for input (abort/retry/ignore). Oh, and it is completely
untested :-). But it should give you some ideas...
I will think about how to implement this "correctly", since it seems
like a reasonable thing to want.
- Pat
--- todo.pl.orig 2003-12-18 14:10:24.000000000 -0500
+++ todo.pl 2003-12-18 14:16:15.000000000 -0500
@@ -396,6 +396,15 @@
and exit 0;
$ENV{'_IN_TODO'} = 'yes';
+ # Create log file, and redirect STDOUT and STDERR to it.
+ my $log = 'c:\\netinst\\logs\\todo.txt';
+ open LOG, '>>', $log
+ or die "Unable to open $log for append: $^E";
+ open STDOUT, '>&', \*LOG
+ or die "Unable to redirect STDOUT: $^E";
+ open STDERR, '>&', \*LOG
+ or die "Unable to redirect STDERR: $^E";
+
# Add "bin" and "scripts" directories to PATH.
$ENV{'PATH'} = "$z\\bin;$z\\scripts;$ENV{'PATH'}";
@@ -414,6 +423,9 @@
while (defined (my $cmd = pop_todo ())) {
do_cmd ($cmd);
}
+
+ close LOG
+ or die "Unable to close $log: $^E";
}
else {
# Default behavior is to push one or more commands onto the todo
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info