I'm seeing some strange behaviour when starting a process with an init script. Most likely I am doing something stupid, but perhaps someone could let me know what might cause this behaviour:
[Background: the process is mongodb's monogod running as a config server (2.4), and I'm running on Debian 6. The process runs under user 'mongodb', and I'm issuing commands via SSH as a non-root user]
- When the server is booted, the process appears to start normally (I can see it via ps -ef, and there is a mongodb.pid file generated).
- If I try to stop the process via
sudo /etc/init.d/mongodb stop
, then the weirdness begins : I getmongodb apparently not running
. (The process and the pid are still there though). - Of course, if I try to
sudo /etc/init.d/mongodb start
now I get 'failed' and an error in the log about the port already in use, which is to be expected as there is actually already an instance running. - If I kill -15 the process and then try
sudo /etc/init.d/mongodb start
I get more weirdness: In the console I getStarting database: mongodb failed!
(no more info). But... the process is now running and in the logs I don't see any errors, it just looks as if the process has started normally. - If I try to stop this process with
sudo /etc/init.d/mongodb stop
I get themongodb apparently not running
.
The script in question is here.
Any ideas? Thanks!
EDIT: In case it's something mongo related, here is my mongodb.conf for the config server:
configsvr=true
dbpath=/data/configdb
logpath=/var/log/mongodb/mongodb.log
logappend=true
port = 28222
bind_ip = a_public_ip,127.0.0.1,a_private_ip
auth = true
keyFile = /srv/mongodb/keyfile
nohttpinterface = true
fork = true
Additionally: I'm seeing Starting database: mongodb failed!
during the boot screen (but still there is a process seemingly running normally after boot).