forked from arunjax/cookbooks-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from zephirworks/master
Add FreeBSD support.
- Loading branch information
Showing
5 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This config file is auto-generated by chef | ||
# please don't modify manually | ||
|
||
DAEMON_OPTS="--fork" | ||
|
||
<%= @port ? "DAEMON_OPTS=\"$DAEMON_OPTS --port #{@port}\"" : "" %> | ||
<%= @dbpath ? "DAEMON_OPTS=\"$DAEMON_OPTS --dbpath #{@dbpath}\"" : "" %> | ||
<%= @logpath ? "DAEMON_OPTS=\"$DAEMON_OPTS --logpath #{@logpath}\"" : "" %> | ||
<%= @config ? "DAEMON_OPTS=\"$DAEMON_OPTS --config #{@config}\"" : "" %> | ||
<%= @configdb ? "DAEMON_OPTS=\"$DAEMON_OPTS --configdb #{@configdb}\"" : "" %> | ||
<%= @configsrv ? "DAEMON_OPTS=\"$DAEMON_OPTS --configsvr\"" : "" %> | ||
<%= @shardsrv ? "DAEMON_OPTS=\"$DAEMON_OPTS --shardsvr\"" : "" %> | ||
<% if @replicaset_name %> | ||
DAEMON_OPTS="$DAEMON_OPTS --replSet <%= @replicaset_name %>" | ||
<% end %> | ||
<% if @enable_rest %> | ||
DAEMON_OPTS="$DAEMON_OPTS --rest" | ||
<% end %> | ||
<%= @name %>_command_args="$DAEMON_OPTS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
|
||
# PROVIDE: <%= @provides %> | ||
# REQUIRE: NETWORK | ||
# KEYWORD: shutdown | ||
# | ||
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf | ||
# to enable this service: | ||
# | ||
# <%= @provides %>_enable (bool): Set to NO by default. | ||
# Set it to YES to enable mongod. | ||
# | ||
# Additional configurable variables: | ||
# <%= @provides %>_config (path): Set to /usr/local/etc/mongodb.conf | ||
# by default. Additional configuration. You | ||
# can also use mongod_flags for additional | ||
# command line arguments. | ||
# <%= @provides %>_dbpath (path): Set to /var/db/mongodb by default | ||
# <%= @provides %>_user (username): Set to "mongodb" by default | ||
|
||
. /etc/rc.subr | ||
|
||
name="<%= @provides %>" | ||
rcvar=${name}_enable | ||
|
||
command=/usr/local/bin/mongod | ||
|
||
load_rc_config $name | ||
|
||
: ${<%= @provides %>_enable="NO"} | ||
: ${<%= @provides %>_config="/usr/local/etc/mongodb.conf"} | ||
: ${<%= @provides %>_dbpath="/var/db/mongodb"} | ||
: ${<%= @provides %>_user="mongodb"} | ||
: ${<%= @provides %>_command_args=""} | ||
|
||
if [ "x$<%= @provides %>_command_args" = "x" ] | ||
then | ||
command_args="-f $<%= @provides %>_config --dbpath $<%= @provides %>_dbpath --logappend --logpath $<%= @provides %>_dbpath/<%= @provides %>.log --fork" | ||
else | ||
command_args="$<%= @provides %>_command_args" | ||
fi | ||
|
||
required_dirs=${<%= @provides %>_dbpath} | ||
|
||
run_rc_command "$1" |