Command fails to execute in upstart session job
This command:
mongod --fork --dbpath ../data --smallfiles --logpath ../data/mongo.log
runs perfectly from terminal, while in directory /mongo/bin/
But, when I use same command and directory for upstart session job file (at $HOME/.config/upstart):
# mongod_service - mongoDB job file
description "MongoDB service"
author "admin"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
# respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# working directory
chdir /mongo/bin/
# log this job
console log
# Start mongod as daemon
exec mongod --fork --dbpath ../data --smallfiles --logpath ../data/mongo.log
On starting via initctl, I get:
>initctl start mongod-service
>initctl: Job failed to start
And no logs of what goes wrong exactly are produced anywhere !!.
Can anyone suggest how to make this work ? or at least see the error ?
This command:
mongod --fork --dbpath ../data --smallfiles --logpath ../data/mongo.log
runs perfectly from terminal, while in directory /mongo/bin/
But, when I use same command and directory for upstart session job file (at $HOME/.config/upstart):
# mongod_service - mongoDB job file
description "MongoDB service"
author "admin"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
# respawn
# Essentially lets upstart know the process will detach itself to the background
expect fork
# working directory
chdir /mongo/bin/
# log this job
console log
# Start mongod as daemon
exec mongod --fork --dbpath ../data --smallfiles --logpath ../data/mongo.log
On starting via initctl, I get:
>initctl start mongod-service
>initctl: Job failed to start
And no logs of what goes wrong exactly are produced anywhere !!.
Can anyone suggest how to make this work ? or at least see the error ?
No comments:
Post a Comment