#!/bin/sh # # $Id$ # # PROVIDE: glusterfs # REQUIRE: DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable glusterfs: # glusterfs_enable (bool): Set it to "YES" to enable glusterfs. # Default is "NO". # glusterfs_conf (path): Set full path to config file. # Default is "/usr/local/etc/glusterfs/glusterfs.vol". # glusterfs_mount (path): Set full path to mounting point. # Default is "N/A". # glusterfs_flags (str): Flags passed to glusterfs-script on startup. # Default is "-p ${glusterfs_pidfile} -f ${glusterfs_conf}" # . /etc/rc.subr name="glusterfs" rcvar=${name}_enable load_rc_config $name glusterfs_enable=${glusterfs_enable:-"NO"} glusterfs_conf=${glusterfs_conf:-"/usr/local/etc/glusterfs/glusterfs.vol"} glusterfs_pidfile="/var/run/${name}.pid" glusterfs_flags=${glusterfs_flags:-""} glusterfs_mount=${glusterfs_mount:-""} command=/usr/local/sbin/glusterfs command_args="-f ${glusterfs_conf} -p ${glusterfs_pidfile} ${glusterfs_flags} ${glusterfs_mount}" pidfile=${glusterfs_pidfile} required_files=${glusterfs_conf} stop_postcmd=stop_postcmd restart_postmd=restart_postcmd reload_postcmd=restart_postcmd if [ ! -d $glusterfs_mount ]; then echo "Mounting point ${glusterfs_mount} not found. exit..." exit 1 fi stop_postcmd() { rm -f ${pidfile} } restart_postcmd() { rm -f ${pidfile} run_rc_command start } run_rc_command "$1"