WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: starting mongodb in bootlocal.sh  (Read 2846 times)

Offline salmankhalid

  • Newbie
  • *
  • Posts: 4
    • E-Jaad
starting mongodb in bootlocal.sh
« on: January 28, 2014, 03:05:47 PM »
Hi all

I am trying to start mongodb on system startup. I have added the following line to the bootlocal.sh

/usr/local/bin/mongodb/bin/mongod --dbpath /mnt/sda1/own/db --journal --fork --syslog

this doesn't start mongodb but if i change the --dbpath option to /data/db it works and starts up. As
tiny core is booting from sda1, so i imagine that sda1 will be mounted .. i have also tried

/usr/local/bin/mongodb/bin/mongod --dbpath /mnt/sda1/own/db --journal --fork --syslog &
/usr/local/bin/mongodb/bin/mongod --dbpath /mnt/sda1/own/db --journal
/usr/local/bin/mongodb/bin/mongod --dbpath /mnt/sda1/own/db --journal &

but still mongodb won't start, I want save the db on disk so that i don;t lose any data on system crash and restarts

Thanks in advance
The green core

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: starting mongodb in bootlocal.sh
« Reply #1 on: January 28, 2014, 03:28:39 PM »
Core does not know where it booted from.
Unless the tce, home, or opt are on sda1, it will not be mounted.
Mount it in bootlocal.sh before you start the database.

Offline malikawan

  • Full Member
  • ***
  • Posts: 243
Re: starting mongodb in bootlocal.sh
« Reply #2 on: January 28, 2014, 03:40:37 PM »
Add "sudo mount /mnt/sda1" and then enter ur code in bootlocal.sh may be it work for u.

Malik Awan

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: starting mongodb in bootlocal.sh
« Reply #3 on: January 28, 2014, 03:44:25 PM »
Do not use sudo in bootlocal.sh.  It runs as root.
just add

mount /mnt/sda1

Offline salmankhalid

  • Newbie
  • *
  • Posts: 4
    • E-Jaad
Re: starting mongodb in bootlocal.sh
« Reply #4 on: January 28, 2014, 05:02:28 PM »
Thanks guys for the quick responses ... but it I'm still unable to start the db with the --dbpath /mnt/sda1 option ... :( ... i have put the mount command in bootlocal.sh before the db startup .. The machine is currently at a remote location so i can't see boot errors on screen also i can;t find mongodb in dmesg but i am not sure if that is the right place look for errors that happen in bootlocal.sh ...
The green core

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: starting mongodb in bootlocal.sh
« Reply #5 on: January 28, 2014, 08:00:15 PM »
You could use boot code "syslog" and check /var/log/messages
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline salmankhalid

  • Newbie
  • *
  • Posts: 4
    • E-Jaad
Re: starting mongodb in bootlocal.sh
« Reply #6 on: January 29, 2014, 05:50:15 AM »
Thank you tinypoodle for the tip ... it truns out that the --journal option was stopping mongodb to start as the 32 bit version limits the DB size to less then 2GB with journalling and sadly my db has crossed that limit .. backed up the old db and created a new one and now it starts.. mount /mnt/sda1 was the correct option to use ..

thank you very much, a great team and great OS

The green core