0

I want to start service in the following order

mysql mongodb after reboot

I have changed the services mysql init scripts to

lrwxrwxrwx 1 root root  8 Sep  8 11:05 S30mysql -> ../mysql
lrwxrwxrwx 1 root root 10 Sep  8 11:05 S40mongodb -> ../mongodb

30 < 40 so mysql service starts before mongodb

mysql starts properly after reboot but not mongodb ? this is only the case in

SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 0

How do I even investigate when the /etc/init.d/mongodb script is called on reboot ?

Any other steps which I am missing ?

forum.test17
  • 181
  • 1
  • 1
  • 8

2 Answers2

0

What you have done should work.
Did you check the system log and/or mongodb logs to see if there is any clue there?

Eddie Dunn
  • 463
  • 2
  • 9
0

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]}: '
Enzo Wang
  • 121
  • 2