glusterfs/extras/hook-scripts/S40ufo-stop.py
Mohammed Junaid 6a6ec98042 object-storage: Store the lock file in /var/run/swift.
* Openstack swift uses the /var/run/swift directory to store the pid files
  for all the servers.

* Also, added a script that would unmount the gluster client on a volume stop.

Change-Id: Ib5b9a2964987ca7696d9a2570f1f7af8490b2168
BUG: 861497
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.org/4417
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-02-07 14:02:19 -08:00

25 lines
684 B
Python
Executable File

#!/usr/bin/env python
import os
from optparse import OptionParser
if __name__ == '__main__':
# check if swift is installed
try:
from gluster.swift.common.Glusterfs import get_mnt_point, unmount
except ImportError:
import sys
sys.exit("Openstack Swift does not appear to be installed properly");
op = OptionParser(usage="%prog [options...]")
op.add_option('--volname', dest='vol', type=str)
op.add_option('--last', dest='last', type=str)
(opts, args) = op.parse_args()
mnt_point = get_mnt_point(opts.vol)
if mnt_point:
unmount(mnt_point)
else:
sys.exit("get_mnt_point returned none for mount point")