View Single Post
  #4   (View Single Post)  
Old 11th September 2008
map7 map7 is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 75
Default

I have done that but it doesn't start on boot.

Below is the whole mongrel_cluster file.

If I take mongrel_cluster_enable="YES" out of /etc/rc.conf then I cannot start it manually, ie: with the command '/usr/local/etc/rc.d/mongrel_cluster start'.



Code:
#!/bin/sh
# PROVIDE: mongrel_cluster
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# This script is modified by placing the following variables inside
# /etc/rc.conf.local, /etc/rc.conf, or /etc/rc.conf.d/mongrel_cluster:
#
# mongrel_cluster_enable (bool):
# 	Set it to YES to enable this service.
#	Default: NO
# mongrel_cluster_conf_dir (path):
# 	The directory containing the configuration file (*.yml) for each
#	application you want to control.
# 	Default: /usr/local/etc/mongrel_cluster

. /etc/rc.subr

name=mongrel_cluster
rcvar=${name}_enable

command="/usr/local/bin/mongrel_cluster_ctl"

load_rc_config $name

: ${mongrel_cluster_enable="NO"}
: ${mongrel_cluster_conf_dir="/usr/local/etc/mongrel_cluster"}

command_args="-c ${mongrel_cluster_conf_dir}"
start_cmd="mongrel_cmd start"
stop_cmd="mongrel_cmd stop"
restart_cmd="mongrel_cmd restart"
status_cmd="mongrel_cmd status"

mongrel_cmd()
{
    if [ ! -d "${mongrel_cluster_conf_dir}/." ]; then
			warn "${mongrel_cluster_conf_dir} is not a directory."
			return 1
    fi
    ${command} $1 ${mongrel_cluster_flags} ${command_args} 2>&1 | grep -v "procfs"
}

run_rc_command "$1"
Reply With Quote