It would be nice to know what post script is executing, but do to their nature that is impossible. Would you accept a patch that added --name argument to %post (and %pre) to tell Anaconda what the scriptlet's name is? I am open to other suggestions.
Thanks, Christopher
On Thu, Nov 01, 2007 at 10:53:11AM -0400, Christopher Boumenot wrote:
It would be nice to know what post script is executing, but do to their nature that is impossible. Would you accept a patch that added --name argument to %post (and %pre) to tell Anaconda what the scriptlet's name is? I am open to other suggestions.
Completely unnecessary, IMHO. If you in some way would like to display what scriptlet is running, the package name can be displayed. A name (that only the packager knows) sound pretty useless...
Jos Vos wrote:
On Thu, Nov 01, 2007 at 10:53:11AM -0400, Christopher Boumenot wrote:
It would be nice to know what post script is executing, but do to their nature that is impossible. Would you accept a patch that added --name argument to %post (and %pre) to tell Anaconda what the scriptlet's name is? I am open to other suggestions.
Completely unnecessary, IMHO. If you in some way would like to display what scriptlet is running, the package name can be displayed. A name (that only the packager knows) sound pretty useless...
I am confused, what does the package name have to with a %post script? For example, I wrote a custom %post script to modify /etc/yp.conf, but it failed. There was no package involved in that action.
On Thu, Nov 01, 2007 at 11:39:13AM -0400, Christopher Boumenot wrote:
I am confused, what does the package name have to with a %post script? For example, I wrote a custom %post script to modify /etc/yp.conf, but it failed. There was no package involved in that action.
Sorry, I had the impression that you were talking about %pre and %post about packages, now I see it's the anaconda-list and not the rpm-list :-).
Anyway, I still think it's unnecessary, as you can create your own output in the script, as Jesse suggests.
On Thu, 01 Nov 2007 10:53:11 -0400 Christopher Boumenot boumenot@gmail.com wrote:
It would be nice to know what post script is executing, but do to their nature that is impossible. Would you accept a patch that added --name argument to %post (and %pre) to tell Anaconda what the scriptlet's name is? I am open to other suggestions.
Why can't the script itself output debug info like this? %pre and %post are treated as a single script. Have echos or some such saying "calling foo" then "calling bar" as you call other scripts from the %pre/%post stuff. Also those scripts your calling could in turn be calling yet other things, so the onus of debugging I think clearly lies upon the authors of the script.
Jesse Keating wrote:
On Thu, 01 Nov 2007 10:53:11 -0400 Christopher Boumenot boumenot@gmail.com wrote:
It would be nice to know what post script is executing, but do to their nature that is impossible. Would you accept a patch that added --name argument to %post (and %pre) to tell Anaconda what the scriptlet's name is? I am open to other suggestions.
Why can't the script itself output debug info like this? %pre and %post are treated as a single script. Have echos or some such saying "calling foo" then "calling bar" as you call other scripts from the %pre/%post stuff. Also those scripts your calling could in turn be calling yet other things, so the onus of debugging I think clearly lies upon the authors of the script.
What I really want to do is make my life easier, and digging through logs is painful. It is even more troublesome when there was a subtle error. Anaconda knows exactly when a script error'ed erronously, and I just want easy access to that information. For example, I hate when I see this in the logs.
Error code %s encountered running a kickstart %%pre/%%post script
I cringe when I read that because I have 30 scripts than just ran, and I now need to narrow it down to a specific one. Was it the simple one that failed to create the directory (mkdir /tmp/foo/bar instead of mkdir -p /tmp/foo/bar), or was it the long one that added mucked with grub.conf. It would save me mounds of time for Anaconda to say that a specific script failed, instead of me reconstructing what should of happened but didn't.
Christopher
Jesse Keating wrote:
On Thu, 01 Nov 2007 10:53:11 -0400 Christopher Boumenot boumenot@gmail.com wrote:
It would be nice to know what post script is executing, but do to their nature that is impossible. Would you accept a patch that added --name argument to %post (and %pre) to tell Anaconda what the scriptlet's name is? I am open to other suggestions.
Why can't the script itself output debug info like this? %pre and %post are treated as a single script. Have echos or some such saying "calling foo" then "calling bar" as you call other scripts from the %pre/%post stuff. Also those scripts your calling could in turn be calling yet other things, so the onus of debugging I think clearly lies upon the authors of the script.
What I really want to do is make my life easier, and digging through logs is painful. It is even more troublesome when there was a subtle error. Anaconda knows exactly when a script error'ed erronously, and I just want easy access to that information. For example, I hate when I see this in the logs.
Error code %s encountered running a kickstart %%pre/%%post script
I cringe when I read that because I have 30 scripts than just ran, and I now need to narrow it down to a specific one. Was it the simple one that failed to create the directory (mkdir /tmp/foo/bar instead of mkdir -p /tmp/foo/bar), or was it the long one that added mucked with grub.conf. It would save me mounds of time for Anaconda to say that a specific script failed, instead of me reconstructing what should of happened but didn't.
Christopher
On Thu, 01 Nov 2007 14:15:33 -0400 Christopher Boumenot boumenot@gmail.com wrote:
Error code %s encountered running a kickstart %%pre/%%post script
I cringe when I read that because I have 30 scripts than just ran, and I now need to narrow it down to a specific one. Was it the simple one that failed to create the directory (mkdir /tmp/foo/bar instead of mkdir -p /tmp/foo/bar), or was it the long one that added mucked with grub.conf. It would save me mounds of time for Anaconda to say that a specific script failed, instead of me reconstructing what should of happened but didn't.
Maybe you missed the subtlety here. As far as anaconda is concerned, %pre is one script. %post is one script. It starts a shell depending on what you defined as the script shell and executes the content. The return result from that content is what is used to determine if there was a failure or not.
Your one script happens to call out to many other scripts. At this time it's out of the hands of anaconda and into the hands of the interpreter, which is why the onus is on your script to correctly log or flag the status of each of those called scripts as the interpreter isn't necessarily going to do that for you.
Maybe you missed the subtlety here. As far as anaconda is concerned, %pre is one script. %post is one script. It starts a shell depending on what you defined as the script shell and executes the content. The return result from that content is what is used to determine if there was a failure or not.
Your one script happens to call out to many other scripts. At this time it's out of the hands of anaconda and into the hands of the interpreter, which is why the onus is on your script to correctly log or flag the status of each of those called scripts as the interpreter isn't necessarily going to do that for you.
Just to clarify then, multiple %pre/%post delimiters are combined into one script, or are they all called from one script?
My Kickstart file is littered with %post/%pre scripts. Just for this case, supposed they look like this.
%post --interpreter /usr/bin/python --log=python.log print "Hello World"
%post --interpreter /usr/bin/pytyon --log=python2.log
%post --interpreter /bin/sh --log=sh.log echo "Hello World"
%post --interpreter /usr/bin/perl --log perl.log print "Hello World\n";
All of these %post sections end up in one script?
It looks like the class AnacondaKSScript represents one script, and it is then executed. The output is redirected to a log file if --log is passed. (This is a very useful option by the way, and I am glad it is in the newer version of Anaconda.) Sorry to be so pestering, but I am still missing the "one" script thing.
Christopher
On Thu, 01 Nov 2007 15:00:07 -0400 Christopher Boumenot boumenot@gmail.com wrote:
Just to clarify then, multiple %pre/%post delimiters are combined into one script, or are they all called from one script?
My Kickstart file is littered with %post/%pre scripts. Just for this case, supposed they look like this.
%post --interpreter /usr/bin/python --log=python.log print "Hello World"
%post --interpreter /usr/bin/pytyon --log=python2.log
%post --interpreter /bin/sh --log=sh.log echo "Hello World"
%post --interpreter /usr/bin/perl --log perl.log print "Hello World\n";
All of these %post sections end up in one script?
It looks like the class AnacondaKSScript represents one script, and it is then executed. The output is redirected to a log file if --log is passed. (This is a very useful option by the way, and I am glad it is in the newer version of Anaconda.) Sorry to be so pestering, but I am still missing the "one" script thing.
Ooops. I missed what it was you were actually doing. I envisioned something like:
%post --foo script1 script2 script3 script4
And you were complaining because maybe script3 failed. I didn't realize you actually had multiple %post sections, vs multiple scripts listed in %post.
I'll step back and let the anaconda/kickstart authors answer.
Ooops. I missed what it was you were actually doing. I envisioned something like:
%post --foo script1 script2 script3 script4
And you were complaining because maybe script3 failed. I didn't realize you actually had multiple %post sections, vs multiple scripts listed in %post.
I'll step back and let the anaconda/kickstart authors answer.
My bad, I should have shown an example up front!
I simply have this just after %post section
%post
set -x exec > /root/ks-post.log 2>&1
it stores all output in ks-post.log file. You can then see what script failed and what error it gave.
Regards
On 01/11/2007, Christopher Boumenot boumenot@gmail.com wrote:
Ooops. I missed what it was you were actually doing. I envisioned something like:
%post --foo script1 script2 script3 script4
And you were complaining because maybe script3 failed. I didn't realize you actually had multiple %post sections, vs multiple scripts listed in %post.
I'll step back and let the anaconda/kickstart authors answer.
My bad, I should have shown an example up front!
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
anaconda-devel@lists.stg.fedoraproject.org