I have installed MongoDB
using manual option.
When I fire mongod it will take parameters from somewhere else specially for dbPath
.
I want to have my own dbPath
without specifying it with --dbPath each time.
So I found option to provide mongod.conf
file and call mongod --config
option but still I need to pass path of .conf
file.
My ultimate goal is to just launch mongod as service and it will read config file from path I configured. For this I tried LaunchAgent
and LaunchDaemon
with no luck. What I thought is that if I can configure LaunchAgent
or Daemon then I will provide path to mongod of bin directory of MongoDB folder and provide --config
and path for .conf
file as argument and then I need to just launch mongod using launchctl
with name mongod and it will start mongod --config <.conf file path>
.
But I am not able to do so. I read nearly 15-16 posts on LaunchAgent and Daemon but did not get solution my problem. I tried to do so with making mongod.plist file at various places like /Library/LaunchDaemon
, /Library/LaunchAgent
and ~/Library/LaunchDaemon
but I always get error "Path had bad ownership/permissions
". I tried chown
and chgrp
but no luck.
I hope you got my point. I really need complete solution to achieve my goal.