text: .\" generated with Ronn/v0.7.3
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
  .
  .TH "SOCKETMASTER" "1" "December 2013" "PandaStream" ""
  .
  .SH "NAME"
  \fBsocketmaster\fR \- Zero downtime restart for your apps
  .
  .SH "SYNOPSIS"
  \fBsocketmaster\fR [\-listen=URI] [\-command=PATH] [\-start=MILLIS] [\-syslog]
  .
  .SH "DESCRIPTION"
  socketmaster is a generic solution to the restart problem: you want to restart your app but neither lose any active connection nor refuse new connections\.
  .
  .P
  socketmaster opens the socket you want to listen on and passes it onto your program\. Because socketmaster is simple enough it doesn\'t need to be restarted and can keep your file\-descriptor indefinitely open\.
  .
  .TP
  \fB\-command\fR=PATH
  Defines the location of the program to execute and pass the file\-descriptor onto\. If you need to add arguments to the program use a wrapper script\.
  .
  .TP
  \fB\-listen\fR=URI
  One of the following schemes are accepted: tcp, tcp4, tcp6 and unix\. Example: tcp4://localhost:8945 or unix:///tmp/myapp\.sock
  .
  .TP
  \fB\-start\fR=MILLIS
  Determines how long socketmaster waits before signaling the old process\. If MILLIS is set to zero that feature is disabled\.
  .
  .TP
  \fB\-syslog\fR
  Tells socketmaster to log to syslog\.
  .
  .TP
  \fB\-user\fR=LOGIN
  Sets the child process\'s uid/gid to the given user (looked up in /etc/passwd)\. This command only works when socketmaster is run as root\.
  .
  .SH "HOW IT WORKS"
  On start:
  .
  .IP "\(bu" 4
  socketmaster open the \-listen port
  .
  .IP "\(bu" 4
  socketmaster starts the \-command with the socket on fd 3 and EINHORN_FDS=3
  .
  .IP "\(bu" 4
  as soon as all child processes are gone, socketmaster stops as well
  .
  .IP "" 0
  .
  .P
  On SIGHUP:
  .
  .IP "\(bu" 4
  socketmaster starts a new \-command
  .
  .IP "\(bu" 4
  waits for \-start milliseconds
  .
  .IP "\(bu" 4
  sends a SIGHUP to the other child processes
  .
  .IP "" 0
  .
  .P
  Your server is responsible for:
  .
  .IP "\(bu" 4
  opening the socket passed on fd 3
  .
  .IP "\(bu" 4
  not crashing
  .
  .IP "\(bu" 4
  gracefully shutdown on SIGHUP (close the listener, wait for the child connections to close)
  .
  .IP "" 0
  .
  .SH "ENVIRONMENT"
  .
  .TP
  \fBEINHORN_FDS\fR
  This variable is set by socketmaster and passed onto the children\. Its value is always 3 and meant for einhorn compatibility\.
  .
  .SH "SIGNALS"
  On SIGHUP, socketmaster starts a new child process, waits for \-start and sends a HUP to the old process\.
  .
  .P
  SIGINT, SIGTERM and SIGQUIT are forwarded to the child processes\.
  .
  .SH "RELATED PROJECTS"
  .
  .IP "\(bu" 4
  einhorn \fIhttps://github\.com/stripe/einhorn\fR is a project with the same goals, a wider feature\-set and written in ruby\.
  .
  .IP "\(bu" 4
  libancillary \fIhttp://www\.normalesup\.org/~george/comp/libancillary/\fR is a cross\-platform C library to work with file\-descriptors\.
  .
  .IP "\(bu" 4
  portlisten \fIhttp://www\.mail\-archive\.com/kragen\-hacks@canonical\.org/msg00002\.html\fR another approach to port sharing trough UNIX sockets\.
  .
  .IP "\(bu" 4
  systemd \fIhttp://freedesktop\.org/wiki/Software/systemd/\fR is an init system / process manager who supports socket activation and delegation\.
  .
  .IP "\(bu" 4
  circus \fIhttp://circus\.readthedocs\.org/en/latest/\fR is a process manager with socket delegation\.
  .
  .IP "" 0
  .
  .SH "BUGS & CODE"
  Bug reports and other contributions are welcome! The project\'s source and issue tracker is located at \fIhttps://github\.com/zimbatm/socketmaster/\fR
  .
  .SH "COPYRIGHT"
  socketmaster is Copyright (C) 2012 PandaStream \fIhttp://pandastream\.com\fR
  .
  .P
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  .
  .P
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software\.
  .
  .P
  THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE\.
  