Sha256: a2863ab495a4e94f01692ccfc75b3f20621f003f17b72321eeef3687ef030d17
Contents?: true
Size: 854 Bytes
Versions: 31
Compression:
Stored size: 854 Bytes
Contents
#!/usr/bin/env ruby user = "<%=user%>" port = "<%=port%>" path = "<%=path%>" pid = "mongrel.pid" ENV["PATH"] = "%s/bin:%s" % [`gem env gemdir`.strip, ENV["PATH"]] case ARGV.first when "start" Dir.chdir(path) puts "Starting MyAppServer at http://localhost:#{port}/" exit system("PATH=#{ENV["PATH"]} mongrel_rails start " \ "--user #{user} --group #{user} --pid #{pid} --daemonize " \ "--port #{port} 2>&1 | grep -v cgi_multipart_eof_fix") ? 0 : 1 when "stop" Dir.chdir(path) exit system("PATH=#{ENV["PATH"]} mongrel_rails stop " \ "--pid #{pid} 2>&1 | grep -v cgi_multipart_eof_fix") ? 0 : 1 when "status" begin Process.kill(0, File.read(File.join(path, pid)).to_i) exit 0 rescue Errno::ENOENT, Errno::ESRCH exit -1 # File or pid not found end else puts "ERROR: expected argument -- start, stop or status" end
Version data entries
31 entries across 31 versions & 2 rubygems