When “Convention over Configuration” goes wrong
Passenger solves this problem by implementing user switching. A Rails application is started as the owner of the file config/environment.rb. So if /home/webapps/foo/config/environment.rb is owned by joe, then Passenger will launch the corresponding Rails application as joe as well.
It took two experienced programmers an hour and a half to figure this out. I mean, what other application runs as the user of a configuration file? It’s normal (and sensible) to run as the owner of the executable or even as the user that executes the startup but not at the user of a configuration file. If you want to do something different, mark it in big, bold letters, not some little section tucked away in your docs.
April 29th, 2008 at 7:11 am
Actually, I think that could be very useful.
Consider a case where root is going to start a bunch of servers for different users. You don’t want different binaries, and you don’t want to necessarily run as the users, so the ownership of the config file seems like a reasonable place to indicate who to run as.
Though I’d put it IN the config file.. RUNAS=joe or whatever.
April 29th, 2008 at 10:44 am
I think that it’s useful, too but it would be been nice to say “We do things different with this app.” I guess my point is — why did their convention have to be so different than the normal convention?
A config option would have been better — but that configuration, not convention, thus against the Ruby on Rails mantra.