head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2001.02.04.16.59.15; author alexis; state Exp; branches; next ; desc @NO OPERATION SCRIPT WHICH USES NO CPU BUT WON'T EXIT TILL 'kill -9' @ 1.1 log @Initial revision @ text @#!MARKER_SHELL_CMD #shpp include ../bldcfg/paths.shpp PATH=/bin:/usr/bin:/sbin:/usr/sbin PROGNAME=`basename $0` RCS_ID='$Header: /home/alexis/dev/active/small/bin/RCS/aubmaster.shpp,v 1.1 2001/02/04 16:28:12 alexis Exp $' VERSION_SCHEME=release main() { # Process options while [ "X$1" != X ]; do case $1 in -v|--verbose) VERBOSE_LEVEL=3 ;; -d|--debug) [ "X$2" = X ] && usage VERBOSE_LEVEL=$2 shift ;; -V|--version) echo "$PROGNAME version $PATCHLEVEL_MARKER" exit 0 ;; -*) usage ;; *) break ;; esac shift done # No arguments expected [ "X$1" != X ] && usage # There is no point in registering a signal handler to clean up the # lock file if we get killed, since this program gets overlayed with # the 'kill' binary. debug 5 "main: calling lock() ..." lock DUMMY gen_lock_file_name || error "$PROGNAME lock found (pid=$?)" # This is the bit that does it all debug 5 "main: overlaying self with kill and then getting that kill to stop itself! ..." exec kill -STOP $$ } usage() { { echo "Usage: $PROGNAME" echo " $PROGNAME -V" } >&2 exit 1 } gen_lock_file_name() { echo /tmp/.$PROGNAME.lock } #shpp include ../lib/utils.sh.shpp #shpp include ../lib/gep.sh.shpp @