> I recently noticed the clock was incorrect on one of my > Dachstein firewalls even though I have $lrp_DATE_SERVER > set to a valid time server. After a bit of digging, it > looks like the > > if [ -n "`ps axc | grep xntpd`" ] > > test on line 147 of /etc/multicron-p in updatetime() > was true when it shouldn't have been. A match on the > grep process was the culprit: > > # ps axc | grep xntpd > 6116 root R grep xntpd > # echo $? > 0
Looks like a bug...apparently caused by a race condition between the ps command and the shell spawning the grep command. > I've resolved the problem with > > if [ -n "`ps axc | grep -v grep | grep xntpd`" ]; then > > for now. For the shell script gurus out there, is there a > more elegant fix, preferably one that would work even if the > grep "-v" flag wasn't available? There's always: ps axc | sed /grep/d | grep xntpd -or- ps axc | sed -n '/sed/d;/xntpd/p' I'll stick this in the bug list for the next release, and see if anything more elegant pops to mind later... Charles Steinkuehler http://lrp.steinkuehler.net http://c0wz.steinkuehler.net (lrp.c0wz.com mirror) _______________________________________________ Leaf-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/leaf-user