~xwang2713/charms/precise/hpcc/hpcc-5.0

« back to all changes in this revision

Viewing changes to hooks/stop

  • Committer: Xiaoming Wang
  • Date: 2014-03-06 04:39:31 UTC
  • Revision ID: xiaoming.wang@lexisnexis.com-20140306043931-r13hyork3347eadr
Again, thanks for taking time to review HPCC Charm. Based on the 5th review we made following changes:
1) add '-e' bash option for all the hook scripts
   So if any statement return non-zero value the hook script will stop 
   execution.
2) Remove unused charm upgrade and hpcc-relation-changed hooks             
   The later will result "INFO" level message from 'juju charm proof'
   as expected.
3) For reported HPCC roxie process fails to start, it is due to lacking
   of network resource (/proc/sys/net/core/rmem_max. It is only happens
   on some Juju local environment. We will open a bug against juju-core.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
 
1
#!/bin/bash -e
2
2
# This will be run when the service is being torn down, allowing you to disable
3
3
# it in various ways..
4
4
# For example, if your web app uses a text file to signal to the load balancer
5
5
# that it is live... you could remove it and sleep for a bit to allow the load
6
6
# balancer to stop sending traffic.
7
7
# rm /srv/webroot/server-live.txt && sleep 30
8
 
service hpcc-init stop
 
8
 
9
9
# work-around current HPCC stop return code
10
 
exit 0
 
10
service hpcc-init stop || :