~ibmcharmers/charms/trusty/layer-ibm-platform-lsf-server/trunk

« back to all changes in this revision

Viewing changes to reactive/ibm-platform-lsf-server.sh

  • Committer:
  • Date: 2016-11-02 06:29:10 UTC
  • Revision ID: shilkaul@in.ibm.com-20161102062910-gs67gih8tsev2u22
Incorporated review comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
         # To check for unsupported platforms
17
17
         if [ "$ARCHITECTURE" != "x86_64" -a "$ARCHITECTURE" != "ppc64le" ]; then
18
18
           juju-log "IBM Platform LSF: Unsupported platform. IBM Platform LSF installed with this Charm supports only the x86_64 platform and POWER LE (ppc64le) platforms."
19
 
           exit 1
 
19
           return 1
20
20
         fi
21
21
         # Install nfs-common using apt
22
22
         apt-get install nfs-common -y
27
27
}
28
28
 
29
29
function lsfstart(){
 
30
         # Check if lsf files are available
 
31
         if ! [ -d "$lsf_top/conf" ]; then
 
32
            juju-log "IBM Platform LSF : LSF Install Directory does not exist"
 
33
            return 0
 
34
         fi
30
35
         find_version_distr
31
36
         cd $lsf_top/$lsf_version/$distribution_OS_type/bin
32
37
         set +e
117
122
               juju-log "IBM Platform LSF : LSF administrator lsfadmin user created successfully"
118
123
             else
119
124
               juju-log "IBM Platform LSF : Error while creating the LSF administrator user "
120
 
               exit 0
 
125
               return 0
121
126
             fi
122
127
         fi
123
128
       
238
243
         # Check if lsf files are available
239
244
         if ! [ -d "$lsf_top/conf" ]; then
240
245
            juju-log "IBM Platform LSF : LSF Install Directory does not exist"
241
 
            exit 0
 
246
            return 0
242
247
         fi
243
248
         find_version_distr
244
249
         juju-log "IBM Platform LSF : Setting the LSF profile path"
265
270
         # Check if lsf files are available
266
271
         if ! [ -d "$lsf_top/conf" ]; then
267
272
            juju-log "IBM Platform LSF : LSF Install Directory does not exist"
268
 
            exit 0
 
273
            return 0
269
274
         fi
270
275
         juju-log "IBM Platform LSF : Stopping the LSF Daemons on Server.........."
271
276
         find_version_distr
299
304
         # Stop the LSF Daemons first
300
305
         stop_lsfserver
301
306
         # Remove entry from LSF.cluster file
302
 
         sed -i  '/'$hostname_server'/d' $lsf_top/conf/lsf.cluster.cluster1
 
307
         sed -i  '/'$hostname_server'/d' $lsf_top/conf/lsf.cluster.cluster1 || true
303
308
         remove_state 'ibm-platform-lsf-server.conf.ready'
304
309
         relation_call --state=master.departed dismiss_departed || true 
305
310
}
313
318
 
314
319
         if  [ "$mount_flag" == "ext2/ext3" ]; then
315
320
            juju-log "IBM Platform LSF : /usr/share/lsf directory is not mounted yet, cannot proceed with unmounting"
316
 
            exit 0
 
321
            return 0
317
322
         fi
318
323
         if ! [ -d $lsf_top/conf ]; then
319
324
             juju-log "IBM Platform LSF : No LSF folders , nothing to unmount"