-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpas.mongrel
More file actions
36 lines (31 loc) · 909 Bytes
/
pas.mongrel
File metadata and controls
36 lines (31 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env ruby
#
# mongrel Startup script for Mongrel by Tim Morgan
#
# chkconfig: - 85 15
# description: mongrel manages Mongrel
#
app_dir = '/home'
apps = {
'PAS' => 80
}
if ['stop', 'restart'].include? ARGV.first
apps.each do |path, port|
path = File.join app_dir, path
# puts "Stopping #{path}..."
# `mongrel_rails stop -c #{path} -P log/mongrel.pid`
puts 'please look for mongrel server using ps and kill it manually'
end
end
if ['start', 'restart'].include? ARGV.first
apps.each do |path, port|
path = File.join app_dir, path
puts "Starting #{path} on #{port}..."
`ruby #{path}/script/server mongrel -b192.168.1.2 -p#{port} -eproduction -d`
# `mongrel_rails start -d -p #{port} -e production -c #{path} -P log/mongrel.pid`
end
end
unless ['start', 'stop', 'restart'].include? ARGV.first
puts "Usage: mongrel {start|stop|restart}"
exit
end