[katello-devel] Forcing users not to run rake setup as root

Lukas Zapletal lzap at redhat.com
Fri Aug 12 14:38:50 UTC 2011


Hello,

I have been solving an issue caused by running # rake setup as root. 
This creates sqlite3 files with root permissions (when configured to use 
sqlite3). The thing is from this point initdb script wont work anymore, 
because it is executed under katello user.

I pushed a change that wont allow users to run "rake setup" when in 
production mode (6741ccd forcing users not to run rake setup in prod mode):

# RAILS_ENV=production rake setup
rake aborted!
You cannot run "rake setup" as root in production mode

The only way is to use the proper command "service katello initdb". Or 
if you really need to do it, you can still override this behavior with:

# RAILS_ENV=production FORCE_RAKE_SETUP=1 rake setup

But don't tell anyone! :-)

The katello init script now performs additional permission checks which 
should help avoiding permission error problems (schema.rb as root e.g.)

Please note there is a file

/var/log/katello/initdb.log

which holds the complete log of the last service katello initdb command. 
If you run into problems check it out first.

-- 
Later,

  Lukas Zapletal | E32E400A
  RHN Satellite Engineering
  Red Hat Czech s.r.o. Brno




More information about the katello-devel mailing list