sudo ./starling start运行良好,但sudo服务starling启动失败

时间:2012-03-24 02:05:44

标签: ruby ubuntu rubygems starling-server

sudo ./starling start效果很好但sudo service starling start失败

$ sudo ./starling start
 * Starting Starling Server...                  [ OK ] 
$ sudo ./starling stop
 * Stop Starling Server...                  [ OK ] 
$ sudo service starling stop
 * Starting Starling Server...                                        
/home/keating/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in
`to_specs': Could not find starling (>= 0) amongst [minitest-1.6.0,
rake-0.8.7, rdoc-2.5.8] (Gem::LoadError)    from
/home/keating/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in
`to_spec'   from
/home/keating/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1229:in
`gem'   from /home/keating/.rvm/gems/ruby-1.9.2-p290/bin/starling:18:in
`<main>'

上面的错误是'找不到宝石椋鸟'

关注starling文件(位于/etc/init.d,rwxrwxrwx):

set -e
LOGFILE=/var/log/starling/starling.log SPOOLDIR=/var/spool/starling
PORT=22122 LISTEN=127.0.0.1 PIDFILE=/var/run/starling.pid



NAME=starling DESC="Starling"
INSTALL_DIR=/home/keating/.rvm/gems/ruby-1.9.2-p290/bin/
DAEMON=$INSTALL_DIR/$NAME SCRIPTNAME=/etc/init.d/$NAME
OPTS="-d"

. /lib/lsb/init-functions


d_start() {
        log_begin_msg "Starting Starling Server..."
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $OPTS || log_end_msg 1
        log_end_msg 0 }

d_stop() {
        log_begin_msg "Stopping Starling Server..."
        start-stop-daemon --stop --quiet --pidfile $PIDFILE || log_end_msg 1
        log_end_msg 0 }

case "$1" in start) d_start ;; stop) d_stop ;;
restart|force-reload|reload) d_stop sleep 2 d_start ;;
*) echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" exit 3 ;; esac

exit 0

1 个答案:

答案 0 :(得分:2)

是用rvm的包装脚本创建的starling? http://rvm.io/integration/god/