0
- # Server encapsulates the management of merb daemons
0
+ # Server encapsulates the management of Merb daemons.
0
- # Start a merb server, in either foreground, daemonized or cluster mode
0
+ # Start a Merb server, in either foreground, daemonized or cluster mode.
0
+ # The port to which the first server instance should bind to.
0
+ # Subsequent server instances bind to the immediately following ports.
0
+ # Number of servers to run in a cluster.
0
+ # If cluster is left out, then one process will be started. This process
0
+ # will be daemonized if Merb::Config[:daemonize] is true.
0
def start(port, cluster=nil)
0
@@ -33,7 +44,12 @@ module Merb
0
- # Check to see if there is already a merb running on this port
0
+ # port<~to_s>:: The port to check for Merb instances on.
0
+ # True if Merb is running on the specified port.
0
f = "#{Merb.dir_for(:log)}" / "merb.#{port}.pid"
0
pid = IO.read(f).chomp.to_i
0
@@ -43,7 +59,13 @@ module Merb
0
- # Killa merb process with a certain signal.
0
+ # port<~to_s>:: The port of the Merb process to kill.
0
+ # sig<~to_s>:: The signal to send to the process. Defaults to 9.
0
+ # If you pass "all" as the port, the signal will be sent to all Merb
0
Merb::BootLoader::BuildFramework.run
0
@@ -69,7 +91,8 @@ module Merb
0
- # Daemonize a merb server running on a specified port
0
+ # port<~to_s>:: The port of the Merb process to daemonize.
0
@@ -94,7 +117,15 @@ module Merb
0
- # Remove PID file from the filesystem
0
+ # Removes a PID file from the filesystem.
0
+ # The port of the Merb process to whom the the PID file belongs to.
0
+ # If Merb::Config[:pid_file] has been specified, that will be used
0
+ # instead of the port based PID file.
0
def remove_pid_file(port)
0
if Merb::Config[:pid_file]
0
pidfile = Merb::Config[:pid_file]
0
@@ -104,7 +135,15 @@ module Merb
0
FileUtils.rm(pidfile) if File.exist?(pidfile)
0
- # Store PID file on the filesystem
0
+ # Stores a PID file on the filesystem.
0
+ # The port of the Merb process to whom the the PID file belongs to.
0
+ # If Merb::Config[:pid_file] has been specified, that will be used
0
+ # instead of the port based PID file.
0
FileUtils.mkdir_p(Merb.dir_for(:log)) unless File.directory?(Merb.dir_for(:log))
0
if Merb::Config[:pid_file]
0
@@ -115,10 +154,14 @@ module Merb
0
File.open(pidfile, 'w'){ |f| f.write("#{Process.pid}") }
0
- # Change privileges of the process
0
- # to the specified user and group.
0
- # if you only specify user, group
0
- # will be the same as user.
0
+ # Change privileges of the process to the specified user and group.
0
+ # user<String>:: The user who should own the server process.
0
+ # group<String>:: The group who should own the server process.
0
+ # If group is left out, the user will be used as the group.
0
def change_privilege(user, group=user)
0
Merb.logger.info "Changing privileges to #{user}:#{group}"
0
@@ -137,4 +180,4 @@ module Merb
0
\ No newline at end of file
0
\ No newline at end of file
Comments
No one has commented yet.