THanks Kristina; that's worked (I was missing the logfile definition
to hold output).
I created a couple of shell .command files to quickly start and stop
the daemon from OS X, though I needed to use the full path when
referencing files:
startMongod.command:
/mongodb/mongod -f /mongodb/bin/mongod.ini >> /mongodb/bin/mongod.log
&
stopMongod.command (thanks to another post in this group):
pid=`ps -o pid,command -ax | grep mongod | awk '!/awk/ && !/grep/
{print $1}'`;
if [ "${pid}" != "" ]; then
kill -2 ${pid};
fi
On Jul 31, 1:44 am, Kristina Chodorow <
krist...@10gen.com> wrote:
> The easiest way is to run it in the background:
>
> ./mongod -f ./mongod.ini >> logfile&
>
> If you actually want to fork the process, you could look into using the
> start-stop-daemon. However, the start-stop-daemon won't let you redirect
> output (as far as I've been able to figure out) so you'll have to write a
> shell script with the line above (minus the ampersand) and run something
> like:
>
> start-stop-daemon --start --background --quiet /home/user/startmongo
> #assuming you called your shell script startmongo
>
> Run "man start-stop-daemon" to figure out which options you want to use.
>