Sign in to follow this  
bombai

New custom script after boot

Recommended Posts

Hi,

 

I have installed MongoDB from Packages and it doesnt start automatically every boot up..

 

I have to start it through SSH with every time..

 

mongod --smallfiles

 

Well, I have created two sh versions and place it on /usr/syno/etc/rc.d/

 

#!/bin/sh
# Copyright (c) 2000-2013 Synology Inc. All rights reserved.

#!/bin/sh

if [ "$1" = "start" -o "$1" = "" ]; then
mongod --smallfiles
fi

if [ "$1" = "stop"]; then
#mongod --smallfiles
fi

if [ "$1" = "status"]; then
#mongod --smallfiles
fi

 

And

 

#!/bin/sh

case $1 in
start)
mongod --smallfiles
exit 0
;;
stop)
exit 0
;;
restart)
exit 0
;;
*)
       /bin/echo "usage: $0 { start | stop | restart }" >&2
       exit 1
       ;;
esac

 

I have tried one by one, and in both cases works when NAS boot up, but I can't login to web interface, always shows me "System is preparing, try again later"

 

I delete the script and reboot by SSH, and i can log in on the web interface.

 

What I do wrong?

Share this post


Link to post
Share on other sites
Sign in to follow this