On Mon, May 28, 2012 at 4:16 PM, Alan McKay <[email protected]> wrote: > On Mon, May 28, 2012 at 4:05 PM, Alan McKay <[email protected]> wrote: >> OK, reading through the /etc/init.d/sgemaster script, it looks like it >> automatically figures out based on the shadow_master file whether or >> not it runs as a master or a shadow, is that right? > > Upon further examination of that script, maybe not.
You shouldn't need to modify that script. I just quickly read it, and the function that checks whether the host is a shadow is: CheckIfShadowMasterHost() And it greps $SGE_ROOT/$SGE_CELL/common/shadow_masters for the name of the host $HOST (ie. the output of SGE's "gethostname -aname" command) - and if you follow the logic, you should find that you will hit the "if [ $start_shadowd = true ]; then" code block, and then the line "$bin_dir/sge_shadowd" starts the shadow master daemon. Rayson > > But it looks like I can add a few lines before "MAIN Procedure" that will > check $0 and if it is sgemaster than run as master, or if it is sgeshadow > then run as shadow. > > Is that a reasonable approach? > > I would like put it right after the below for loop and set the qmaster and > shadowd variables. > > > if [ "$#" -gt 3 -o "$1" = "-h" -o "$1" = "help" ]; then > usage > fi > > startup=true > qmaster=true > shadowd=true > qstd=false > migrate_qmaster=false > softstop=false > noSMF=false > > for i in $*; do > if [ "$i" = start ]; then > startup=true > elif [ "$i" = stop ]; then > startup=false > elif [ "$i" = softstop ]; then > startup=false > softstop=true > elif [ "$i" = -qmaster ]; then > qmaster=true > shadowd=false > elif [ "$i" = -shadowd ]; then > qmaster=false > shadowd=true > elif [ "$i" = -migrate ]; then > migrate_qmaster=true > qmaster=true > shadowd=false > elif [ "$i" = -nosmf ]; then > noSMF=true > else > usage > fi > done > > > > > > -- > “Don't eat anything you've ever seen advertised on TV” > - Michael Pollan, author of "In Defense of Food" > > _______________________________________________ > users mailing list > [email protected] > https://gridengine.org/mailman/listinfo/users > _______________________________________________ users mailing list [email protected] https://gridengine.org/mailman/listinfo/users
