Bug 725901

Summary: Permission errors in RPM
Product: [Retired] Katello Reporter: Mike McCune <mmccune>
Component: InfrastructureAssignee: Lukas Zapletal <lzap>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 725793 Environment:
Last Closed: 2011-07-27 07:59:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mike McCune 2011-07-26 22:17:24 UTC
When attempting to run katello from the init.d katello script it fails silently with no rails process.

Starting it manually as the katello user reveals some problems:

# runuser -s /bin/bash katello


bash-4.2$ cd /usr/lib/katello/
bash-4.2$ /usr/lib/katello/script/rails  s -p 3000 -e production
=> Booting WEBrick
=> Rails 3.0.5 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:208:in `initialize': Permission denied - /usr/lib/katello/tmp/pids/server.pid (Errno::EACCES)

Fix perm on /usr/lib/katello/tmp/pids/server.pid which is owned by root:root after RPM is installed and you get:

bash-4.2$ /usr/lib/katello/script/rails  s -p 3000 -e production
=> Booting WEBrick
=> Rails 3.0.5 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
   remove tmp/sass-cache/ 
   remove public/stylesheets/compiled/print.css 
Exiting
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:209:in `delete': Permission denied - /usr/lib/katello/tmp/pids/server.pid (Errno::EACCES)
	from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:209:in `write_pid'
	from /usr/lib/katello/script/rails:81
/usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/actions.rb:72:in `unlink': Permission denied - /usr/lib/katello/public/stylesheets/compiled/sections/dashboard.css (Errno::EACCES)
	from /usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/actions.rb:72:in `remove'
	from /usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/compiler.rb:80:in `clean!'
	from /usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/compiler.rb:79:in `each'
	from /usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/compiler.rb:79:in `clean!'
	from /usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/configuration/helpers.rb:141:in `handle_configuration_change!'
	from /usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/app_integration/rails.rb:61:in `initialize!'
	from /usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/app_integration/rails/actionpack3/railtie.rb:43
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
	from /usr/lib/ruby/gems/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
	from /usr/lib/katello/config/environment.rb:5
	from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
	from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
	from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
	from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
	from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
	from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
	from /usr/lib/katello/config.ru:3
	from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
	from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
	from /usr/lib/katello/config.ru:1:in `new'
	from /usr/lib/katello/config.ru:1

Comment 1 Mike McCune 2011-07-26 22:18:35 UTC
Further errors as jammit attempts to recompile css:

   remove tmp/sass-cache/ 
Exiting
/usr/lib/ruby/gems/1.8/gems/compass-0.11.5/lib/compass/actions.rb:72:in `unlink': Permission denied - /usr/lib/katello/public/stylesheets/compiled/sections/dashboard.css (Errno::EACCES)


This I will solve with a jammit command in the specfile ...

Comment 2 Lukas Zapletal 2011-07-27 07:59:44 UTC
Mike, are you sure you *did not* previously run katello under root?

I have suspicion that you did. Because normally the /usr/lib/katello/tmp/folder is writable for the katello user. If you run it under root the pid file will be created as root (and cannot be overwritten using the normal account then).

I guess this is invalid, or dupe of 725793 which I am going to solve by the jammit command right now. I am closing this, please re-open if you still need a fix. I will test this scenario anyway.