[Sisuite-devel] Re: [Systemimager-commits] r3342 - trunk/etc
Brian Elliott Finley wrote: Thus spake Andrea Righi ([EMAIL PROTECTED]): I don't find that to be the case. Perhaps you're having some other strangeness that affects this in some way? Please do this test as an example. The test_functions file includes a function with lines cut and pasted from the send_monitor_msg function in our functions file: 1) copy the two attached files into /tmp 2) chmod +x test_script 3) ./test_script It should return the mac address for your eth0. And you'll note that in "test_script", $DEVICE is not set until _after_ the functions are sourced. You can even change the script to use ash instead of sh, and you'll get the same behavior. Cheers, -Brian Very true! Anyway I've experienced the wrong behaviour in the busybox shell before the change... maybe this is due to other side effects.. I'll do some checks tonight. Thanks, -Andrea --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ Sisuite-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisuite-devel
[Sisuite-devel] Re: [Systemimager-commits] r3342 - trunk/etc
Thus spake Andrea Righi ([EMAIL PROTECTED]):
Brian Elliott Finley wrote:
Thus spake Andrea Righi ([EMAIL PROTECTED]):
Brian Elliott Finley wrote:
Better yet, is there any reason not to source the functions prior to
sourcing the variables?
Some functions in particular for the monitoring stuff are
variables.txt dependent...
This is true, but sourceing the functions does not _execute_ the
functions. It simply puts them into shell memory so that they are
available for execution.
Yes, but some functions (like send_monitor_msg) use some varibles
($DEVICE for example). When the function is loaded in memory if $DEVICE
is not set it will remain null...
I don't find that to be the case. Perhaps you're having some
other strangeness that affects this in some way?
Please do this test as an example. The test_functions file includes a
function with lines cut and pasted from the send_monitor_msg function in
our functions file:
1) copy the two attached files into /tmp
2) chmod +x test_script
3) ./test_script
It should return the mac address for your eth0. And you'll note that
in "test_script", $DEVICE is not set until _after_ the functions are
sourced.
You can even change the script to use ash instead of sh, and you'll get
the same behavior.
Cheers, -Brian
also if you source the variables.txt
later...
-Andrea
It's fine that the functions be sourced first, even prior to the
variables being put into the environment, as long as the variables are
there prior to the functions being called, or executed.
Cheers, -Brian
--
Brian Elliott Finley
Mobile: 630.631.6621
send_monitor_msg() {
# Get the client mac address.
if [ -z "$mac" ]; then
mac=`ifconfig $DEVICE 2>/dev/null | sed -ne "s/.*HWaddr //p" | sed "s/
//g" | sed s/:/./g`
fi
echo $mac
}
#!/bin/sh
. ./test_functions
DEVICE=eth0
send_monitor_msg
[Sisuite-devel] Re: [Systemimager-commits] r3342 - trunk/etc
On Wed, 2005-12-21 at 12:27 -0600, Brian Elliott Finley wrote: > I think something along these lines is a good idea. > > There are things about falsifying the reply-to: that can get ugly and > unpredictable, but what if we did this: > > * Simply have the svn system send commits to the sisuite-devel list. > > I would think that we really want everyone on the devel list to see all > the commits. We're more likely to get good feedback and better code > review that way. > > Comments? In particular from everyone on the -devel list... Well, imho, if people wanna read both, they can subscribe to both. If they don't want to see commits, pumping them to the -devel list will only annoy them. I've been in a couple projects where people start ignoring discussions because the list is too cluttered with commit messages, and we've resolved that by creating commit-only lists. Now if we could just get debbugs to stop sending messages to debian-kernel... --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ Sisuite-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisuite-devel
[Sisuite-devel] Re: [Systemimager-commits] r3342 - trunk/etc
Brian Elliott Finley wrote: Thus spake Andrea Righi ([EMAIL PROTECTED]): Brian Elliott Finley wrote: Better yet, is there any reason not to source the functions prior to sourcing the variables? Some functions in particular for the monitoring stuff are variables.txt dependent... This is true, but sourceing the functions does not _execute_ the functions. It simply puts them into shell memory so that they are available for execution. Yes, but some functions (like send_monitor_msg) use some varibles ($DEVICE for example). When the function is loaded in memory if $DEVICE is not set it will remain null... also if you source the variables.txt later... -Andrea It's fine that the functions be sourced first, even prior to the variables being put into the environment, as long as the variables are there prior to the functions being called, or executed. Cheers, -Brian --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ Sisuite-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisuite-devel
[Sisuite-devel] Re: [Systemimager-commits] r3342 - trunk/etc
Thus spake Andrea Righi ([EMAIL PROTECTED]): Brian Elliott Finley wrote: Better yet, is there any reason not to source the functions prior to sourcing the variables? Some functions in particular for the monitoring stuff are variables.txt dependent... This is true, but sourceing the functions does not _execute_ the functions. It simply puts them into shell memory so that they are available for execution. It's fine that the functions be sourced first, even prior to the variables being put into the environment, as long as the variables are there prior to the functions being called, or executed. Cheers, -Brian if you think this could be a problem we can resolve in this way: . /tmp/variables.txt . /etc/init.d/functions [ ! -e /tmp/variables.txt ] && shellout Cheers, -Andrea Original Message Subject: [Systemimager-commits] r3274 - trunk/etc Date: Fri, 25 Nov 2005 10:26:30 -0600 From: Andrea Righi <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Author: arighi Date: 2005-11-25 10:26:29 -0600 (Fri, 25 Nov 2005) New Revision: 3274 Modified: trunk/etc/autoinstallscript.template Log: load variables first of all, in order to preserve variables definition inside functions -- Brian Elliott Finley Mobile: 630.631.6621 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ Sisuite-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisuite-devel
[Sisuite-devel] RE: [Systemimager-commits] r3342 - trunk/etc
I generally like to keep them separate, I don't like discussion lists to be cluttered with commit/bug messages, but that's just me. Actually I think SourceForge allows you to easily change the reply-to: bit, I think you are already doing that for the sisuite-devel list - i.e. when you click "reply" to an email, it actually sends it back to the sisuite-devel list instead of to the original author of the message sent to sisuite-devel. Anyways, just my $0.02. Cheers, Bernard > -Original Message- > From: Brian Elliott Finley [mailto:[EMAIL PROTECTED] On > Behalf Of Brian Elliott Finley > Sent: Wednesday, December 21, 2005 10:27 > To: Bernard Li > Cc: [EMAIL PROTECTED]; SIS Devel > Subject: Re: [Systemimager-commits] r3342 - trunk/etc > > I think something along these lines is a good idea. > > There are things about falsifying the reply-to: that can get ugly and > unpredictable, but what if we did this: > > * Simply have the svn system send commits to the > sisuite-devel list. > > I would think that we really want everyone on the devel list > to see all > the commits. We're more likely to get good feedback and better code > review that way. > > Comments? In particular from everyone on the -devel list... > > -Brian > > > > Thus spake Bernard Li ([EMAIL PROTECTED]): > >May I suggest we change the "reply-to:" for systemimager-commits to > >sisuite-devel? :-) > > > >Cheers, > > > >Bernard > > > >> -Original Message- > >> From: [EMAIL PROTECTED] > >> [mailto:[EMAIL PROTECTED] On > >> Behalf Of Brian Elliott Finley > >> Sent: Wednesday, December 21, 2005 9:55 > >> To: Andrea Righi > >> Cc: [EMAIL PROTECTED] > >> Subject: Re: [Systemimager-commits] r3342 - trunk/etc > >> > >> Better yet, is there any reason not to source the > functions prior to > >> sourcing the variables? > >> > >> -Brian > >> > >> > >> Thus spake Andrea Righi ([EMAIL PROTECTED]): > >> >Author: arighi > >> >Date: 2005-12-21 14:41:18 -0600 (Wed, 21 Dec 2005) > >> >New Revision: 3342 > >> > > >> >Modified: > >> > trunk/etc/autoinstallscript.template > >> >Log: > >> >- shellout function is not available in > /tmp/variables.txt sourcing > >> >- display "Imaging completed" message in virtual console at > >> the end of the installation > >> > > >> > > >> >Modified: trunk/etc/autoinstallscript.template > >> > >=== > >> >--- trunk/etc/autoinstallscript.template 2005-12-20 > >> 20:18:51 UTC (rev 3341) > >> >+++ trunk/etc/autoinstallscript.template 2005-12-21 > >> 20:41:18 UTC (rev 3342) > >> >@@ -19,7 +19,7 @@ > >> > # via /tmp/variables.txt. Apparently the shell we use in > >> BOEL is not > >> > # intelligent enough to take a "set -a" parameter. > >> > # > >> >-. /tmp/variables.txt || shellout > >> >+. /tmp/variables.txt > >> > > >> > # Load functions and other variables > >> > . /etc/init.d/functions > >> >@@ -387,6 +387,7 @@ > >> > # Tell the image server we're done > >> > # > >> > rsync $IMAGESERVER::scripts/imaging_complete > /dev/null 2>&1 > >> >+logmsg "Imaging completed" > >> > # > >> > > >> ## > >> ## > >> > > >> > > >> > > >> > > >> >--- > >> >This SF.net email is sponsored by: Splunk Inc. Do you grep > >> through log files > >> >for problems? Stop! Download the new AJAX search engine > that makes > >> >searching your log files as easy as surfing the web. > >> DOWNLOAD SPLUNK! > >> >http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > >> >___ > >> >systemimager-commits mailing list > >> >[EMAIL PROTECTED] > >> >https://lists.sourceforge.net/lists/listinfo/systemimager-commits > >> > >> -- > >> Brian Elliott Finley > >> Mobile: 630.631.6621 > >> > >> > >> --- > >> This SF.net email is sponsored by: Splunk Inc. Do you grep > >> through log files > >> for problems? Stop! Download the new AJAX search engine > that makes > >> searching your log files as easy as surfing the web. > >> DOWNLOAD SPLUNK! > >> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > >> ___ > >> systemimager-commits mailing list > >> [EMAIL PROTECTED] > >> https://lists.sourceforge.net/lists/listinfo/systemimager-commits > >> > > -- > Brian Elliott Finley > Mobile: 630.631.6621 > --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click ___ Sisuite-devel mailing list [email protected]
[Sisuite-devel] Re: [Systemimager-commits] r3342 - trunk/etc
I think something along these lines is a good idea. There are things about falsifying the reply-to: that can get ugly and unpredictable, but what if we did this: * Simply have the svn system send commits to the sisuite-devel list. I would think that we really want everyone on the devel list to see all the commits. We're more likely to get good feedback and better code review that way. Comments? In particular from everyone on the -devel list... -Brian Thus spake Bernard Li ([EMAIL PROTECTED]): May I suggest we change the "reply-to:" for systemimager-commits to sisuite-devel? :-) Cheers, Bernard -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Elliott Finley Sent: Wednesday, December 21, 2005 9:55 To: Andrea Righi Cc: [EMAIL PROTECTED] Subject: Re: [Systemimager-commits] r3342 - trunk/etc Better yet, is there any reason not to source the functions prior to sourcing the variables? -Brian Thus spake Andrea Righi ([EMAIL PROTECTED]): >Author: arighi >Date: 2005-12-21 14:41:18 -0600 (Wed, 21 Dec 2005) >New Revision: 3342 > >Modified: > trunk/etc/autoinstallscript.template >Log: >- shellout function is not available in /tmp/variables.txt sourcing >- display "Imaging completed" message in virtual console at the end of the installation > > >Modified: trunk/etc/autoinstallscript.template >=== >--- trunk/etc/autoinstallscript.template 2005-12-20 20:18:51 UTC (rev 3341) >+++ trunk/etc/autoinstallscript.template 2005-12-21 20:41:18 UTC (rev 3342) >@@ -19,7 +19,7 @@ > # via /tmp/variables.txt. Apparently the shell we use in BOEL is not > # intelligent enough to take a "set -a" parameter. > # >-. /tmp/variables.txt || shellout >+. /tmp/variables.txt > > # Load functions and other variables > . /etc/init.d/functions >@@ -387,6 +387,7 @@ > # Tell the image server we're done > # > rsync $IMAGESERVER::scripts/imaging_complete > /dev/null 2>&1 >+logmsg "Imaging completed" > # > ## ## > > > > >--- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >___ >systemimager-commits mailing list >[EMAIL PROTECTED] >https://lists.sourceforge.net/lists/listinfo/systemimager-commits -- Brian Elliott Finley Mobile: 630.631.6621 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ systemimager-commits mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/systemimager-commits -- Brian Elliott Finley Mobile: 630.631.6621 --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ Sisuite-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisuite-devel
[Sisuite-devel] Re: [Systemimager-commits] r3342 - trunk/etc
Brian Elliott Finley wrote: Better yet, is there any reason not to source the functions prior to sourcing the variables? Some functions in particular for the monitoring stuff are variables.txt dependent... if you think this could be a problem we can resolve in this way: . /tmp/variables.txt . /etc/init.d/functions [ ! -e /tmp/variables.txt ] && shellout Cheers, -Andrea Original Message Subject: [Systemimager-commits] r3274 - trunk/etc Date: Fri, 25 Nov 2005 10:26:30 -0600 From: Andrea Righi <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Author: arighi Date: 2005-11-25 10:26:29 -0600 (Fri, 25 Nov 2005) New Revision: 3274 Modified: trunk/etc/autoinstallscript.template Log: load variables first of all, in order to preserve variables definition inside functions --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click ___ Sisuite-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisuite-devel
