about summary refs log tree commit homepage
path: root/bin
diff options
context:
space:
mode:
authorzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-05-21 15:05:38 +0000
committerzedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9>2006-05-21 15:05:38 +0000
commit3843f96fb430880a7d6d0cd75b72940be3675d7c (patch)
treeaed219442d42765e1ba172d9763943a3e5f87499 /bin
parentc45b6f077e87b5cbd8cf88e57b9deb6151eefdc7 (diff)
downloadunicorn-3843f96fb430880a7d6d0cd75b72940be3675d7c.tar.gz
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@204 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'bin')
-rw-r--r--bin/mongrel_rails7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/mongrel_rails b/bin/mongrel_rails
index 14858bf..46c4dad 100644
--- a/bin/mongrel_rails
+++ b/bin/mongrel_rails
@@ -36,8 +36,8 @@ class Start < GemPlugin::Plugin "/commands"
       ['-C', '--config PATH', "Use a config file", :@config_file, nil],
       ['-S', '--script PATH', "Load the given file as an extra config script.", :@config_script, nil],
       ['-G', '--generate CONFIG', "Generate a config file for -C", :@generate, nil],
-      ['-u', '--user USER', "User to run as", :@user, nil],
-      ['-g', '--group GROUP', "Group to run as", :@group, nil]
+      ['', '--user USER', "User to run as", :@user, nil],
+      ['', '--group GROUP', "Group to run as", :@group, nil]
     ]
   end
 
@@ -62,6 +62,7 @@ class Start < GemPlugin::Plugin "/commands"
   
   def valid_user?(user)
     valid?(Process.uid == 0, "You must be root to change the user.")
+    valid?(@group, "You must also specify a group.")
     begin
       Etc.getpwnam(user)
     rescue
@@ -72,6 +73,7 @@ class Start < GemPlugin::Plugin "/commands"
   
   def valid_group?(group)
     valid?(Process.uid == 0, "You must be root to change the group.")
+    valid?(@user, "You must also specify a user.")
     begin
       Etc.getgrnam(group)
     rescue
@@ -140,6 +142,7 @@ class Start < GemPlugin::Plugin "/commands"
 
     config.run
     config.log "Mongrel available at #{settings[:host]}:#{settings[:port]}"
+    config.log "Use CTRL-C to stop." if not @daemon
     config.join
 
     if config.needs_restart