I think this is a good idea. And I do like the idea of using the post-reboot facility once it's in place. My one caution is that this would be optional, and made available as an example script, or that it be "harmless" in some other way.
In particular, because of the issue of the appropriate rc script potentially having a different name on each distro, and because of the requirement for another tool that would have to become a client install dependency. Cheers, -Brian Thus spake A Righi ([EMAIL PROTECTED]): >Hi all, > >with my last patch I've added also the 'rebooted' status to report when >a client starts successfully with the image deployed (I've already >talked about that with Bernard...). > >This is not a "mandatory" state, I mean no error will be reported if a >client doesn't reach the rebooted state, but if a user wants to have >also this information, something must be put in the init scripts of the >image. IMHO the best approach is to use the rc.local (or all the >equivalent files in other distributions) adding the commands to report a >message to the monitor deamon on the image server. > >To do that I've successfully used the attached post-install script. The >script adds a command in rc.local (and some equivalent files). It works >well with SuSE and should work also with Red-Hat (don't know if it's ok >also with Debian). > >Maybe we could add these commands directly into the autoinstall script, >but only after some good tests. > >Thoughts are welcome... > >Cheers, >-Andrea >#!/bin/sh > ># netcat timeout in seconds >TIMEOUT=30 > >send_monitor_msg() { > if [ -z $MONITOR_SERVER ]; then > return > fi > if [ -z $MONITOR_PORT ]; then > MONITOR_PORT=8181 > fi > > # Remove special field separator from the message. > msg=`echo "$@" | sed 's/:/\\\x3a/g'` > > # 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 > > # Report the message to the monitor server. > send_msg=`echo "mac=$mac:ip=$IPADDR:host=$HOSTNAME:$msg"` > > # Find netcat binary > netcat=`which netcat || which nc` > [ -z $netcat ] && return > > 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 > echo $cmd >> $f > done >} > ># Load installation variables. >[ -e /tmp/post-install/variables.txt ] && . /tmp/post-install/variables.txt > ># Write commands to send status and final message to the monitord. >send_monitor_msg "log=Client successfully rebooted." >send_monitor_msg "status=102" > >_______________________________________________ >Sisuite-devel mailing list >Sisuite-devel@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/sisuite-devel -- Brian Elliott Finley Mobile: 630.631.6621 _______________________________________________ Sisuite-devel mailing list Sisuite-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sisuite-devel