Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add --pid_file command line option #95

merged 1 commit into from

2 participants


While writing a init script for slanger (do you have an init script and would like to share?), I had problems getting the PID of my slanger service. Using a --require script is possible but this pull request makes it easier to kill the process after starting it in the background.



@stevegraham stevegraham reopened this
@stevegraham stevegraham merged commit f000e38 into stevegraham:master

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 19, 2013
  1. @luniki
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +2 −0 
  2. +10 −0 bin/slanger
2 
@@ -141,6 +141,8 @@ Slanger supports several configuration options, which can be supplied as command
-c or --cert_chain_file Certificate chain file or the Certificate file for SSL support. This argument is optional, if given, SSL will be enabled
-v or --[no-]verbose This makes Slanger run verbosely, meaning WebSocket frames will be echoed to STDOUT. Useful for debugging
+--pid_file The path to a file you want slanger to write it's PID to. Optional.
10 bin/slanger
@@ -59,6 +59,10 @@ do |opts|
options[:debug] = v
+ opts.on '--pid_file PIDFILE', "The slanger process ID file name." do |k|
+ options[:pid_file] = k
+ end
%w<app_key secret>.each do |parameter|
@@ -86,6 +90,12 @@ EM.kqueue do
File.tap { |f| require f.expand_path(f.join(f.dirname(__FILE__),'..', 'slanger.rb')) }
Slanger::Config.load options
+ # Write PID to file
+ unless options[:pid_file].nil?
+[:pid_file], 'w') { |f| f.puts }
+ end
puts "\n"
Something went wrong with that request. Please try again.