Andrea, I had mentioned this before, and your version is still doing something wrong. ">>" will create a file if it doesn't exist, which is the problem. You're creating several files which aren't needed, in your version. Matt's version does the Right(er) Thing(tm).
Dan W. On Tue, Jul 11, 2006 at 02:43:17PM +0200, 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