3
# SGE configuration script (Installation/Uninstallation/Upgrade/Downgrade)
4
# Scriptname: inst_qmaster.sh
5
# Module: qmaster installation functions
8
##########################################################################
10
# The Contents of this file are made available subject to the terms of
11
# the Sun Industry Standards Source License Version 1.2
13
# Sun Microsystems Inc., March, 2001
16
# Sun Industry Standards Source License Version 1.2
17
# =================================================
18
# The contents of this file are subject to the Sun Industry Standards
19
# Source License Version 1.2 (the "License"); You may not use this file
20
# except in compliance with the License. You may obtain a copy of the
21
# License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
23
# Software provided under this License is provided on an "AS IS" basis,
24
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
25
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
26
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
27
# See the License for the specific provisions governing your rights and
28
# obligations concerning the Software.
30
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
32
# Copyright: 2001 by Sun Microsystems, Inc.
34
# All Rights Reserved.
36
##########################################################################
42
#-------------------------------------------------------------------------
47
if [ $AUTO = true ]; then
48
SGE_CELL_ROOT=$SGE_CELL_ROOT
49
$INFOTEXT -log "Using >%s< as SGE_CELL_ROOT." "$SGE_CELL_ROOT"
52
$INFOTEXT -u "\nGrid Engine cell root"
53
$INFOTEXT -n "Enter the cell root <<<"
55
eval SGE_CELL_ROOT=$INP
56
$INFOTEXT -wait -auto $AUTO -n "\nUsing cell root >%s<. Hit <RETURN> to continue >> " $SGE_CELL_ROOT
61
#-------------------------------------------------------------------------
68
if [ $AUTO = true ]; then
70
SGE_CELL_VAL=$CELL_NAME
71
$INFOTEXT -log "Using >%s< as CELL_NAME." "$CELL_NAME"
73
if [ -f $SGE_ROOT/$SGE_CELL/common/bootstrap -a "$QMASTER" = "install" ]; then
74
$INFOTEXT -log "The cell name you have used and the bootstrap already exists!"
75
$INFOTEXT -log "It seems that you have already a installed system."
76
$INFOTEXT -log "A installation may cause, that data can be lost!"
77
$INFOTEXT -log "Please, check this directory and remove it, or use any other cell name"
78
$INFOTEXT -log "Exiting installation now!"
84
while [ $is_done = "false" ]; do
86
$INFOTEXT -u "\nGrid Engine cells"
87
if [ "$SGE_CELL" = "" ]; then
88
$INFOTEXT -n "\nGrid Engine supports multiple cells.\n\n" \
89
"If you are not planning to run multiple Grid Engine clusters or if you don't\n" \
90
"know yet what is a Grid Engine cell it is safe to keep the default cell name\n\n" \
92
"If you want to install multiple cells you can enter a cell name now.\n\n" \
93
"The environment variable\n\n" \
94
" \$SGE_CELL=<your_cell_name>\n\n" \
95
"will be set for all further Grid Engine commands.\n\n" \
96
"Enter cell name [default] >> "
99
$INFOTEXT -n "\nGrid Engine supports multiple cells.\n\n" \
100
"If you are not planning to run multiple Grid Engine clusters or if you don't\n" \
101
"know yet what is a Grid Engine cell it is safe to keep the default cell name\n\n" \
103
"If you want to install multiple cells you can enter a cell name now.\n\n" \
104
"The environment variable\n\n" \
105
" \$SGE_CELL=<your_cell_name>\n\n" \
106
"will be set for all further Grid Engine commands.\n\n" \
107
"Enter cell name [%s] >> " $SGE_CELL
108
INP=`Enter $SGE_CELL`
111
SGE_CELL_VAL=`eval echo $SGE_CELL`
112
if [ "$QMASTER" = "install" ]; then
113
if [ -d $SGE_ROOT/$SGE_CELL/common ]; then
115
$INFOTEXT "\nThe \"common\" directory in cell >%s< already exists!" $SGE_CELL_VAL
116
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n "Do you want to select another cell name? (y/n) [y] >> "
121
if [ ! -f $SGE_ROOT/$SGE_CELL/common/bootstrap -a -f $SGE_ROOT/$SGE_CELL/common/sgebdb ]; then
122
$INFOTEXT -n "Do you want to keep this directory? Choose\n" \
123
"(YES option) - if you have installed BDB server.\n" \
124
"(NO option) - to delete the whole directory!\n"
125
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n "Do you want to keep [y] or delete [n] the directory? (y/n) [y] >> "
128
$INFOTEXT -n "You can overwrite or delete this directory. If you choose overwrite\n" \
129
"(YES option) only the \"bootstrap\" and \"cluster_name\" files will be deleted).\n" \
130
"Delete (NO option) - will delete the whole directory!\n"
131
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n "Do you want to overwrite [y] or delete [n] the directory? (y/n) [y] >> "
134
SearchForExistingInstallations "qmaster shadowd execd dbwriter"
135
if [ $sel_ret = 0 -a $with_bdb = 0 ]; then
136
$INFOTEXT "Deleting bootstrap and cluster_name files!"
137
ExecuteAsAdmin rm -f $SGE_ROOT/$SGE_CELL_VAL/common/bootstrap
138
ExecuteAsAdmin rm -f $SGE_ROOT/$SGE_CELL_VAL/common/cluster_name
139
elif [ $sel_ret -ne 0 ]; then
140
$INFOTEXT "Deleting directory \"%s\" now!" $SGE_ROOT/$SGE_CELL_VAL
141
ExecuteAsAdmin rm -rf $SGE_ROOT/$SGE_CELL_VAL
148
elif [ "$BERKELEY" = "install" ]; then
149
SearchForExistingInstallations "bdb"
151
elif [ "$DBWRITER" = "install" ]; then
152
SearchForExistingInstallations "dbwriter"
159
$INFOTEXT -wait -auto $AUTO -n "\nUsing cell >%s<. \nHit <RETURN> to continue >> " $SGE_CELL_VAL
164
HOST=`$SGE_UTILBIN/gethostname -aname`
165
if [ "$HOST" = "" ]; then
166
$INFOTEXT -e "can't get hostname of this machine. Installation failed."
172
#-------------------------------------------------------------------------
173
# GetQmasterSpoolDir()
177
if [ $AUTO = true ]; then
178
QMDIR=$QMASTER_SPOOL_DIR
179
$INFOTEXT -log "Using >%s< as QMASTER_SPOOL_DIR." "$QMDIR"
184
while [ $done = false ]; do
186
$INFOTEXT -u "\nGrid Engine qmaster spool directory"
187
$INFOTEXT "\nThe qmaster spool directory is the place where the qmaster daemon stores\n" \
188
"the configuration and the state of the queuing system.\n\n"
190
if [ $euid = 0 ]; then
191
if [ $ADMINUSER = default ]; then
192
$INFOTEXT "User >root< on this host must have read/write access to the qmaster\n" \
195
$INFOTEXT "The admin user >%s< must have read/write access\n" \
196
"to the qmaster spool directory.\n" $ADMINUSER
199
$INFOTEXT "Your account on this host must have read/write access\n" \
200
"to the qmaster spool directory.\n"
203
$INFOTEXT -n "If you will install shadow master hosts or if you want to be able to start\n" \
204
"the qmaster daemon on other hosts (see the corresponding section in the\n" \
205
"Grid Engine Installation and Administration Manual for details) the account\n" \
206
"on the shadow master hosts also needs read/write access to this directory.\n\n" \
207
"The following directory\n\n [%s]\n\n will be used as qmaster spool directory by default!\n" \
208
$SGE_ROOT_VAL/$SGE_CELL_VAL/spool/qmaster
209
QMDIR=$SGE_ROOT_VAL/$SGE_CELL_VAL/spool/qmaster
211
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n \
212
"Do you want to select another qmaster spool directory (y/n) [n] >> "
217
$INFOTEXT -n "Please enter a qmaster spool directory now! >>"
218
QMDIR=`Enter $SGE_ROOT_VAL/$SGE_CELL_VAL/spool/qmaster`
228
#--------------------------------------------------------------------------
230
# - set permission for regular files to 644
231
# - set permission for executables and directories to 755
236
$INFOTEXT -u "\nVerifying and setting file permissions"
239
euid=`$SGE_UTILBIN/uidgid -euid`
241
if [ $euid != 0 ]; then
242
$INFOTEXT "You are not installing as user >root<\n"
243
$INFOTEXT "Can't set the file owner/group and permissions\n"
244
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
248
if [ "$AUTO" = "true" -a "$SET_FILE_PERMS" = "true" ]; then
251
if [ "$WINDOWS_SUPPORT" = true ]; then
252
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n \
253
"Did you install this version with >pkgadd< or did you already\n" \
254
"verify and set the file permissions of your distribution (enter: y)\n\n" \
255
"In some cases, eg: the binaries are stored on a NTFS or on any other\n" \
256
"filesystem, which provides additional file permissions, the UNIX file\n" \
257
"permissions can be wrong. In this case we would advise to verify and\n" \
258
"to set the file permissions (enter: n) (y/n) [n] >> "
260
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n \
261
"Did you install this version with >pkgadd< or did you already\n" \
262
"verify and set the file permissions of your distribution (y/n) [y] >> "
265
$INFOTEXT -wait -auto $AUTO -n "We do not verify file permissions. Hit <RETURN> to continue >> "
272
rm -f ./tst$$ 2> /dev/null > /dev/null
273
touch ./tst$$ 2> /dev/null > /dev/null
275
rm -f ./tst$$ 2> /dev/null > /dev/null
276
if [ $ret != 0 ]; then
277
$INFOTEXT -u "\nVerifying and setting file permissions (continued)"
279
$INFOTEXT "\nWe can't set file permissions on this machine, because user root\n" \
280
"has not the necessary privileges to change file permissions\n" \
281
"on this file system.\n\n" \
282
"Probably this file system is an NFS mount where user root is\n" \
283
"mapped to user >nobody<.\n\n" \
284
"Please login now at your file server and set the file permissions and\n" \
285
"ownership of the entire distribution with the command:\n\n" \
286
" # \$SGE_ROOT/util/setfileperm.sh \$SGE_ROOT\n\n"
288
$INFOTEXT -wait -auto $AUTO -n "Please hit <RETURN> to continue once you set your file permissions >> "
293
$INFOTEXT -u "\nVerifying and setting file permissions"
294
$INFOTEXT "\nWe may now verify and set the file permissions of your Grid Engine\n" \
295
"distribution.\n\n" \
296
"This may be useful since due to unpacking and copying of your distribution\n" \
297
"your files may be unaccessible to other users.\n\n" \
298
"We will set the permissions of directories and binaries to\n\n" \
299
" 755 - that means executable are accessible for the world\n\n" \
300
"and for ordinary files to\n\n" \
301
" 644 - that means readable for the world\n\n"
303
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n \
304
"Do you want to verify and set your file permissions (y/n) [y] >> "
308
if [ $ret = 0 ]; then
310
if [ $RESPORT = true ]; then
311
resportarg="-resport"
313
resportarg="-noresport"
316
if [ $ADMINUSER = default ]; then
322
filegid=`$SGE_UTILBIN/uidgid -gid`
326
util/setfileperm.sh -auto $SGE_ROOT
328
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
330
$INFOTEXT -wait -auto $AUTO -n "We will not verify your file permissions. Hit <RETURN> to continue >>"
336
#SetSpoolingOptionsBerkeleyDB()
337
# $1 - new default spool_dir
338
# TODO: $1 only for local bdb spooling for now
339
SetSpoolingOptionsBerkeleyDB()
341
SPOOLING_METHOD=berkeleydb
342
SPOOLING_LIB=libspoolb
344
SPOOLING_DIR="spooldb"
347
if [ "$AUTO" = "true" ]; then
348
SPOOLING_SERVER=$DB_SPOOLING_SERVER
349
SPOOLING_DIR="$DB_SPOOLING_DIR"
351
if [ "$SPOOLING_DIR" = "" ]; then
352
$INFOTEXT -log "Please enter a Berkeley DB spooling directory!"
357
if [ "$SPOOLING_SERVER" = "" ]; then
358
$INFOTEXT -log "Please enter a Berkeley DB spooling server!"
363
if [ -d "$SPOOLING_DIR" -a \( "$SPOOLING_SERVER" = "none" -o "$SPOOLING_SERVER" = "" \) ]; then
364
$INFOTEXT -log "The spooling directory [%s] already exists! Exiting installation!" "$SPOOLING_DIR"
371
if [ "$QMASTER" = "install" ]; then
372
$INFOTEXT -n "\nThe Berkeley DB spooling method provides two configurations!\n\n" \
373
" Local spooling:\n" \
374
" The Berkeley DB spools into a local directory on this host (qmaster host)\n" \
375
" This setup is faster, but you can't setup a shadow master host\n\n"
376
$INFOTEXT -n " Berkeley DB Spooling Server:\n" \
377
" If you want to setup a shadow master host, you need to use\nBerkeley DB Spooling Server!\n" \
378
" In this case you have to choose a host with a configured RPC service.\nThe qmaster host" \
379
" connects via RPC to the Berkeley DB. This setup is more\nfailsafe," \
380
" but results in a clear potential security hole. RPC communication\n" \
381
" (as used by Berkeley DB) can be easily compromised. Please only use this\n" \
382
" alternative if your site is secure or if you are not concerned about\n" \
383
" security. Check the installation guide for further advice on how to achieve\n" \
384
" failsafety without compromising security.\n\n"
386
if [ "$AUTO" = "true" ]; then
387
if [ "$DB_SPOOLING_SERVER" = "none" ]; then
393
$INFOTEXT -n -ask "y" "n" -def "n" "Do you want to use a Berkeley DB Spooling Server? (y/n) [n] >> "
395
$INFOTEXT -u "Berkeley DB Setup\n"
396
$INFOTEXT "Please, log in to your Berkeley DB spooling host and execute \"inst_sge -db\""
397
$INFOTEXT -auto $AUTO -wait -n "Please do not continue, before the Berkeley DB installation with\n" \
398
"\"inst_sge -db\" is completed, continue with <RETURN>"
402
$INFOTEXT -n -auto $AUTO -wait "\nHit <RETURN> to continue >> "
407
if [ $is_server = "true" ]; then
413
while [ $is_spool = "false" ] && [ $done = "false" ]; do
415
SpoolingQueryChange "$1"
416
if [ -d $SPOOLING_DIR ]; then
417
$INFOTEXT -n -ask "y" "n" -def "n" -auto $AUTO "The spooling directory already exists! Do you want to delete it? [n] >> "
419
if [ $AUTO = true ]; then
420
$INFOTEXT -log "The spooling directory already exists!\n Please remove it or choose any other spooling directory!"
425
if [ $ret = 0 ]; then
427
ExecuteAsAdmin $RM $SPOOLING_DIR
428
if [ -d $SPOOLING_DIR ]; then
429
$INFOTEXT "You are not the owner of this directory. You can't delete it!"
434
$INFOTEXT -wait "Please hit <ENTER>, to choose any other spooling directory!"
440
CheckLocalFilesystem $SPOOLING_DIR
442
if [ $ret -eq 0 -a "$AUTO" = "false" ]; then
443
$INFOTEXT "\nThe database directory\n\n" \
445
"is not on a local filesystem. Please choose a local filesystem or\n" \
446
"configure the RPC Client/Server mechanism." $SPOOLING_DIR
447
$INFOTEXT -wait -auto $AUTO -n "\nHit <RETURN> to continue >> "
452
if [ $is_spool = "false" ]; then
454
elif [ $done = "false" ]; then
461
if [ "$ARCH" = "darwin" ]; then
462
ret=`ps ax | grep "berkeley_db_svc" | wc -l`
464
ret=`ps -efa | grep "berkeley_db_svc" | wc -l`
466
if [ $ret -gt 1 ]; then
467
$INFOTEXT -u "Berkeley DB RPC Server installation"
468
$INFOTEXT "\nWe found a running berkeley db server on this host!"
469
if [ "$AUTO" = "true" ]; then
470
if [ $SPOOLING_SERVER = "none" ]; then
472
ExecuteAsAdmin $MKDIR $SPOOLING_DIR
473
SPOOLING_ARGS="$SPOOLING_DIR"
475
$INFOTEXT -log "We found a running berkeley db server on this host!"
476
$INFOTEXT -log "Please, check this first! Exiting Installation!"
481
$INFOTEXT "The installation script does not support the configuration of more then one"
482
$INFOTEXT "Berkeley DB on one Berkeley DB RPC host. This has to be done manually."
483
$INFOTEXT "By adding your Berkeley DB spooling directory to the sgebdb rc-script"
484
$INFOTEXT "and restarting the service, your Berkeley DB Server will be able to manage"
485
$INFOTEXT "more than one database.\n In your sgebdb rc-script you will find a line like: BDBHOMES=\"-h <spool_dir>\""
486
$INFOTEXT "To add your DB, you have to add <your spool_dir> to this line which should"
487
$INFOTEXT "look like this after edit: BDBHOMES=\"-h <spool_dir> -h <your spool_dir>\""
488
$INFOTEXT "... exiting installation now! "
492
while [ $params_ok -eq 0 ]; do
494
while [ $do_loop = "true" ]; do
496
if [ -d $SPOOLING_DIR ]; then
497
$INFOTEXT -n -ask "y" "n" -def "n" -auto "$AUTO" "The spooling directory already exists! Do you want to delete it? (y/n) [n] >> "
499
if [ "$AUTO" = true ]; then
500
$INFOTEXT -log "The spooling directory already exists!\n Please remove it or choose any other spooling directory!"
505
if [ $ret = 0 ]; then
507
ExecuteAsAdmin $RM $SPOOLING_DIR
508
if [ -d $SPOOLING_DIR ]; then
509
$INFOTEXT "You are not the owner of this directory. You can't delete it!"
514
$INFOTEXT -wait "Please hit <ENTER>, to choose any other spooling directory!"
515
SPOOLING_DIR="spooldb"
527
if [ "$SPOOLING_SERVER" = "none" ]; then
529
ExecuteAsAdmin $MKDIR $SPOOLING_DIR
530
SPOOLING_ARGS="$SPOOLING_DIR"
532
SPOOLING_ARGS="$SPOOLING_SERVER:`basename $SPOOLING_DIR`"
536
SetSpoolingOptionsClassic()
538
SPOOLING_METHOD=classic
539
SPOOLING_LIB=libspoolc
540
SPOOLING_ARGS="$SGE_ROOT_VAL/$COMMONDIR;$QMDIR"
543
SetSpoolingOptionsDynamic()
545
if [ "$AUTO" = "true" ]; then
546
if [ "$SPOOLING_METHOD" != "berkeleydb" -a "$SPOOLING_METHOD" != "classic" ]; then
547
SPOOLING_METHOD="berkeleydb"
550
if [ "$BERKELEY" = "install" ]; then
551
SPOOLING_METHOD="berkeleydb"
553
$INFOTEXT -n "Your SGE binaries are compiled to link the spooling libraries\n" \
554
"during runtime (dynamically). So you can choose between Berkeley DB \n" \
555
"spooling and Classic spooling method."
556
$INFOTEXT -n "\nPlease choose a spooling method (berkeleydb|classic) [berkeleydb] >> "
557
SPOOLING_METHOD=`Enter berkeleydb`
563
case $SPOOLING_METHOD in
565
SetSpoolingOptionsClassic
568
SetSpoolingOptionsBerkeleyDB
571
$INFOTEXT "\nUnknown spooling method. Exit."
572
$INFOTEXT -log "\nUnknown spooling method. Exit."
579
#--------------------------------------------------------------------------
580
# SetSpoolingOptions sets / queries options for the spooling framework
584
$INFOTEXT -u "\nSetup spooling"
585
COMPILED_IN_METHOD=`ExecuteAsAdmin $SPOOLINIT method`
586
$INFOTEXT -log "Setting spooling method to %s" $COMPILED_IN_METHOD
587
case "$COMPILED_IN_METHOD" in
589
SetSpoolingOptionsClassic
592
SetSpoolingOptionsBerkeleyDB
595
SetSpoolingOptionsDynamic
598
$INFOTEXT "\nUnknown spooling method. Exit."
599
$INFOTEXT -log "\nUnknown spooling method. Exit."
607
#-------------------------------------------------------------------------
608
# Ask the installer for the hostname resolving method
609
# (IGNORE_FQND=true/false)
611
SelectHostNameResolving()
613
if [ $AUTO = "true" ]; then
614
IGNORE_FQDN_DEFAULT=$HOSTNAME_RESOLVING
615
$INFOTEXT -log "Using >%s< as IGNORE_FQDN_DEFAULT." "$IGNORE_FQDN_DEFAULT"
616
$INFOTEXT -log "If it's >true<, the domain name will be ignored."
620
$INFOTEXT -u "\nSelect default Grid Engine hostname resolving method"
621
$INFOTEXT "\nAre all hosts of your cluster in one DNS domain? If this is\n" \
622
"the case the hostnames\n\n" \
623
" >hostA< and >hostA.foo.com<\n\n" \
624
"would be treated as equal, because the DNS domain name >foo.com<\n" \
625
"is ignored when comparing hostnames.\n\n"
627
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n \
628
"Are all hosts of your cluster in a single DNS domain (y/n) [y] >> "
630
IGNORE_FQDN_DEFAULT=true
631
$INFOTEXT "Ignoring domain name when comparing hostnames."
633
IGNORE_FQDN_DEFAULT=false
634
$INFOTEXT "The domain name is not ignored when comparing hostnames."
636
$INFOTEXT -wait -auto $AUTO -n "\nHit <RETURN> to continue >> "
640
if [ "$IGNORE_FQDN_DEFAULT" = "false" ]; then
643
CFG_DEFAULT_DOMAIN=none
648
#-------------------------------------------------------------------------
653
if [ $AFS = true ]; then
659
if [ $CSP = true ]; then
664
SEC_COUNT=`strings -a $SGE_BIN/sge_qmaster | grep "AIMK_SECURE_OPTION_ENABLED" | wc -l`
667
SEC_COUNT=`strings $SGE_BIN/sge_qmaster | grep "AIMK_SECURE_OPTION_ENABLED" | wc -l`
671
if [ $SEC_COUNT -ne 1 ]; then
672
$INFOTEXT "\n>sge_qmaster< binary is not compiled with >-secure< option!\n"
673
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to cancel the installation >> "
682
if [ $AFS = "false" ]; then
683
if [ $CSP = "false" ]; then
686
PRODUCT_MODE="${CSP_PREFIX}"
689
PRODUCT_MODE="${AFS_PREFIX}"
694
#-------------------------------------------------------------------------
695
# Make directories needed by qmaster
699
$INFOTEXT -u "\nMaking directories"
701
$INFOTEXT -log "Making directories"
702
Makedir $SGE_CELL_VAL
705
Makedir $QMDIR/job_scripts
707
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
712
#-------------------------------------------------------------------------
713
# Adding Bootstrap information
718
$INFOTEXT "Dumping bootstrapping information"
719
$INFOTEXT -log "Dumping bootstrapping information"
720
ExecuteAsAdmin rm -f $COMMONDIR/bootstrap
721
ExecuteAsAdmin $TOUCH $COMMONDIR/bootstrap
722
ExecuteAsAdmin chmod 666 $COMMONDIR/bootstrap
723
PrintBootstrap >> $COMMONDIR/bootstrap
724
ExecuteAsAdmin chmod 444 $COMMONDIR/bootstrap
727
#-------------------------------------------------------------------------
728
# PrintBootstrap: print SGE default configuration
732
$ECHO "# Version: $SGE_VERSION"
734
if [ $ADMINUSER != default ]; then
735
$ECHO "admin_user $ADMINUSER"
737
$ECHO "admin_user none"
739
$ECHO "default_domain $CFG_DEFAULT_DOMAIN"
740
$ECHO "ignore_fqdn $IGNORE_FQDN_DEFAULT"
741
$ECHO "spooling_method $SPOOLING_METHOD"
742
$ECHO "spooling_lib $SPOOLING_LIB"
743
$ECHO "spooling_params $SPOOLING_ARGS"
744
$ECHO "binary_path $SGE_ROOT_VAL/bin"
745
$ECHO "qmaster_spool_dir $QMDIR"
746
$ECHO "security_mode $PRODUCT_MODE"
747
$ECHO "listener_threads 2"
748
$ECHO "worker_threads 2"
749
$ECHO "scheduler_threads 1"
750
if [ "$SGE_ENABLE_JMX" = "true" ]; then
751
$ECHO "jvm_threads 1"
753
$ECHO "jvm_threads 0"
758
#-------------------------------------------------------------------------
759
# Initialize the spooling database (or directory structure)
761
InitSpoolingDatabase()
763
$INFOTEXT "Initializing spooling database"
764
$INFOTEXT -log "Initializing spooling database"
765
ExecuteAsAdmin $SPOOLINIT $SPOOLING_METHOD $SPOOLING_LIB "$SPOOLING_ARGS" init
767
$INFOTEXT -wait -auto $AUTO -n "\nHit <RETURN> to continue >> "
772
#-------------------------------------------------------------------------
774
# optional args for GetConfigutration
775
# $1 - default CFG_EXE_SPOOL
776
# $2 - default CFG_MAIL_ADDR
781
if [ $useold = false ]; then
782
GetConfiguration "$@"
783
#TruncCreateAndMakeWriteable $COMMONDIR/configuration
784
#PrintConf >> $COMMONDIR/configuration
785
#SetPerm $COMMONDIR/configuration
786
TMPC=/tmp/configuration
789
ExecuteAsAdmin $TOUCH $TMPC
792
ExecuteAsAdmin $SPOOLDEFAULTS configuration $TMPC
797
#-------------------------------------------------------------------------
798
# PrintConf: print SGE default configuration
802
$ECHO "# Version: $SGE_VERSION"
804
$ECHO "# DO NOT MODIFY THIS FILE MANUALLY!"
806
$ECHO "conf_version 0"
807
$ECHO "execd_spool_dir $CFG_EXE_SPOOL"
808
$ECHO "mailer $MAILER"
810
$ECHO "load_sensor none"
813
$ECHO "shell_start_mode posix_compliant"
814
$ECHO "login_shells sh,ksh,csh,tcsh"
817
$ECHO "user_lists none"
818
$ECHO "xuser_lists none"
819
$ECHO "projects none"
820
$ECHO "xprojects none"
821
$ECHO "enforce_project false"
822
$ECHO "enforce_user auto"
823
$ECHO "load_report_time 00:00:40"
824
$ECHO "max_unheard 00:05:00"
825
$ECHO "reschedule_unknown 00:00:00"
826
$ECHO "loglevel log_warning"
827
$ECHO "administrator_mail $CFG_MAIL_ADDR"
828
if [ "$AFS" = true ]; then
829
$ECHO "set_token_cmd /path_to_token_cmd/set_token_cmd"
830
$ECHO "pag_cmd /usr/afsws/bin/pagsh"
831
$ECHO "token_extend_time 24:0:0"
833
$ECHO "set_token_cmd none"
835
$ECHO "token_extend_time none"
837
$ECHO "shepherd_cmd none"
838
$ECHO "qmaster_params none"
839
if [ "$WINDOWS_SUPPORT" = "true" -a "$WIN_DOMAIN_ACCESS" = "true" ]; then
840
$ECHO "execd_params enable_windomacc=true"
841
elif [ "$WINDOWS_SUPPORT" = "true" -a "$WIN_DOMAIN_ACCESS" = "false" ]; then
842
$ECHO "execd_params enable_windomacc=false"
844
$ECHO "execd_params none"
846
$ECHO "reporting_params accounting=true reporting=false flush_time=00:00:15 joblog=false sharelog=00:00:00"
847
$ECHO "finished_jobs 100"
848
$ECHO "gid_range $CFG_GID_RANGE"
849
$ECHO "qlogin_command $QLOGIN_COMMAND"
850
$ECHO "qlogin_daemon $QLOGIN_DAEMON"
851
if [ "$RLOGIN_COMMAND" != "undef" ]; then
852
$ECHO "rlogin_command $RLOGIN_COMMAND"
854
$ECHO "rlogin_daemon $RLOGIN_DAEMON"
855
if [ "$RSH_COMMAND" != "undef" ]; then
856
$ECHO "rsh_command $RSH_COMMAND"
858
if [ "$RSH_DAEMON" != "undef" ]; then
859
$ECHO "rsh_daemon $RSH_DAEMON"
862
$ECHO "max_aj_instances 2000"
863
$ECHO "max_aj_tasks 75000"
866
$ECHO "max_advance_reservations 0"
867
$ECHO "auto_user_oticket 0"
868
$ECHO "auto_user_fshare 0"
869
$ECHO "auto_user_default_project none"
870
$ECHO "auto_user_delete_time 86400"
871
$ECHO "delegated_file_staging false"
872
$ECHO "reprioritize 0"
873
if [ "$SGE_JVM_LIB_PATH" != "" ]; then
874
$ECHO "libjvm_path $SGE_JVM_LIB_PATH"
876
if [ "$SGE_ADDITIONAL_JVM_ARGS" != "" ]; then
877
$ECHO "additional_jvm_args $SGE_ADDITIONAL_JVM_ARGS"
882
#-------------------------------------------------------------------------
883
# AddLocalConfiguration
885
AddLocalConfiguration()
888
$INFOTEXT -u "\nCreating local configuration"
890
ExecuteAsAdmin mkdir /tmp/$$
892
ExecuteAsAdmin rm -f $TMPH
893
ExecuteAsAdmin touch $TMPH
894
PrintLocalConf 1 >> $TMPH
895
ExecuteAsAdmin $SPOOLDEFAULTS local_conf $TMPH $HOST
896
ExecuteAsAdmin rm -rf /tmp/$$
900
#-------------------------------------------------------------------------
901
# GetConfiguration: get some parameters for global configuration
903
# $1 - default CFG_EXE_SPOOL
904
# $2 - default CFG_MAIL_ADDR
910
#if [ $fast = true ]; then
911
# CFG_EXE_SPOOL=$SGE_ROOT_VAL/$SGE_CELL_VAL/spool
915
if [ $AUTO = true ]; then
916
CFG_EXE_SPOOL=$EXECD_SPOOL_DIR
917
CFG_MAIL_ADDR=$ADMIN_MAIL
918
$INFOTEXT -log "Using >%s< as EXECD_SPOOL_DIR." "$CFG_EXE_SPOOL"
919
$INFOTEXT -log "Using >%s< as ADMIN_MAIL." "$ADMIN_MAIL"
922
while [ $done = false ]; do
924
$INFOTEXT -u "\nGrid Engine cluster configuration"
925
$INFOTEXT "\nPlease give the basic configuration parameters of your Grid Engine\n" \
926
"installation:\n\n <execd_spool_dir>\n\n"
928
if [ $ADMINUSER != default ]; then
929
$INFOTEXT "The pathname of the spool directory of the execution hosts. User >%s<\n" \
930
"must have the right to create this directory and to write into it.\n" "$ADMINUSER"
931
elif [ $euid = 0 ]; then
932
$INFOTEXT "The pathname of the spool directory of the execution hosts. User >root<\n" \
933
"must have the right to create this directory and to write into it.\n"
935
$INFOTEXT "The pathname of the spool directory of the execution hosts. You\n" \
936
"must have the right to create this directory and to write into it.\n"
940
default_value=$SGE_ROOT_VAL/$SGE_CELL_VAL/spool
945
$INFOTEXT -n "Default: [%s] >> " $default_value
947
CFG_EXE_SPOOL=`Enter $default_value`
955
$INFOTEXT -u "\nGrid Engine cluster configuration (continued)"
956
$INFOTEXT -n "\n<administrator_mail>\n\n" \
957
"The email address of the administrator to whom problem reports are sent.\n\n" \
958
"It's is recommended to configure this parameter. You may use >none<\n" \
959
"if you do not wish to receive administrator mail.\n\n" \
960
"Please enter an email address in the form >user@foo.com<.\n\n" \
961
"Default: [%s] >> " $default_value
963
CFG_MAIL_ADDR=`Enter $default_value`
966
$INFOTEXT "\nThe following parameters for the cluster configuration were configured:\n\n" \
967
" execd_spool_dir %s\n" \
968
" administrator_mail %s\n" $CFG_EXE_SPOOL $CFG_MAIL_ADDR
970
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n \
971
"Do you want to change the configuration parameters (y/n) [n] >> "
981
#-------------------------------------------------------------------------
987
if [ -z "$GID_RANGE" ]; then
988
GID_RANGE=20000-20100
991
while [ $done = false ]; do
993
$INFOTEXT -u "\nGrid Engine group id range"
994
$INFOTEXT "\nWhen jobs are started under the control of Grid Engine an additional group id\n" \
995
"is set on platforms which do not support jobs. This is done to provide maximum\n" \
996
"control for Grid Engine jobs.\n\n" \
997
"This additional UNIX group id range must be unused group id's in your system.\n" \
998
"Each job will be assigned a unique id during the time it is running.\n" \
999
"Therefore you need to provide a range of id's which will be assigned\n" \
1000
"dynamically for jobs.\n\n" \
1001
"The range must be big enough to provide enough numbers for the maximum number\n" \
1002
"of Grid Engine jobs running at a single moment on a single host. E.g. a range\n" \
1003
"like >20000-20100< means, that Grid Engine will use the group ids from\n" \
1004
"20000-20100 and provides a range for 100 Grid Engine jobs at the same time\n" \
1005
"on a single host.\n\n" \
1006
"You can change at any time the group id range in your cluster configuration.\n"
1008
$INFOTEXT -n "Please enter a range [%s] >> " $GID_RANGE
1010
CFG_GID_RANGE=`Enter $GID_RANGE`
1012
if [ "$CFG_GID_RANGE" != "" ]; then
1013
$INFOTEXT -wait -auto $AUTO -n "\nUsing >%s< as gid range. Hit <RETURN> to continue >> " \
1018
if [ $AUTO = true -a "$GID_RANGE" = "" ]; then
1019
$INFOTEXT -log "Please enter a valid GID Range. Installation failed!"
1024
$INFOTEXT -log "Using >%s< as gid range." "$CFG_GID_RANGE"
1029
#-------------------------------------------------------------------------
1030
# AddActQmaster: create act_qmaster file
1034
$INFOTEXT "Creating >act_qmaster< file"
1036
TruncCreateAndMakeWriteable $COMMONDIR/act_qmaster
1037
$ECHO $HOST >> $COMMONDIR/act_qmaster
1038
SetPerm $COMMONDIR/act_qmaster
1042
#-------------------------------------------------------------------------
1043
# AddDefaultComplexes
1045
AddDefaultComplexes()
1047
$INFOTEXT "Adding default complex attributes"
1048
ExecuteAsAdmin $SPOOLDEFAULTS complexes $SGE_ROOT_VAL/util/resources/centry
1053
#-------------------------------------------------------------------------
1055
# Copy files from util directory to common dir
1059
for f in sge_aliases qtask sge_request; do
1060
if [ $f = sge_aliases ]; then
1061
$INFOTEXT "Adding >%s< path aliases file" $f
1062
elif [ $f = qtask ]; then
1063
$INFOTEXT "Adding >%s< qtcsh sample default request file" $f
1065
$INFOTEXT "Adding >%s< default submit options file" $f
1067
ExecuteAsAdmin cp util/$f $COMMONDIR
1068
ExecuteAsAdmin chmod $FILEPERM $COMMONDIR/$f
1074
if [ "$SGE_ENABLE_JMX" = "true" ]; then
1075
jmx_dir=$COMMONDIR/jmx
1076
ExecuteAsAdmin mkdir -p $jmx_dir
1078
$INFOTEXT "Adding >jmx/%s< jmx remote access file" jmxremote.access
1079
ExecuteAsAdmin cp util/jmxremote.access $jmx_dir/jmxremote.access
1080
ExecuteAsAdmin chmod $FILEPERM $jmx_dir/jmxremote.access
1082
$INFOTEXT "Adding >jmx/%s< jmx remote password file" jmxremote.password
1083
ExecuteAsAdmin cp util/jmxremote.password $jmx_dir/jmxremote.password
1084
ExecuteAsAdmin chmod 600 $jmx_dir/jmxremote.password
1086
$INFOTEXT "Adding >jmx/%s< jmx logging configuration" logging.properties
1087
ExecuteAsAdmin cp util/logging.properties.template $jmx_dir/logging.properties
1088
ExecuteAsAdmin chmod 644 $jmx_dir/logging.properties
1090
$INFOTEXT "Adding >jmx/%s< java policies configuration" java.policy
1091
ExecuteAsAdmin cp util/java.policy.template $jmx_dir/java.policy
1092
ExecuteAsAdmin chmod 644 $jmx_dir/java.policy
1094
$INFOTEXT "Adding >jmx/%s< jaas configuration" jaas.config
1095
ExecuteAsAdmin cp util/jaas.config.template $jmx_dir/jaas.config
1096
ExecuteAsAdmin chmod 644 $jmx_dir/jaas.config
1098
ExecuteAsAdmin touch /tmp/management.properties.$$
1099
Execute sed -e "s#@@SGE_JMX_PORT@@#$SGE_JMX_PORT#g" \
1100
-e "s#@@SGE_ROOT@@#$SGE_ROOT#g" \
1101
-e "s#@@SGE_CELL@@#$SGE_CELL#g" \
1102
-e "s#@@SGE_JMX_SSL@@#$SGE_JMX_SSL#g" \
1103
-e "s#@@SGE_JMX_SSL_CLIENT@@#$SGE_JMX_SSL_CLIENT#g" \
1104
-e "s#@@SGE_JMX_SSL_KEYSTORE@@#$SGE_JMX_SSL_KEYSTORE#g" \
1105
-e "s#@@SGE_JMX_SSL_KEYSTORE_PW@@#$SGE_JMX_SSL_KEYSTORE_PW#g" \
1106
util/management.properties.template > /tmp/management.properties.$$
1107
ExecuteAsAdmin mv /tmp/management.properties.$$ $jmx_dir/management.properties
1108
ExecuteAsAdmin chmod $FILEPERM $jmx_dir/management.properties
1109
$INFOTEXT "Adding >jmx/%s< jmx configuration" management.properties
1114
#-------------------------------------------------------------------------
1116
# Copy files from PE template directory to qmaster spool dir
1120
$INFOTEXT "Adding default parallel environments (PE)"
1121
$INFOTEXT -log "Adding default parallel environments (PE)"
1122
ExecuteAsAdmin $SPOOLDEFAULTS pes $SGE_ROOT_VAL/util/resources/pe
1126
#-------------------------------------------------------------------------
1127
# AddDefaultUsersets
1129
AddDefaultUsersets()
1131
$INFOTEXT "Adding SGE default usersets"
1132
ExecuteAsAdmin $SPOOLDEFAULTS usersets $SGE_ROOT_VAL/util/resources/usersets
1136
#-------------------------------------------------------------------------
1137
# CreateSettingsFile: Create resource files for csh/sh
1139
CreateSettingsFile()
1141
$INFOTEXT "Creating settings files for >.profile/.cshrc<"
1143
if [ $RECREATE_SETTINGS = "false" ]; then
1144
if [ -f $SGE_ROOT/$SGE_CELL/common/settings.sh ]; then
1145
ExecuteAsAdmin $RM $SGE_ROOT/$SGE_CELL/common/settings.sh
1148
if [ -f $SGE_ROOT/$SGE_CELL/common/settings.csh ]; then
1149
ExecuteAsAdmin $RM $SGE_ROOT/$SGE_CELL/common/settings.csh
1153
ExecuteAsAdmin util/create_settings.sh $SGE_ROOT_VAL/$COMMONDIR
1155
SetPerm $SGE_ROOT_VAL/$COMMONDIR/settings.sh
1156
SetPerm $SGE_ROOT_VAL/$COMMONDIR/settings.csh
1158
$INFOTEXT -wait -auto $AUTO -n "\nHit <RETURN> to continue >> "
1162
#--------------------------------------------------------------------------
1163
# InitCA Create CA and initialize it for daemons and users
1168
if [ "$CSP" = true -o \( "$WINDOWS_SUPPORT" = "true" -a "$WIN_DOMAIN_ACCESS" = "true" \) -o "$SGE_JMX_SSL" = true ]; then
1169
# Initialize CA, make directories and get DN info
1171
SGE_CA_CMD=util/sgeCA/sge_ca
1172
if [ "$AUTO" = "true" ]; then
1173
if [ "$CSP_RECREATE" = "true" ]; then
1174
$SGE_CA_CMD -init -days 365 -auto $FILE
1175
#if [ -f "$CSP_USERFILE" ]; then
1176
# $SGE_CA_CMD -usercert $CSP_USERFILE
1180
$SGE_CA_CMD -init -days 365
1183
# TODO: CAErrUsage no longer available, error handling ???:w
1185
if [ "$SGE_JMX_SSL" = true ]; then
1186
touch /tmp/pwfile.$$
1187
chmod 600 /tmp/pwfile.$$
1188
echo "$SGE_JMX_SSL_KEYSTORE_PW" > /tmp/pwfile.$$
1189
$SGE_CA_CMD -sysks -kspwf /tmp/pwfile.$$
1193
$INFOTEXT -auto $AUTO -wait -n "Hit <RETURN> to continue >> "
1199
#--------------------------------------------------------------------------
1204
$INFOTEXT -u "\nGrid Engine qmaster startup"
1205
$INFOTEXT "\nStarting qmaster daemon. Please wait ..."
1207
if [ "$SGE_ENABLE_SMF" = "true" ]; then
1208
$SVCADM enable -s "svc:/application/sge/qmaster:$SGE_CLUSTER_NAME"
1209
if [ $? -ne 0 ]; then
1210
$INFOTEXT "\nFailed to start qmaster deamon over SMF. Check service by issuing "\
1211
"svcs -l svc:/application/sge/qmaster:%s" $SGE_CLUSTER_NAME
1212
$INFOTEXT -log "\nFailed to start qmaster deamon over SMF. Check service by issuing "\
1213
"svcs -l svc:/application/sge/qmaster:%s" $SGE_CLUSTER_NAME
1214
if [ $AUTO = true ]; then
1220
$SGE_STARTUP_FILE -qmaster
1222
CheckRunningDaemon sge_qmaster
1224
if [ $run -ne 0 ]; then
1225
$INFOTEXT "sge_qmaster daemon didn't start. Please check your\n" \
1226
"configuration! Installation failed!"
1227
$INFOTEXT -log "sge_qmaster daemon didn't start. Please check your\n" \
1228
"autoinstall configuration file! Installation failed!"
1233
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
1238
#-------------------------------------------------------------------------
1243
if [ "$AUTO" = "true" ]; then
1244
for h in $ADMIN_HOST_LIST; do
1246
$INFOTEXT -log "Adding ADMIN_HOSTS from file %s" $h
1247
for tmp in `cat $h`; do
1248
$INFOTEXT -log "Adding ADMIN_HOST %s" $tmp
1249
$SGE_BIN/qconf -ah $tmp
1252
$INFOTEXT -log "Adding ADMIN_HOST %s" $h
1253
$SGE_BIN/qconf -ah $h
1257
for h in $SUBMIT_HOST_LIST; do
1259
$INFOTEXT -log "Adding SUBMIT_HOSTS from file %s" $h
1260
for tmp in `cat $h`; do
1261
$INFOTEXT -log "Adding SUBMIT_HOST %s" $tmp
1262
$SGE_BIN/qconf -as $tmp
1265
$INFOTEXT -log "Adding SUBMIT_HOST %s" $h
1266
$SGE_BIN/qconf -as $h
1270
for h in $SHADOW_HOST; do
1272
$INFOTEXT -log "Adding SHADOW_HOSTS from file %s" $h
1273
for tmp in `cat $h`; do
1274
$INFOTEXT -log "Adding SHADOW_HOST %s" $tmp
1275
$SGE_BIN/qconf -ah $tmp
1278
$INFOTEXT -log "Adding SHADOW_HOST %s" $h
1279
$SGE_BIN/qconf -ah $h
1284
$INFOTEXT -u "\nAdding Grid Engine hosts"
1285
$INFOTEXT "\nPlease now add the list of hosts, where you will later install your execution\n" \
1286
"daemons. These hosts will be also added as valid submit hosts.\n\n" \
1287
"Please enter a blank separated list of your execution hosts. You may\n" \
1288
"press <RETURN> if the line is getting too long. Once you are finished\n" \
1289
"simply press <RETURN> without entering a name.\n\n" \
1290
"You also may prepare a file with the hostnames of the machines where you plan\n" \
1291
"to install Grid Engine. This may be convenient if you are installing Grid\n" \
1292
"Engine on many hosts.\n\n"
1294
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n \
1295
"Do you want to use a file which contains the list of hosts (y/n) [n] >> "
1297
if [ $ret = 0 ]; then
1298
AddHostsFromFile execd
1302
if [ $ret = 1 ]; then
1303
AddHostsFromTerminal execd
1306
$INFOTEXT -wait -auto $AUTO -n "Finished adding hosts. Hit <RETURN> to continue >> "
1309
# Adding later shadow hosts to the admin host list
1310
$INFOTEXT "\nIf you want to use a shadow host, it is recommended to add this host\n" \
1311
"to the list of administrative hosts.\n\n" \
1312
"If you are not sure, it is also possible to add or remove hosts after the\n" \
1313
"installation with <qconf -ah hostname> for adding and <qconf -dh hostname>\n" \
1314
"for removing this host\n\nAttention: This is not the shadow host installation\n" \
1315
"procedure.\n You still have to install the shadow host separately\n\n"
1316
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n \
1317
"Do you want to add your shadow host(s) now? (y/n) [y] >> "
1319
if [ "$ret" = 0 ]; then
1321
$INFOTEXT -u "\nAdding Grid Engine shadow hosts"
1322
$INFOTEXT "\nPlease now add the list of hosts, where you will later install your shadow\n" \
1324
"Please enter a blank separated list of your execution hosts. You may\n" \
1325
"press <RETURN> if the line is getting too long. Once you are finished\n" \
1326
"simply press <RETURN> without entering a name.\n\n" \
1327
"You also may prepare a file with the hostnames of the machines where you plan\n" \
1328
"to install Grid Engine. This may be convenient if you are installing Grid\n" \
1329
"Engine on many hosts.\n\n"
1331
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n \
1332
"Do you want to use a file which contains the list of hosts (y/n) [n] >> "
1334
if [ $ret = 0 ]; then
1335
AddHostsFromFile shadowd
1339
if [ $ret = 1 ]; then
1340
AddHostsFromTerminal shadowd
1343
$INFOTEXT -wait -auto $AUTO -n "Finished adding hosts. Hit <RETURN> to continue >> "
1349
$INFOTEXT -u "\nCreating the default <all.q> queue and <allhosts> hostgroup"
1351
$INFOTEXT -log "Creating the default <all.q> queue and <allhosts> hostgroup"
1352
TMPL=/tmp/hostqueue$$
1355
if [ -f $TMPL -o -f $TMPL2 ]; then
1356
$INFOTEXT "\nCan't delete template files >%s< or >%s<" "$TMPL" "$TMPL2"
1358
PrintHostGroup @allhosts > $TMPL
1359
Execute $SGE_BIN/qconf -Ahgrp $TMPL
1360
Execute $SGE_BIN/qconf -sq > $TMPL
1361
Execute sed -e "/qname/s/template/all.q/" \
1362
-e "/hostlist/s/NONE/@allhosts/" \
1363
-e "/pe_list/s/NONE/make/" $TMPL > $TMPL2
1364
Execute $SGE_BIN/qconf -Aq $TMPL2
1368
$INFOTEXT -wait -auto $AUTO -n "\nHit <RETURN> to continue >> "
1374
#-------------------------------------------------------------------------
1379
CERT_COPY_HOST_LIST=""
1380
if [ "$AUTO" = "true" ]; then
1381
CERT_COPY_HOST_LIST=$SUBMIT_HOST_LIST
1382
for h in $SUBMIT_HOST_LIST; do
1384
$INFOTEXT -log "Adding SUBMIT_HOSTS from file %s" $h
1385
for tmp in `cat $h`; do
1386
$INFOTEXT -log "Adding SUBMIT_HOST %s" $tmp
1387
$SGE_BIN/qconf -as $tmp
1390
$INFOTEXT -log "Adding SUBMIT_HOST %s" $h
1391
$SGE_BIN/qconf -as $h
1395
$INFOTEXT -u "\nAdding Grid Engine submit hosts"
1396
$INFOTEXT "\nPlease now add the list of hosts, which should become submit hosts.\n" \
1397
"Please enter a blank separated list of your submit hosts. You may\n" \
1398
"press <RETURN> if the line is getting too long. Once you are finished\n" \
1399
"simply press <RETURN> without entering a name.\n\n" \
1400
"You also may prepare a file with the hostnames of the machines where you plan\n" \
1401
"to install Grid Engine. This may be convenient if you are installing Grid\n" \
1402
"Engine on many hosts.\n\n"
1404
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n \
1405
"Do you want to use a file which contains the list of hosts (y/n) [n] >> "
1407
if [ $ret = 0 ]; then
1408
AddHostsFromFile submit
1412
if [ $ret = 1 ]; then
1413
AddHostsFromTerminal submit
1416
$INFOTEXT -wait -auto $AUTO -n "Finished adding hosts. Hit <RETURN> to continue >> "
1422
#-------------------------------------------------------------------------
1423
# AddHostsFromFile: Get a list of hosts and add them as
1424
# admin and submit hosts
1431
while [ $done = false ]; do
1433
if [ "$hosttype" = "execd" ]; then
1434
$INFOTEXT -u "\nAdding admin and submit hosts from file"
1435
elif [ "$hosttype" = "submit" ]; then
1436
$INFOTEXT -u "\nAdding submit hosts"
1438
$INFOTEXT -u "\nAdding admin hosts from file"
1440
$INFOTEXT -n "\nPlease enter the file name which contains the host list: "
1442
if [ "$file" = "none" -o ! -f "$file" ]; then
1443
$INFOTEXT "\nYou entered an invalid file name or the file does not exist."
1444
$INFOTEXT -auto $autoinst -ask "y" "n" -def "y" -n \
1445
"Do you want to enter a new file name (y/n) [y] >> "
1450
if [ "$hosttype" = "execd" ]; then
1451
for h in `cat $file`; do
1452
$SGE_BIN/qconf -ah $h
1453
$SGE_BIN/qconf -as $h
1455
elif [ "$hosttype" = "submit" ]; then
1457
$SGE_BIN/qconf -as $h
1458
CERT_COPY_HOST_LIST="$CERT_COPY_HOST_LIST $h"
1461
for h in `cat $file`; do
1462
$SGE_BIN/qconf -ah $h
1470
#-------------------------------------------------------------------------
1471
# AddHostsFromTerminal
1472
# Get a list of hosts and add the mas admin and submit hosts
1474
AddHostsFromTerminal()
1478
while [ $stop = false ]; do
1480
if [ "$hosttype" = "execd" ]; then
1481
$INFOTEXT -u "\nAdding admin and submit hosts"
1482
elif [ "$hosttype" = "submit" ]; then
1483
$INFOTEXT -u "\nAdding submit hosts"
1485
$INFOTEXT -u "\nAdding admin hosts"
1487
$INFOTEXT "\nPlease enter a blank seperated list of hosts.\n\n" \
1488
"Stop by entering <RETURN>. You may repeat this step until you are\n" \
1489
"entering an empty list. You will see messages from Grid Engine\n" \
1490
"when the hosts are added.\n"
1492
$INFOTEXT -n "Host(s): "
1495
if [ "$hosttype" = "execd" ]; then
1497
$SGE_BIN/qconf -ah $h
1498
$SGE_BIN/qconf -as $h
1500
elif [ "$hosttype" = "submit" ]; then
1502
$SGE_BIN/qconf -as $h
1503
CERT_COPY_HOST_LIST="$CERT_COPY_HOST_LIST $h"
1507
$SGE_BIN/qconf -ah $h
1510
if [ "$hlist" = "" ]; then
1513
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
1519
#-------------------------------------------------------------------------
1520
# PrintHostGroup: print an empty hostgroup
1524
$ECHO "group_name $1"
1525
$ECHO "hostlist NONE"
1529
#-------------------------------------------------------------------------
1530
# GetQmasterPort: get communication port SGE_QMASTER_PORT
1535
if [ $RESPORT = true ]; then
1540
PortCollision $SGE_QMASTER_SRV
1541
PortSourceSelect $SGE_QMASTER_SRV
1543
if [ "$SGE_QMASTER_PORT" != "" -a "$port_source" != "db" ]; then
1544
$INFOTEXT -u "\nGrid Engine TCP/IP communication service"
1546
if [ $SGE_QMASTER_PORT -ge 1 -a $SGE_QMASTER_PORT -le $comm_port_max ]; then
1547
$INFOTEXT "\nUsing the environment variable\n\n" \
1548
" \$SGE_QMASTER_PORT=%s\n\n" \
1549
"as port for communication.\n\n" $SGE_QMASTER_PORT
1550
export SGE_QMASTER_PORT
1551
$INFOTEXT -log "Using SGE_QMASTER_PORT >%s<." $SGE_QMASTER_PORT
1552
if [ "$collision_flag" = "services_only" -o "$collision_flag" = "services_env" ]; then
1553
$INFOTEXT "This overrides the preset TCP/IP service >sge_qmaster<.\n"
1555
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n "Do you want to change the port number? (y/n) [n] >> "
1556
if [ "$?" = 0 ]; then
1557
EnterPortAndCheck $SGE_QMASTER_SRV
1562
$INFOTEXT "\nThe environment variable\n\n" \
1563
" \$SGE_QMASTER_PORT=%s\n\n" \
1564
"has an invalid value (it must be in range 1..%s).\n\n" \
1565
"Please set the environment variable \$SGE_QMASTER_PORT and restart\n" \
1566
"the installation or configure the service >sge_qmaster<." $SGE_QMASTER_PORT $comm_port_max
1567
$INFOTEXT -log "Your \$SGE_QMASTER_PORT=%s\n\n" \
1568
"has an invalid value (it must be in range 1..%s).\n\n" \
1569
"Please check your configuration file and restart\n" \
1570
"the installation or configure the service >sge_qmaster<." $SGE_QMASTER_PORT $comm_port_max
1573
$INFOTEXT -u "\nGrid Engine TCP/IP service >sge_qmaster<"
1574
if [ "$port_source" = "env" ]; then
1575
EnterPortAndCheck $SGE_QMASTER_SRV
1578
EnterServiceOrPortAndCheck $SGE_QMASTER_SRV
1579
if [ "$port_source" = "db" ]; then
1580
$INFOTEXT "\nUsing the service\n\n" \
1581
" sge_qmaster\n\n" \
1582
"for communication with Grid Engine.\n"
1584
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
1589
EnterServiceOrPortAndCheck()
1591
if [ "$1" = "sge_qmaster" ]; then
1592
service_name="sge_qmaster"
1593
port_var_name="SGE_QMASTER_PORT"
1595
service_name="sge_execd"
1596
port_var_name="SGE_EXECD_PORT"
1600
# Check if $SGE_SERVICE service is available now
1601
service_available=false
1603
while [ $done = false ]; do
1604
CheckServiceAndPorts service $service_name
1605
if [ $ret != 0 ]; then
1607
$INFOTEXT -u "\nNo TCP/IP service >%s< yet" $service_name
1608
$INFOTEXT -n "\nIf you have just added the service it may take a while until the service\n" \
1609
"propagates in your network. If this is true we can again check for\n" \
1610
"the service >%s<. If you don't want to add this service or if\n" \
1611
"you want to install Grid Engine just for testing purposes you can enter\n" \
1612
"a port number.\n" $service_name
1614
if [ $AUTO != "true" ]; then
1615
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n \
1616
"Check again (enter [n] to specify a port number) (y/n) [y] >> "
1619
$INFOTEXT -log "Setting %s" $port_var_name
1623
if [ $ret = 1 ]; then
1624
if [ $AUTO = true ]; then
1625
$INFOTEXT -log "Please use an unused port number!"
1630
EnterAndValidatePortNumber $1
1631
SelectedPortOutput $1
1636
service_available=true
1645
if [ "$1" = "sge_qmaster" ]; then
1646
service_name="sge_qmaster"
1647
port_var_name="SGE_QMASTER_PORT"
1649
service_name="sge_execd"
1650
port_var_name="SGE_EXECD_PORT"
1653
# Check if $SGE_SERVICE service is available now
1655
while [ $done = false ]; do
1657
if [ $AUTO = true ]; then
1658
$INFOTEXT -log "Please use an unused port number!"
1663
EnterAndValidatePortNumber $1
1664
SelectedPortOutput $1
1666
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
1670
SelectedPortOutput()
1672
if [ "$1" = "sge_qmaster" ]; then
1673
SGE_QMASTER_PORT=$INP
1674
$INFOTEXT "\nUsing the environment variable\n\n" \
1675
" \$SGE_QMASTER_PORT=%s\n\n" \
1676
"as port for communication.\n\n" $SGE_QMASTER_PORT
1677
export SGE_QMASTER_PORT
1678
$INFOTEXT -log "Using SGE_QMASTER_PORT >%s<." $SGE_QMASTER_PORT
1681
$INFOTEXT "\nUsing the environment variable\n\n" \
1682
" \$SGE_EXECD_PORT=%s\n\n" \
1683
"as port for communication.\n\n" $SGE_EXECD_PORT
1684
export SGE_EXECD_PORT
1685
$INFOTEXT -log "Using SGE_EXECD_PORT >%s<." $SGE_EXECD_PORT
1691
EnterAndValidatePortNumber()
1693
$INFOTEXT -u "\nGrid Engine TCP/IP service >%s<\n" $service_name
1695
$INFOTEXT -n "Please enter an unused port number >> "
1697
if [ "$1" = "sge_qmaster" ]; then
1698
INP=`Enter $SGE_QMASTER_PORT`
1700
INP=`Enter $SGE_EXECD_PORT`
1702
if [ "$INP" = "$SGE_QMASTER_PORT" -a $service_name = "sge_execd" ]; then
1703
$INFOTEXT "Please use any other port number!!!"
1704
$INFOTEXT "This %s port number is used by sge_qmaster" $SGE_QMASTER_PORT
1705
if [ $AUTO = "true" ]; then
1706
$INFOTEXT -log "Please use any other port number!!!"
1707
$INFOTEXT -log "This %s port number is used by sge_qmaster" $SGE_QMASTER_PORT
1708
$INFOTEXT -log "Installation failed!!!"
1715
chars=`echo $INP | wc -c`
1716
chars=`expr $chars - 1`
1717
digits=`expr $INP : "[0-9][0-9]*"`
1718
if [ "$chars" != "$digits" ]; then
1719
$INFOTEXT "\nInvalid input. Must be a number."
1720
elif [ $INP -le 1 -o $INP -ge $comm_port_max ]; then
1721
$INFOTEXT "\nInvalid port number. Must be in range [1..%s]." $comm_port_max
1722
elif [ $INP -le 1024 -a $euid != 0 ]; then
1723
$INFOTEXT "\nYou are not user >root<. You need to use a port above 1024."
1725
CheckServiceAndPorts port ${INP}
1727
if [ $ret = 0 ]; then
1728
$INFOTEXT "\nFound service with port number >%s< in >/etc/services<. Choose again." "$INP"
1733
if [ $done = false ]; then
1734
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
1739
########################################################
1741
# Version to convert a version string in X.Y.Z-* or
1742
# X.Y.X_NN format to XYZNN format so can be treated as a
1745
# $1 = version string
1746
# Returns numerical version
1748
########################################################
1749
JavaVersionString2Num () {
1751
# Minor and micro default to 0 if not specified.
1752
major=`echo $1 | awk -F. '{print $1}'`
1753
minor=`echo $1 | awk -F. '{print $2}'`
1754
if [ ! -n "$minor" ]; then
1757
micro=`echo $1 | awk -F. '{print $3}'`
1758
if [ ! -n "$micro" ]; then
1762
# The micro version may further be extended to include a patch number.
1763
# This is typically of the form <micro>_NN, where NN is the 2-digit
1764
# patch number. However it can also be of the form <micro>-XX, where
1765
# XX is some arbitrary non-digit sequence (eg., "rc"). This latter
1766
# form is typically used for internal-only release candidates or
1767
# development builds.
1769
# For these internal builds, we drop the -XX and assume a patch number
1770
# of "00". Otherwise, we extract that patch number.
1773
dash=`echo $micro | grep "-"`
1774
if [ $? -eq 0 ]; then
1775
# Must be internal build, so drop the trailing variant.
1776
micro=`echo $micro | awk -F- '{print $1}'`
1779
underscore=`echo $micro | grep "_"`
1780
if [ $? -eq 0 ]; then
1781
# Extract the seperate micro and patch numbers, ignoring anything
1782
# after the 2-digit patch.
1783
patch=`echo $micro | awk -F_ '{print substr($2, 1, 2)}'`
1784
micro=`echo $micro | awk -F_ '{print $1}'`
1787
echo "${major}${minor}${micro}${patch}"
1789
} # versionString2Num
1792
#---------------------------------------------------------------------------
1795
# sets the env variable SGE_JVM_LIB_PATH
1798
MIN_JAVA_VERSION=1.5.0
1799
NUM_MIN_JAVA_VERSION=`JavaVersionString2Num $MIN_JAVA_VERSION`
1801
if [ "$JAVA_HOME" != "" ]; then
1802
java_home=$JAVA_HOME
1809
while [ $isdone != true ]; do
1810
$INFOTEXT -n "Please enter JAVA_HOME or press enter [%s] >> " "$java_home"
1811
INP=`Enter $java_home`
1812
if [ "$INP" = "" -a ! -x $INP/bin/java ]; then
1813
$INFOTEXT "\nInvalid input. Must be a valid JAVA_HOME path."
1816
if [ "$INP" = "" -o ! -x $INP/bin/java ]; then
1817
$INFOTEXT "\nInvalid input. Must be a valid JAVA_HOME path."
1824
if [ -d $java_home/jre ]; then
1825
java_home=$java_home/jre
1828
JAVA_VERSION=`$java_home/bin/java -version 2>&1 | head -1`
1829
JAVA_VERSION=`echo $JAVA_VERSION | awk '{print $3}' | sed -e "s/\"//g"`
1830
NUM_JAVA_VERSION=`JavaVersionString2Num $JAVA_VERSION`
1832
if [ $NUM_JAVA_VERSION -lt $NUM_MIN_JAVA_VERSION ]; then
1833
$INFOTEXT "Warning: Cannot start jvm thread: Invalid java version (%s)), we need %s or higher" $JAVA_VERSION $MIN_JAVA_VERSION
1839
jvm_lib_path=$java_home/lib/sparcv9/server/libjvm.so
1842
jvm_lib_path=$java_home/lib/amd64/server/libjvm.so
1845
#causes a SEGV of libjvm.so for JVM_RawMonitorCreate
1846
#jvm_lib_path=$java_home/lib/i386/server/libjvm.so
1847
jvm_lib_path=$java_home/lib/i386/client/libjvm.so
1850
jvm_lib_path=$java_home/lib/amd64/server/libjvm.so
1853
jvm_lib_path=$java_home/lib/i386/server/libjvm.so
1856
jvm_lib_path=$java_home/../Libraries/libjvm.dylib
1859
jvm_lib_path=$java_home/../Libraries/libjvm.dylib
1862
$INFOTEXT "Warning: Cannot start jvm thread: Have no java support for $ARCH"
1867
if [ ! -f "$jvm_lib_path" ]; then
1869
$INFOTEXT "\nWarning: Cannot start jvm thread: jvm library %s not found" "$jvm_lib_path"
1872
if [ "$JAVA_HOME" = "" ]; then
1873
JAVA_HOME=$java_home
1875
export jvm_lib_path JAVA_HOME
1879
#---------------------------------------------------------------------------
1882
# sets the env variable SGE_LIBJVM_PATH, SGE_ADDITIONAL_JVM_ARGS, SGE_JMX_PORT
1886
if [ "$SGE_ENABLE_JMX" = "true" ]; then
1888
$INFOTEXT -u "\nGrid Engine JMX MBean server"
1893
if [ $AUTO = "true" ]; then
1895
if [ ! -f "$SGE_JVM_LIB_PATH" ]; then
1896
$INFOTEXT -log "\nWarning: Cannot start jvm thread: jvm library %s not found" "$SGE_JVM_LIB_PATH"
1900
$INFOTEXT -log "\nUsing jvm library >%s<" "$SGE_JVM_LIB_PATH"
1903
if [ "$SGE_JMX_PORT" != "" ]; then
1904
if [ $SGE_JMX_PORT -ge $jmx_port_min -a $SGE_JMX_PORT -le $jmx_port_max ]; then
1905
$INFOTEXT -log "Using SGE_JMX_PORT >%s<." $SGE_JMX_PORT
1907
$INFOTEXT -log "Your \$SGE_JMX_PORT=%s\n\n" \
1908
"has an invalid value (it must be in range %s..%s).\n\n" \
1909
"Please check your configuration file and restart\n" \
1910
"the installation or configure the service >sge_qmaster<." $SGE_JMX_PORT $jmx_port_min $jmx_port_max
1916
# if not set initialize to false
1917
if [ "$SGE_JMX_SSL" = "" ]; then
1920
if [ "$SGE_JMX_SSL_CLIENT" = "" ]; then
1921
SGE_JMX_SSL_CLIENT=false
1929
sge_additional_jvm_args="-Xmx256m"
1931
sge_jmx_ssl_client=false
1932
sge_jxm_ssl_keystore=""
1934
while [ $alldone = false ]; do
1936
$INFOTEXT -e "Please give some basic parameters for JMX MBean server\n" \
1937
"We will ask for\n" \
1939
" - additional JVM arguments (optional)\n" \
1940
" - JMX MBean server port\n" \
1941
" - JMX ssl authentication\n" \
1942
" - JMX ssl client authentication\n" \
1943
" - JMX ssl server keystore path\n" \
1944
" - JMX ssl server keystore password\n"
1946
# set sge_jvm_lib_path
1948
sge_jvm_lib_path=$jvm_lib_path
1950
# set SGE_ADDITIONAL_JVM_ARGS
1951
$INFOTEXT -n "Please enter additional JVM arguments (optional, default is [%s]) >> " "$sge_additional_jvm_args"
1952
INP=`Enter "$sge_additional_jvm_args"`
1953
sge_additional_jvm_args="$INP"
1956
while [ $done != true ]; do
1957
$INFOTEXT -n "Please enter an unused port number for the JMX MBean server >> "
1958
INP=`Enter $sge_jmx_port`
1959
if [ "$INP" = "" ]; then
1960
$INFOTEXT "\nInvalid input. Must be a number."
1963
chars=`echo $INP | wc -c`
1964
chars=`expr $chars - 1`
1965
digits=`expr $INP : "[0-9][0-9]*"`
1966
if [ "$chars" != "$digits" ]; then
1967
$INFOTEXT "\nInvalid input. Must be a number."
1968
elif [ $INP -lt $jmx_port_min -o $INP -gt $jmx_port_max ]; then
1969
$INFOTEXT "\nInvalid port number. Must be in range [%s..%s]." $jmx_port_min $jmx_port_max
1970
elif [ $INP -le 1024 -a $euid != 0 ]; then
1971
$INFOTEXT "\nYou are not user >root<. You need to use a port above 1024."
1979
$INFOTEXT -n -ask "y" "n" -def "y" \
1980
"Enable JMX SSL server authentication (y/n) [y] >> "
1987
if [ "$sge_jmx_ssl" = true ]; then
1988
# set SGE_JMX_SSL_CLIENT
1989
$INFOTEXT -n -ask "y" "n" -def "y" \
1990
"Enable JMX SSL client authentication (y/n) [y] >> "
1992
sge_jmx_ssl_client="true"
1994
sge_jmx_ssl_client="false"
1997
# set SGE_JMX_SSL_KEYSTORE
1998
if [ "$SGE_QMASTER_PORT" != "" ]; then
1999
ca_port=port$SGE_QMASTER_PORT
2003
if [ "$sge_jmx_ssl_keystore" = "" ]; then
2004
sge_jmx_ssl_keystore=/var/sgeCA/$ca_port/$SGE_CELL/private/keystore
2006
$INFOTEXT -n "Enter JMX SSL server keystore path [%s] >> " "$sge_jmx_ssl_keystore"
2007
INP=`Enter "$sge_jmx_ssl_keystore"`
2008
sge_jmx_ssl_keystore="$INP"
2010
# set SGE_JMX_SSL_KEYSTORE_PW
2011
sge_jmx_ssl_keystore_pw=""
2012
STTY_ORGMODE=`stty -g`
2013
$INFOTEXT -n "Enter JMX SSL server keystore pw >> "
2015
INP=`Enter "$sge_jmx_ssl_keystore_pw"`
2016
sge_jmx_ssl_keystore_pw="$INP"
2017
stty "$STTY_ORGMODE"
2018
# echo $sge_jmx_ssl_keystore_pw
2022
# show all parameters and redo if needed
2023
$INFOTEXT "\nUsing the following JMX MBean server settings."
2024
$INFOTEXT " libjvm_path >%s<" "$sge_jvm_lib_path"
2025
$INFOTEXT " Additional JVM arguments >%s<" "$sge_additional_jvm_args"
2026
$INFOTEXT " JMX port >%s<" "$sge_jmx_port"
2027
$INFOTEXT " JMX ssl >%s<" "$sge_jmx_ssl"
2028
$INFOTEXT " JMX client ssl >%s<" "$sge_jmx_ssl_client"
2029
$INFOTEXT " JMX server keystore >%s<" "$sge_jmx_ssl_keystore"
2030
obfuscated_pw=`echo "$sge_jmx_ssl_keystore_pw" | sed 's/./*/g'`
2031
$INFOTEXT " JMX server keystore pw >%s<" "$obfuscated_pw"
2034
$INFOTEXT -ask "y" "n" -def "y" -n \
2035
"Do you want to use these data (y/n) [y] >> "
2038
SGE_JVM_LIB_PATH=$sge_jvm_lib_path
2039
SGE_ADDITIONAL_JVM_ARGS=$sge_additional_jvm_args
2040
SGE_JMX_PORT=$sge_jmx_port
2041
SGE_JMX_SSL=$sge_jmx_ssl
2042
SGE_JMX_SSL_CLIENT=$sge_jmx_ssl_client
2043
SGE_JMX_SSL_KEYSTORE=$sge_jmx_ssl_keystore
2044
SGE_JMX_SSL_KEYSTORE_PW="$sge_jmx_ssl_keystore_pw"
2045
export SGE_JVM_LIB_PATH SGE_JMX_PORT SGE_ADDITIONAL_JVM_ARGS SGE_ENABLE_JMX SGE_JMX_SSL SGE_JMX_SSL_CLIENT SGE_JMX_SSL_KEYSTORE SGE_JMX_SSL_KEYSTORE_PW
2052
$INFOTEXT -wait -auto $AUTO -n "\nHit <RETURN> to continue >> "
2060
#-------------------------------------------------------------------------
2061
# GetExecdPort: get communication port SGE_EXECD_PORT
2066
if [ $RESPORT = true ]; then
2072
PortCollision $SGE_EXECD_SRV
2073
PortSourceSelect $SGE_EXECD_SRV
2074
if [ "$SGE_EXECD_PORT" != "" -a "$port_source" != "db" ]; then
2075
$INFOTEXT -u "\nGrid Engine TCP/IP communication service"
2077
if [ $SGE_EXECD_PORT -ge 1 -a $SGE_EXECD_PORT -le $comm_port_max ]; then
2078
$INFOTEXT "\nUsing the environment variable\n\n" \
2079
" \$SGE_EXECD_PORT=%s\n\n" \
2080
"as port for communication.\n\n" $SGE_EXECD_PORT
2081
export SGE_EXECD_PORT
2082
$INFOTEXT -log "Using SGE_EXECD_PORT >%s<." $SGE_EXECD_PORT
2083
if [ "$collision_flag" = "services_only" -o "$collision_flag" = "services_env" ]; then
2084
$INFOTEXT "This overrides the preset TCP/IP service >sge_execd<.\n"
2086
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n "Do you want to change the port number? (y/n) [n] >> "
2087
if [ "$?" = 0 ]; then
2088
EnterPortAndCheck $SGE_EXECD_SRV
2093
$INFOTEXT "\nThe environment variable\n\n" \
2094
" \$SGE_EXECD_PORT=%s\n\n" \
2095
"has an invalid value (it must be in range 1..%s).\n\n" \
2096
"Please set the environment variable \$SGE_EXECD_PORT and restart\n" \
2097
"the installation or configure the service >sge_execd<." $SGE_EXECD_PORT $comm_port_max
2098
$INFOTEXT -log "Your \$SGE_EXECD_PORT=%s\n\n" \
2099
"has an invalid value (it must be in range 1..%s).\n\n" \
2100
"Please check your configuration file and restart\n" \
2101
"the installation or configure the service >sge_execd<." $SGE_EXECD_PORT $comm_port_max
2104
$INFOTEXT -u "\nGrid Engine TCP/IP communication service "
2105
if [ "$port_source" = "env" ]; then
2107
$INFOTEXT "Make sure to use a different port number for the execution host\n" \
2108
"as on the qmaster machine\n"
2109
if [ `$SGE_UTILBIN/getservbyname $SGE_QMASTER_SRV 2>/dev/null | wc -w` = 0 -a "$SGE_QMASTER_PORT" != "" ]; then
2110
$INFOTEXT "The qmaster port SGE_QMASTER_PORT = %s\n" $SGE_QMASTER_PORT
2111
elif [ `$SGE_UTILBIN/getservbyname sge_qmaster 2>/dev/null | wc -w` != 0 -a "$SGE_QMASTER_PORT" = "" ]; then
2112
$INFOTEXT "sge_qmaster service set to port %s\n" `$SGE_UTILBIN/getservbyname $SGE_QMASTER_SRV | cut -d" " -f2`
2114
$INFOTEXT "The qmaster port SGE_QMASTER_PORT = %s" $SGE_QMASTER_PORT
2115
$INFOTEXT "sge_qmaster service set to port %s\n" `$SGE_UTILBIN/getservbyname $SGE_QMASTER_SRV | cut -d" " -f2`
2117
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
2119
# Check if $SGE_SERVICE service is available now
2120
EnterPortAndCheck $SGE_EXECD_SRV
2123
EnterServiceOrPortAndCheck $SGE_EXECD_SRV
2124
if [ "$service_available" = "true" ]; then
2125
$INFOTEXT "\nUsing the service\n\n" \
2127
"for communication with Grid Engine.\n"
2129
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
2135
#-------------------------------------------------------------------------
2142
if [ $AUTO = "true" ]; then
2143
$INFOTEXT -log "Using >%s< as default domain." $DEFAULT_DOMAIN
2144
CFG_DEFAULT_DOMAIN=$DEFAULT_DOMAIN
2148
while [ $done = false ]; do
2150
$INFOTEXT -u "\nDefault domain for hostnames"
2152
$INFOTEXT "\nSometimes the primary hostname of machines returns the short hostname\n" \
2153
"without a domain suffix like >foo.com<.\n\n" \
2154
"This can cause problems with getting load values of your execution hosts.\n" \
2155
"If you are using DNS or you are using domains in your >/etc/hosts< file or\n" \
2156
"your NIS configuration it is usually safe to define a default domain\n" \
2157
"because it is only used if your execution hosts return the short hostname\n" \
2158
"as their primary name.\n\n" \
2159
"If your execution hosts reside in more than one domain, the default domain\n" \
2160
"parameter must be set on all execution hosts individually.\n"
2162
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n \
2163
"Do you want to configure a default domain (y/n) [y] >> "
2165
$INFOTEXT -n "\nPlease enter your default domain >> "
2166
CFG_DEFAULT_DOMAIN=`Enter ""`
2167
if [ "$CFG_DEFAULT_DOMAIN" != "" ]; then
2168
$INFOTEXT -wait -auto $AUTO -n "\nUsing >%s< as default domain. Hit <RETURN> to continue >> " \
2174
CFG_DEFAULT_DOMAIN=none
2184
$INFOTEXT -u "Scheduler Tuning"
2185
$INFOTEXT -n "\nThe details on the different options are described in the manual. \n"
2188
while [ $done = "false" ]; do
2189
$INFOTEXT -u "Configurations"
2190
$INFOTEXT -n "1) Normal\n Fixed interval scheduling, report limited scheduling information,\n" \
2191
" actual + assumed load\n"
2192
$INFOTEXT -n "2) High\n Fixed interval scheduling, report limited scheduling information,\n" \
2194
$INFOTEXT -n "3) Max\n Immediate Scheduling, report no scheduling information,\n" \
2197
$INFOTEXT -auto $AUTO -n "Enter the number of your preferred configuration and hit <RETURN>! \n" \
2198
"Default configuration is [1] >> "
2201
if [ $AUTO = "false" ]; then
2205
if [ $SCHEDD_CONF = "1" ]; then
2206
is_selected="Normal"
2207
elif [ $SCHEDD_CONF = "2" ]; then
2209
elif [ $SCHEDD_CONF = "3" ]; then
2213
is_selected="Normal"
2216
$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n "\nWe're configuring the scheduler with >%s< settings!\n Do you agree? (y/n) [y] >> " $is_selected
2222
if [ $AUTO = "true" ]; then
2223
$INFOTEXT -log "Setting scheduler configuration to >%s< setting! " $is_selected
2226
case $SCHEDD_CONF in
2229
$SGE_BIN/qconf -Msconf ./util/install_modules/inst_schedd_normal.conf
2233
$SGE_BIN/qconf -Msconf ./util/install_modules/inst_schedd_high.conf
2237
$SGE_BIN/qconf -Msconf ./util/install_modules/inst_schedd_max.conf
2246
$INFOTEXT "If you are using a Berkely DB Server, please add the bdb_checkpoint.sh\n" \
2247
"script to your crontab. This script is used for transaction\n" \
2248
"checkpointing and cleanup in SGE installations with a\n" \
2249
"Berkeley DB RPC Server. You will find this script in:\n" \
2250
"$SGE_ROOT/util/\n\n" \
2251
"It must be added to the crontab of the user (%s), who runs the\n" \
2252
"berkeley_db_svc on the server host. \n\n" \
2253
"e.g. * * * * * <full path to scripts> <sge-root dir> <sge-cell> <bdb-dir>\n" $ADMINUSER
2260
$INFOTEXT -u "Windows Execution Host Support"
2261
$INFOTEXT -auto $AUTO -ask "y" "n" -def "n" -n "\nAre you going to install Windows Execution Hosts? (y/n) [n] >> "
2264
WINDOWS_SUPPORT=true
2265
WindowsDomainUserAccess
2270
WindowsDomainUserAccess()
2273
#The windows domain user access handling has changed -> WIN_DOMAIN_ACCESS always has to be true
2274
#$INFOTEXT -u "Windows Domain User Access"
2275
#$INFOTEXT -auto $AUTO -ask "y" "n" -def "y" -n "\nDo you want to use Windows Domain Users (answer: y)\n" \
2276
# "or are you going to use local Windows Users (answer: n) (y/n) [y] >> "
2277
#if [ $? = 0 ]; then
2278
WIN_DOMAIN_ACCESS=true
2285
if [ "$WINDOWS_SUPPORT" = "true" ]; then
2286
$INFOTEXT -u "Windows Administrator Name"
2287
$INFOTEXT "\nFor a later execution host installation it is recommended to add the\n" \
2288
"Windows Administrator name to the SGE manager list\n"
2289
$INFOTEXT -n "Please, enter the Windows Administrator name [Default: %s] >> " $WIN_ADMIN_NAME
2291
WIN_ADMIN_NAME=`Enter $WIN_ADMIN_NAME`
2293
$SGE_BIN/qconf -am $WIN_ADMIN_NAME
2294
$INFOTEXT -wait -auto $AUTO -n "Hit <RETURN> to continue >> "
2299
#-------------------------------------------------------------------------
2300
# PortCollision: Is there port collison for service, SGE_QMASTER or
2306
# Call CheckPortsCollision conflict and depending on $ret, print out
2309
CheckPortsCollision $service
2311
#$ECHO "collision_flag is $collision_flag \n"
2312
$INFOTEXT -u "\nGrid Engine TCP/IP communication service"
2314
case "$collision_flag" in
2317
$INFOTEXT "\nThe port for %s is currently set by the shell environment.\n\n" $service
2318
if [ "$service" = "sge_qmaster" ]; then
2319
$INFOTEXT " SGE_QMASTER_PORT = %s" $SGE_QMASTER_PORT
2321
$INFOTEXT " SGE_EXECD_PORT = %s" $SGE_EXECD_PORT
2327
$INFOTEXT "\nThe port for %s is currently set as service.\n" $service
2328
if [ "$service" = "sge_qmaster" ]; then
2329
$INFOTEXT " sge_qmaster service set to port %s" `$SGE_UTILBIN/getservbyname $service | cut -d" " -f2`
2331
$INFOTEXT " sge_execd service set to port %s" `$SGE_UTILBIN/getservbyname $service | cut -d" " -f2`
2337
$INFOTEXT "\nThe port for %s is curently set BOTH as service and by the\nshell environment\n" $service
2338
if [ "$service" = "sge_qmaster" ]; then
2339
$INFOTEXT " SGE_QMASTER_PORT = %s" $SGE_QMASTER_PORT
2340
$INFOTEXT " sge_qmaster service set to port %s" `$SGE_UTILBIN/getservbyname $service | cut -d" " -f2`
2342
$INFOTEXT " SGE_EXECD_PORT = %s" $SGE_EXECD_PORT
2343
$INFOTEXT " sge_execd service set to port %s" `$SGE_UTILBIN/getservbyname $service | cut -d" " -f2`
2349
$INFOTEXT "\nThe communication settings for %s are currently not done.\n\n" $service
2359
$INFOTEXT "\nNow you have the possibility to set/change the communication ports by using the\n>shell environment< or you may configure it via a network service, configured\nin local >/etc/service<, >NIS< or >NIS+<, adding an entry in the form\n\n"
2360
$INFOTEXT " %s <port_number>/tcp\n\n" $1
2361
$INFOTEXT "to your services database and make sure to use an unused port number.\n\n"
2362
$INFOTEXT -n "How do you want to configure the Grid Engine communication ports?\n\n"
2363
$INFOTEXT "Using the >shell environment<: [1]\n"
2364
$INFOTEXT -n "Using a network service like >/etc/service<, >NIS/NIS+<: [2]\n\n(default: %s) >> " $INP
2365
#INP will be set in function: PortCollision, we need this as default value for auto install
2368
if [ "$INP" = "1" ]; then
2370
elif [ "$INP" = "2" ]; then
2372
if [ "$1" = "sge_qmaster" ]; then
2373
unset SGE_QMASTER_PORT
2374
export SGE_QMASTER_PORT
2376
unset SGE_EXECD_PORT
2377
export SGE_EXECD_PORT