pmialon at linagora.com
2009-Sep-08 15:12 UTC
[Ovirt-devel] [PATCH node] Add support for automatic remote logging on PXE ovirt-node
From: root <root at chappy.(none)> Use ovirt-config-logging in /etc/init.d/ovirt --- scripts/ovirt | 19 ++++--------------- scripts/ovirt-config-logging | 2 +- scripts/ovirt-functions | 4 ++++ 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index 4ff03f2..0c5e3be 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -14,6 +14,9 @@ start() { if is_standalone; then return 0 fi + + ovirt-config-logging AUTO + find_srv ipa tcp if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then krb5_conf=/etc/krb5.conf @@ -43,21 +46,7 @@ start() { log "skipping ovirt-awake, oVirt identify service not available" fi - find_srv collectd udp - if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then - collectd_conf=/etc/collectd.conf - if [ -f $collectd_conf.in ]; then - sed -e "s/@COLLECTD_SERVER@/$SRV_HOST/" \ - -e "s/@COLLECTD_PORT@/$SRV_PORT/" \ - -e "/<Plugin rrdtool>/,/<\/Plugin>/d" $collectd_conf.in \ - > $collectd_conf - if [ $? -ne 0 ]; then - log "Failed to write $collectd_conf"; return 1 - fi - fi - else - log "skipping collectd configuration, collectd service not available" - fi + ovirt-config-collectd AUTO find_srv qpidd tcp if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then diff --git a/scripts/ovirt-config-logging b/scripts/ovirt-config-logging index d8e5c95..598b7cb 100755 --- a/scripts/ovirt-config-logging +++ b/scripts/ovirt-config-logging @@ -8,7 +8,7 @@ trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 -if ! is_local_storage_configured; then +if ! is_local_storage_configured && ! is_diskless ; then printf "Local storage must be configured prior to configuring the logging system.\n" exit 99 fi diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 98e88e7..f86543e 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -88,6 +88,10 @@ is_local_storage_configured () { return 1 } +is_diskless() { + grep -q '/dev/mapper/live-rw /' /proc/mounts +} + # perform automatic local disk installation # when at least following boot parameters are present: # for networking - OVIRT_BOOTIF, management NIC -- 1.6.2.5
Pierre-Gilles Mialon
2009-Sep-15 15:15 UTC
[Ovirt-devel] [PATCH node] Add support for automatic remote logging on PXE ovirt-node
could someone to review this patch ? It is usefull for my stateless nodes ;-) Le mardi 8 septembre 2009 17:12:15 pmialon at linagora.com, vous avez ?crit :> From: root <root at chappy.(none)> > > Use ovirt-config-logging in /etc/init.d/ovirt > --- > scripts/ovirt | 19 ++++--------------- > scripts/ovirt-config-logging | 2 +- > scripts/ovirt-functions | 4 ++++ > 3 files changed, 9 insertions(+), 16 deletions(-) > > diff --git a/scripts/ovirt b/scripts/ovirt > index 4ff03f2..0c5e3be 100755 > --- a/scripts/ovirt > +++ b/scripts/ovirt > @@ -14,6 +14,9 @@ start() { > if is_standalone; then > return 0 > fi > + > + ovirt-config-logging AUTO > + > find_srv ipa tcp > if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then > krb5_conf=/etc/krb5.conf > @@ -43,21 +46,7 @@ start() { > log "skipping ovirt-awake, oVirt identify service not available" > fi > > - find_srv collectd udp > - if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then > - collectd_conf=/etc/collectd.conf > - if [ -f $collectd_conf.in ]; then > - sed -e "s/@COLLECTD_SERVER@/$SRV_HOST/" \ > - -e "s/@COLLECTD_PORT@/$SRV_PORT/" \ > - -e "/<Plugin rrdtool>/,/<\/Plugin>/d" $collectd_conf.in \ > - > $collectd_conf > - if [ $? -ne 0 ]; then > - log "Failed to write $collectd_conf"; return 1 > - fi > - fi > - else > - log "skipping collectd configuration, collectd service not > available" - fi > + ovirt-config-collectd AUTO > > find_srv qpidd tcp > if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then > diff --git a/scripts/ovirt-config-logging b/scripts/ovirt-config-logging > index d8e5c95..598b7cb 100755 > --- a/scripts/ovirt-config-logging > +++ b/scripts/ovirt-config-logging > @@ -8,7 +8,7 @@ > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > > -if ! is_local_storage_configured; then > +if ! is_local_storage_configured && ! is_diskless ; then > printf "Local storage must be configured prior to configuring the > logging system.\n" exit 99 > fi > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index 98e88e7..f86543e 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -88,6 +88,10 @@ is_local_storage_configured () { > return 1 > } > > +is_diskless() { > + grep -q '/dev/mapper/live-rw /' /proc/mounts > +} > + > # perform automatic local disk installation > # when at least following boot parameters are present: > # for networking - OVIRT_BOOTIF, management NIC-- Pierre-Gilles Mialon Responsable h?bergement :: Head of Hosting services pmialon at linagora.com :: +33.1 58 18 65 46 Linagora :: http://www.linagora.com 27 rue de Berri :: 75008 PARIS -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090915/c69d1d40/attachment.sig>
Alan Pevec
2009-Sep-15 15:47 UTC
[Ovirt-devel] [PATCH node] Add support for automatic remote logging on PXE ovirt-node
> > +is_diskless() { > + grep -q '/dev/mapper/live-rw /' /proc/mounts > +} > + >patch is ok, but this check needs to be improved: livecd image always has that even when booted from a local disk (we keep compressed squashfs image on HostVG/Root) One way would be to check for root=*.iso parameter in kernel command line: grep -q 'root=/[^ ]*\.iso' /proc/cmdline -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20090915/e1b70b24/attachment.htm>
Apparently Analagous Threads
- [PATCH node] correctly use collectd udp dns entry
- Bugs with ovirt-awake
- [PATCH node] Fix SRV_SERVER for SRV_HOST to work with /etc/init.d/ovirt-functions
- fc12 node partially working
- [PATCH] ovirt-awake runs alone now, doesn't need anymore to be lauch by /etc/init.d/ovirt