#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#! /bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_start() {
if [ -x /etc/rc.local ]; then
[ "$VERBOSE" != no ] && log_begin_msg "Running local boot scripts (/etc/rc.local)"
/etc/rc.local
ES=$?
[ "$VERBOSE" != no ] && log_end_msg $ES
return $ES
fi
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
Вот лог, в конфиге установил движ тигр. Но сервер ваобще перестал запускаться при старте убунты.
В ручную запускаю sudo mongod и запускается с движком mmap1 несмотря на то что прописан тигр в конфиге. Но когда запускаю в ручную с префиксом --тигр то с тигром запускается нормально. Но мне нужно чтобы он запускался при старте с тигром
2015-09-28T03:13:08.799+0300 I JOURNAL [initandlisten] journal dir=/data/db/journal
2015-09-28T03:13:08.799+0300 I JOURNAL [initandlisten] recover : no journal files present, no recovery needed
2015-09-28T03:13:08.837+0300 I JOURNAL [durability] Durability thread started
2015-09-28T03:13:08.837+0300 I CONTROL [initandlisten] MongoDB starting : pid=3547 port=27017 dbpath=/data/db 64-bit host=ubuntu
2015-09-28T03:13:08.837+0300 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2015-09-28T03:13:08.837+0300 I CONTROL [initandlisten]
2015-09-28T03:13:08.837+0300 I CONTROL [initandlisten]
2015-09-28T03:13:08.837+0300 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-09-28T03:13:08.837+0300 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-09-28T03:13:08.837+0300 I CONTROL [initandlisten]
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten] ** We suggest setting it to 'never'
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten]
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten] db version v3.0.6
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten] git version: 1ef45a23a4c5e3480ac919b28afcba3c615488f2
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten] build info: Linux ip-10-184-200-117 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten] allocator: tcmalloc
2015-09-28T03:13:08.838+0300 I CONTROL [initandlisten] options: {}
2015-09-28T03:13:08.837+0300 I JOURNAL [journal writer] Journal writer thread started
2015-09-28T03:13:08.851+0300 I NETWORK [initandlisten] waiting for connections on port 27017
2015-09-28T03:13:14.916+0300 I NETWORK [initandlisten] connection accepted from 127.0.0.1:39313 #1 (1 connection now open)
2015-09-28T03:13:14.923+0300 I NETWORK [initandlisten] connection accepted from 127.0.0.1:39314 #2 (2 connections now open)
2015-09-28T03:13:37.552+0300 I NETWORK [initandlisten] connection accepted from 127.0.0.1:39315 #3 (3 connections now open)
2015-09-28T03:13:37.564+0300 I NETWORK [initandlisten] connection accepted from 127.0.0.1:39316 #4 (4 connections now open)
А зачем это? про алиасы знаю, а почему нельзя где то где прописаны запускаемые при старте убунты сервисы, просто добавть к монге префикс с тигром? или я чего то не понимаю в этой схеме?
Как то не кашерно. Но все равно большое спасибо!
Пока поищу способ чтобы она при запуске убунты запускалась не просто как обычно а с параметром тирг движка
вывод
2015-09-26T07:22:45.784+0300 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory ./mongodata not found., terminating
2015-09-26T07:22:45.784+0300 I CONTROL [initandlisten] dbexit: rc: 100
и после mongo
laji@ubuntu:~/mongodata$ mongo
MongoDB shell version: 3.0.6
connecting to: test
2015-09-26T07:23:28.644+0300 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-09-26T07:23:28.645+0300 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed