Hi All,
I've successfully created a pre-install script which will adopt the
run_post_install_scripts function in /etc/init.d/functions.
It will adopt the rule that way that all output of the post-install
script are send through logmsg. Shellout is still called when a
post-install script fails.
You can find the pre-install script as attachment.
The best solution to the original problem (post-install script output
and errors are not logged to syslog) is to modify the
send_monitor_stdout function called in /etc/init.d/rcS and let that
function do the logging also to syslog.
That way really _everything_ is logged to syslog.
Another remark about the syslog is that it always state "logger" it
could be nicer that it says something like "SystemImager install" or
something like that, and that the -t option of logger is used for that.
I noticed that reporting bugs must go through the mailinglist, therefore
it would be nice that the above 2 points could be considered as bug or
improvement for systemimager.
Greetings,
Johan Huysmans
Johan Huysmans wrote:
Hi,
Sorry for the double post, I posted this message before subscribing to
the list. Then resend the message when I was registered as it did not
appear directly on the list.
Indeed when the monitoring is configured the message of the post-install
scripts are logged to si_monitor.log.
But not to syslog, which is still the thing I want :)
The fact is that we want to see those errors in case the bootstrap did
not succeed.
One of the things i'm currently trying is to modify the chroot command
when running the post-install script in that way it will send all output
to logmsg function.
This works but I loose the shellout won't be called, "set -o pipefail"
could solve this but doesn't work in the BOEL.
Greetings Johan
Bernard Li wrote:
Hi Johan:
On Wed, Jul 8, 2009 at 6:32 AM, Johan Huysmans<[email protected]> wrote:
I'm currently using the 4.0.2 systemimager on CentOS5.
I've created several post-install scripts but there is no logging of the
messages and errors in these post-install scripts.
The messages appear on the screen, but they do not appear in the logging
through syslog, which I'm using.
Is there a way so I can see which messages are printed and which errors
occur in the post-install scripts?
This should be very helpfull.
Not sure about syslog, but if you setup logging via si_monitor, the
messages should show up:
http://wiki.systemimager.org/index.php/Monitoring
P.S. Not sure why but your post appeared to have been posted twice.
Cheers,
Bernard
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users
From - Thu
#!/bin/sh
#
# This script will fix following issue:
# The STDOUT and STDERR of the post-install scripts are not logged to syslog.
# This is needed to see the progress and actions of those scripts
# and to debug when something goes wrong.
# To fix this we will adopt the rule in /etc/init.d/functions
# (in the initrd.img) which will start the postinstall script
# in the chroot environment in the run_post_install_scripts function.
# The original line is:
# chroot /a/ /tmp/post-install/$POST_INSTALL_SCRIPT || shellout
# The new line is:
# { chroot /a/ /tmp/post-install/$POST_INSTALL_SCRIPT 2>&1 || shellout 1>&2; }
| while read l; do logmsg $l; done
# All output of the post-install script will go to STDOUT
# All output of the shellout (when the post-install script fails)
# will go to STDERR
# Only STDOUT will be send to the logmsg function
# STDERR (thus the output of shellout) will not be send to logmsg as
# shellout will log those messages itselve.
sed 's/chroot \/a\/ \/tmp\/post-install\/\$POST_INSTALL_SCRIPT || shellout/{
chroot \/a\/ \/tmp\/post-install\/$POST_INSTALL_SCRIPT 2>\&1 || shellout 1>\&2;
} | while read l; do logmsg \$l; done/' /etc/init.d/functions >
/etc/init.d/functions.new
mv /etc/init.d/functions /etc/init.d/functions.old
mv /etc/init.d/functions.new /etc/init.d/functions
#grep chroot /etc/init.d/functions | logger
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users