3 %bcond_without tests # do not perform "make test"
7 Summary: Server::Starter - a superdaemon for hot-deploying server programs
8 Name: perl-Server-Starter
12 License: GPL v1+ or Artistic
13 Group: Development/Languages/Perl
14 Source0: http://www.cpan.org/modules/by-module/Server/%{pdir}-%{pnam}-%{version}.tar.gz
15 # Source0-md5: 10cc818382ff22b27d9af37344fbff18
16 URL: http://search.cpan.org/dist/Server-Starter/
17 BuildRequires: perl-devel >= 1:5.8.0
18 BuildRequires: rpm-perlprov >= 4.1-13
20 BuildRequires: perl-List-MoreUtils
21 BuildRequires: perl-Proc-Wait3
22 BuildRequires: perl-Scope-Guard
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 It is often a pain to write a server program that supports graceful
29 restarts, with no resource leaks. Server::Starter, solves the problem
30 by splitting the task into two. One is start_server, a script provided
31 as a part of the module, which works as a superdaemon that binds to
32 zero or more TCP ports or unix sockets, and repeatedly spawns the
33 server program that actually handles the necessary tasks (for example,
34 responding to incoming commenctions). The spawned server programs
35 under Server::Starter call accept(2) and handle the requests.
37 To gracefully restart the server program, send SIGHUP to the
38 superdaemon. The superdaemon spawns a new server program, and if (and
39 only if) it starts up successfully, sends SIGTERM to the old server
42 By using Server::Starter it is much easier to write a hot-deployable
43 server. Following are the only requirements a server program to be run
44 under Server::Starter should conform to:
46 - receive file descriptors to listen to through an environment
48 - perform a graceful shutdown when receiving SIGTERM
50 A Net::Server personality that can be run under Server::Starter exists
51 under the name Net::Server::SS::PreFork.
54 %setup -q -n %{pdir}-%{pnam}-%{version}
58 --destdir=$RPM_BUILD_ROOT \
62 %{?with_tests:./Build test}
65 rm -rf $RPM_BUILD_ROOT
70 rm -rf $RPM_BUILD_ROOT
73 %defattr(644,root,root,755)
74 %doc Changes README.md
75 %attr(755,root,root) %{_bindir}/start_server
76 %{_mandir}/man1/start_server.1p*
77 %dir %{perl_vendorlib}/Server/Starter
78 %{perl_vendorlib}/Server/Starter/Guard.pm
79 %{perl_vendorlib}/Server/*.pm