Step 0. run "runlevel" to make sure you are in the right rcX.d dir
Step 1. Check mongodb log
Step 2. Check if "/etc/init.d/mongodb start" is working or not
Step 3. Check /var/log/boot.msg to make sure your S40mongodb script is called during boot time
Note:
/etc/init.d/rc script is responsible for Sxxservice and Kxxservice, once the service is being started/stopped by rc, it prints logs.
346 blogger "$service start"
347 $link start; status=$?
348 echo -en "$rc_reset"
349 splashprogress "$service start"
350
351 case "$status" in
352 [1-47]) failed="${failed:+$failed }$service" ;;
353 [56]) skipped="${skipped:+$skipped }$service" ;;
354 0|*) ;;
355 esac
356
357 blogger "'$service start' exits with status $status"
One can find the logs in /var/log/boot.msg
<notice -- Aug 23 22:51:48.399483000> puppet start
Starting puppet services.
<notice -- Aug 23 22:51:48.462954000> startproc: execve (/usr/bin/puppet) [ /usr/bin/puppet agent --server=puppet.fleetboard.dmz --logdest=/var/log/puppet/puppet.log ], [ CONSOLE=/dev/console SELINUX_INIT=YES ROOTFS_FSTYPE=ext3 SHELL=/bin/
sh TERM=linux ROOTFS_FSCK=0 crashkernel=1 LC_ALL=POSIX INIT_VERSION=sysvinit-2.86 REDIRECT=/dev/tty1 COLUMNS=80
PATH=/bin:/sbin:/usr/bin:/usr/sbin DO_CONFIRM= RUNLEVEL=3 PWD=/ SPLASHCFG= PREVLEVEL=N LINES=25 HOME=/ SHLVL=2 splash=silent SPLASH=no ROOTFS_BLKDEV=/dev/vg00/lvroot _=/sbin/startproc DAEMON=/usr/bin/puppet ]
done
<notice -- Aug 23 22:51:48.980495000> 'puppet start' exits with status 0
If you find out the mongodb script has issues, you can add the following two lines under "#!/bin/bash" in /etc/init.d/mongodb to ease your debugging.
set -x
export PS4='+${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '