Bug 743263 - deltacloud fails to start via aeolus on rhel6.1
Summary: deltacloud fails to start via aeolus on rhel6.1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: CloudForms Cloud Engine
Classification: Retired
Component: aeolus-configure
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
Assignee: Mike Orazi
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-04 12:36 UTC by wes hayutin
Modified: 2012-05-15 20:39 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-15 20:39:23 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2012:0586 0 normal SHIPPED_LIVE new packages: aeolus-configure 2012-05-15 22:31:34 UTC

Description wes hayutin 2011-10-04 12:36:23 UTC
Description of problem:

oot@hp-dl2x170g6-02 ~]# 
[root@hp-dl2x170g6-02 ~]# cat /var/log/deltacloud-core/mock.log 
/usr/bin/deltacloudd[6510]: >> Thin web server (v1.2.5 codename This Is Not A Web Server)
/usr/bin/deltacloudd[6510]: >> Debugging ON
/usr/bin/deltacloudd[6510]: >> Maximum connections set to 1024
/usr/bin/deltacloudd[6510]: >> Listening on localhost:3002, CTRL+C to stop
/usr/bin/deltacloudd[6510]: /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/utils.rb:105: warning: already initialized constant HEX
/usr/bin/deltacloudd[6510]: /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/utils.rb:107: warning: already initialized constant TO_REMEMBER
/usr/bin/deltacloudd[6510]: /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/utils.rb:108: warning: already initialized constant ASCII
/usr/bin/deltacloudd[6510]: /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/errors.rb:128: warning: already initialized constant DEFAULT_CLOSE_ON_4XX_PROBABILITY
/usr/bin/deltacloudd[6510]: /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/parsers.rb:47: warning: already initialized constant DEFAULT_XML_LIBRARY
/usr/bin/deltacloudd[6510]: /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/awsbase.rb:66: warning: already initialized constant AMAZON_PROBLEMS
/usr/bin/deltacloudd[6510]: /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/awsbase.rb:86: warning: already initialized constant DEFAULT_SIGNATURE_VERSION
/usr/bin/deltacloudd[8221]: >> Thin web server (v1.2.5 codename This Is Not A Web Server)
/usr/bin/deltacloudd[8221]: >> Debugging ON
/usr/bin/deltacloudd[8221]: >> Maximum connections set to 1024
/usr/bin/deltacloudd[8221]: >> Listening on localhost:3002, CTRL+C to stop
/usr/bin/deltacloudd[8221]: /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_tcp_server'
/usr/bin/deltacloudd[8221]: : 
/usr/bin/deltacloudd[8221]: no acceptor
/usr/bin/deltacloudd[8221]:  (
/usr/bin/deltacloudd[8221]: RuntimeError
/usr/bin/deltacloudd[8221]: )
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:572:in `start_server'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/backends/tcp_server.rb:16:in `connect'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/backends/base.rb:49:in `start'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `call'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/backends/base.rb:57:in `start'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/server.rb:156:in `start'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/controllers/controller.rb:80:in `start'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/runner.rb:177:in `send'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/runner.rb:177:in `run_command'
/usr/bin/deltacloudd[8221]: 	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/runner.rb:143:in `run!'
/usr/bin/deltacloudd[8221]: 	from /usr/share/deltacloud-core/bin/deltacloudd:223
/usr/bin/deltacloudd[8221]: 	from /usr/bin/deltacloudd:5:in `load'
/usr/bin/deltacloudd[8221]: 	from /usr/bin/deltacloudd:5
Starting Deltacloud API :: mock :: http://localhost:3002/api

/usr/bin/deltacloudd[6510]: >> Stopping ...
Starting Deltacloud API :: mock :: http://localhost:3002/api

/usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/runner.rb:163:in `chdir': Permission denied - /root (Errno::EACCES)
	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/runner.rb:163:in `run_command'
	from /usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/runner.rb:143:in `run!'
	from /usr/share/deltacloud-core/bin/deltacloudd:223
	from /usr/bin/deltacloudd:5:in `load'
	from /usr/bin/deltacloudd:5
Starting Deltacloud API :: mock :: http://localhost:3002/api

Comment 2 Michal Fojtik 2011-10-04 15:47:50 UTC
The 'no acceptor' error means that the port you want to run Deltacloud API on is already occupied by something else (another DC instance?).

The '/usr/lib/ruby/gems/1.8/gems/thin-1.2.5/lib/thin/runner.rb:163:in `chdir':
Permission denied - /root (Errno::EACCES)' is more weird, since it try to cd into the /root directory. My 50cents that you're trying to run DC as the 'root' user, which obviously is not correct.

Comment 3 wes hayutin 2011-10-04 16:23:02 UTC
Sure.. running as root is a bad thing.. but as a user we're not setting this up.
aeolus-configure is.

Comment 4 Mike Orazi 2011-10-04 16:46:44 UTC
aeolus-configure is just running the service via init.  It appears to try to run as $DELTACLOUD_USER or nobody in there.

Comment 5 wes hayutin 2011-10-04 16:47:46 UTC
#!/bin/sh
#
# deltacloud-core   Deltacloud API Core
# chkconfig: 345 90 60
# description: deltacloud-core is primary server process for the \
#             Deltacloud Core component.

### BEGIN INIT INFO
# Provides: deltacloud-core
# Required-Start: 
# Required-Stop: 
# Default-Start: 3 5 
# Default-Stop: 0 1 2 6 
# Short-Description: Deltacloud Core API deamon
# Description: Deltacloud Core API provides access to different cloud providers \
#   using single REST API 
### END INIT INFO

. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/deltacloud-core ] && . /etc/sysconfig/deltacloud-core

exec="/usr/bin/deltacloudd"
prog="deltacloud-core"

[ ! -d /var/log/$prog ] && mkdir -p /var/log/$prog

# You can overide these variables using /etc/sysconfig/deltacloud-core
API_ENV="${API_ENV:-production}"
DRIVER="${DRIVER:-mock}"
PORT="${PORT:-3002}"
HOST="${HOST:-localhost}"
DELTACLOUD_USER="${DELTACLOUD_USER:-nobody}"
LOGFILE="${LOGFILE:-/var/log/$prog/$DRIVER.log}"
LOCKFILE="${LOCKFILE:-/var/lock/subsys/$prog}"

[ -r $LOGFILE ] && chown nobody $LOGFILE
[ -r $LOCKFILE ] && chown nobody $LOCKFILE

start() {
    [ -x $exec ] || exit 5

    echo -n $"Starting $prog: "
    daemon --user "$DELTACLOUD_USER"  "$exec -i $DRIVER -e $API_ENV --port $PORT -r $HOST >> $LOGFILE 2>&1 &"
    retval=$?

    if [ $retval -eq 0 ] && touch $LOCKFILE ; then
      echo_success
      echo
    else
      echo_failure
      echo
    fi
    return $retval
}

stop() {
    echo -n $"Shutting down $prog: "
    killproc deltacloudd
    retval=$?
    if [ $retval -eq 0 ] && rm -f $LOCKFILE ; then
      echo_success
      echo
    else
      echo_failure
      echo
    fi
    return $retval
}

case "$1" in
    start)
      start
      ;;
    stop)
      stop
      ;;
    restart)
      stop
      start
      ;;
    reload)
      ;;
    force-reload)
      restart
      ;;
    status)
      status -p $PIDFILE $prog
      retval=$?
      ;;
    *)
      echo "Usage: $prog {start|stop|restart|status}"
      exit 1
  ;;
esac

exit $retval
[root@hp-dl2x170g6-02 ~]#

Comment 6 Michal Fojtik 2011-10-05 09:30:27 UTC
OK, so the next possible reason for this is just old thin. The version 1.2.5 which is shipped in EPEL sounds pretty old (1.2.11 in Fedora now). I'll try to update the gem tomorrow. Meanwhile please could you try to manually install 'thin' gem (gem install thin) just to test if this helps?

Comment 7 Chris Lalancette 2011-10-05 13:16:51 UTC
Actually I think we figured this one out.  By default, thin tries to start in Dir.pwd.  If you launch the initscript as root, then this is typically /root.  However, prior to launching thin we also transition to nobody:nobody.  So what this means is that a process as nobody:nobody tries to cd to /root, and it fails.  This works in the systemd case because systemd starts the process with a clean environment, in /, by default.

I fixed it by adding an explicit cd / in the initscript, which fixes the issue.

Comment 8 wes hayutin 2011-10-11 14:25:40 UTC
verified in 0.4.0 build

Comment 9 wes hayutin 2011-10-11 14:29:22 UTC
taking off tracker

Comment 11 errata-xmlrpc 2012-05-15 20:39:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-0586.html


Note You need to log in before you can comment on or make changes to this bug.