I haven't tried it, but just by quick (early morning) scanning, I think it is still going to leave the actual value of $cmd in whichever rc.* file it ends up putting it in? It also looks like since it is actually creating $rebooted_state_file every time it runs, it will still even run every time the system boots? I think this is meant to be a first-boot style script, so it should only be executed once when the system boots after imaging, correct?
It really makes no difference to me how this is implemented, but I do think what I proposed is slightly cleaner, as it totally removes all traces of it self from the imaged systems. My 2 cents, Matt Andrea Righi wrote: > Matt, > > sounds good! But I'd prefer to keep only one copy of the rc.* files. So > what about touching a single file in /etc/systemimager during the first > reboot and changing the script as following: > > ... > rebooted_state_file=/etc/systemimager/si_monitor.client.rebooted > rm -f $rebooted_state_file > cmd="[ ! -f $rebooted_state_file ] && touch $rebooted_state_file && > (echo \"$send_msg\" | $netcat -w $TIMEOUT $MONITOR_SERVER $MONITOR_PORT)" > for f in /etc/rc.local /etc/rc.d/rc.local /etc/init.d/rc.local > /etc/init.d/after.local; do > echo $cmd >> $f > done > ... > > Thanks, > -Andrea > > Matt Jamison wrote: > >> On systems like rhel4, where more than one of these files is present >> (symlinks to be exact), this results in this status update happening >> multiple times. Also, since this status update command isn't being >> removed after it runs on boot up, it also posts back again any time the >> system is rebooted... >> >> I remember this being mentioned before, but it still appears to be >> broken in this way in trunk. How about changing this to be like: >> >> cmd="echo \"$send_msg\" | $netcat -w $TIMEOUT $MONITOR_SERVER $MONITOR_PORT" >> for f in /etc/rc.local /etc/rc.d/rc.local /etc/init.d/rc.local >> /etc/init.d/after.local; do >> if [ -f $f ] ; then >> cp -f $f $f.sibak >> cmd="$cmd;cp -f $f.sibak $f;rm -f $f.sibak" >> echo $cmd >> $f >> break >> fi >> done >> > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sisuite-devel mailing list > Sisuite-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sisuite-devel > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sisuite-devel mailing list Sisuite-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sisuite-devel