我試圖在重新啓動Debian 7.9後配置Redmine的自動啓動,但是,我無法做到這一點。通常我開始與管理平臺兩個命令:Redmine在Debian 7.9重新啓動後自動啓動
- CD /選擇/管理平臺/電流
- Ruby腳本/導軌的WEBrick -e生產-d
要自動啓動服務器,我創建LSBInitScript(/etc/init.d/redmine)。 https://wiki.debian.org/LSBInitScripts
腳本的全部內容:
#!/bin/bash
### BEGIN INIT INFO
# Provides: redmine
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redmine webrick
# Description: redmine webrick server autostart-script
### END INIT INFO
. /lib/lsb/init-functions
# Modify it to your configuration
DIR=/opt/redmine/current
# Start Redmine in daemon mode.
start(){
log_daemon_msg "Starting Redmine WebRick"
cd $DIR
log_progress_msg
ruby script/rails server webrick -e production -d > redmine-start.log 2>&1
log_progress_msg
log_end_msg 0
}
# Stop Redmine daemon
stop(){
log_daemon_msg "Stopping Redmine WebRick"
RUBYPID=`ps aux | grep "ruby script/rails server webrick -e production -d" | grep -v grep | awk '{print $2}'`
log_progress_msg
if [ "x$RUBYPID" != "x" ]; then
kill -2 $RUBYPID
fi
log_end_msg 0
}
# Check if Redmine is running
status(){
RUBYPID=`ps aux | grep "ruby script/rails server webrick -e production -d" | grep -v grep | awk '{print $2}'`
if [ "x$RUBYPID" = "x" ]; then
echo "* Redmine is not running"
else
echo "* Redmine is running"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart|force-reload)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}"
exit 1
esac
我發的文件/etc/init.d/redmine可執行文件,添加它通過
更新rc.d的啓動序列redmine默認值
重新啓動操作系統後,redmine腳本會執行(如redmine-start.log文件所示),但是此文件會報告錯誤。
完整的輸出如下所示:
/var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/spec_set.rb:92:in `block in materialize ': Could not find json-1.8.3 in any of the sources (Bundler :: GemNotFound)
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `map! '
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `materialize '
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/definition.rb:140:in `specs'
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/definition.rb:185:in `specs_for '
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/definition.rb:174:in `requested_specs'
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/environment.rb:18:in `requested_specs'
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/runtime.rb:13:in `setup '
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler.rb:127:in `setup '
from /var/lib/gems/1.9.1/gems/bundler-1.10.6/lib/bundler/setup.rb:18:in `<top (required)> '
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require '
據我判斷,這個錯誤表示該文件JSON-1.8.3無法發現,它似乎,問題是,有些東西沒有安裝。但是,如果我嘗試手動啓動該管理平臺,即
/etc/init.d/redmine開始
那開始會發生沒有錯誤。下一個自然的假設是,系統啓動後,錯誤按照啓動腳本的順序進行。但是這個假設並沒有給出任何答案,因爲這條線應該確保Redmine的推出儘可能晚。
所需的啓動:$所有
我也試過手動拿起裝載的一些訂單,但沒有奏效。 我收到了類似的負面結果,如果不是/etc/init.d中我添加腳本/etc/rc.local中如果不是更新的rc.d我用insserv時。
指南,其他人的腳本給出了同樣的錯誤,在這種情況下我無法在Google中找到這些錯誤。
我該如何解決這個問題?
你說得對。我聲明瞭一些環境變量(export var1 = ..等等),並且能夠讓Redmine運行通過 ** service redmine start ** 但是,當我重新啓動操作系統時,會發生錯誤,但另一個。 /usr/local/rvm/gems/ruby-2.1.5/gems/rmagick-2.13.4/lib/RMagick2.so:[BUG]分割錯誤 ruby 1.9.3p194 - Ruby級別的回溯信息 - -------------------------------------- script/rails:6:in'' 腳本/導軌:6:在'require' –