public
Description: Tempo is a simple team tracking application with a hint of social networking. It focuses on the simple use of a WYSIWYG editor over Wiki syntax so that business users can be involved in the process of editing content to share tribal knowledge as well as communicating project statuses.
Homepage:
Clone URL: git://github.com/bryansray/tempo.git
Click here to lend your support to: tempo and make a donation at www.pledgie.com !
tempo / script / ferret_stop
100755 27 lines (21 sloc) 0.58 kb
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
#!/usr/bin/env script/runner
 
config = ActsAsFerret::Remote::Config.load
 
def send_signal(signal, pid_file)
  pid = open(pid_file).read.to_i
  print "Sending #{signal} to ferret_server with PID #{pid}..."
  begin
    Process.kill(signal, pid)
  rescue Errno::ESRCH
    puts "Process does not exist. Not running. Removing stale pid file anyway."
    File.unlink(pid_file)
  end
 
  puts "Done."
end
 
pid_file = config['pid_file']
puts "Stopping ferret_server..."
if File.file?(pid_file)
  send_signal("TERM", pid_file)
else
  puts "no pid file found"
end
 
# vim:set filetype=ruby: