1START_SERVER(1) User Contributed Perl Documentation START_SERVER(1)
2
3
4
6 start_server - a superdaemon for hot-deploying server programs
7
9 start_server [options] -- server-prog server-arg1 server-arg2 ...
10
11 # start Plack using Starlet listening at TCP port 8000
12 start_server --port=8000 -- plackup -s Starlet --max-workers=100 index.psgi
13
15 This script is a frontend of Server::Starter. For more information
16 please refer to the documentation of the module.
17
19 --port=(port|host:port|port=fd|host:port=fd)
20 TCP port to listen to (if omitted, will not bind to any ports)
21
22 If host is not specified, then the program will bind to the default
23 address of IPv4 ("0.0.0.0"). Square brackets should be used to specify
24 an IPv6 address (e.g. --port=[::1]:8080)
25
26 If fd is specified, then start_server allocates the socket at the given
27 number.
28
29 The command binds to UDP ports if the port numbers are prefixed by "u"
30 (e.g., --port=u443).
31
32 --path=path
33 path at where to listen using unix socket (optional)
34
35 --dir=path
36 working directory, start_server do chdir to before exec (optional)
37
38 --interval=seconds
39 minimum interval to respawn the server program (default: 1)
40
41 --signal-on-hup=SIGNAL
42 name of the signal to be sent to the server process when start_server
43 receives a SIGHUP (default: SIGTERM). If you use this option, be sure
44 to also use "--signal-on-term" below.
45
46 --signal-on-term=SIGNAL
47 name of the signal to be sent to the server process when start_server
48 receives a SIGTERM (default: SIGTERM)
49
50 --pid-file=filename
51 if set, writes the process id of the start_server process to the file
52
53 --status-file=filename
54 if set, writes the status of the server process(es) to the file
55
56 --envdir=ENVDIR
57 directory that contains environment variables to the server processes
58 and superdaemon. It is inspired by "envdir" in "daemontools". This
59 can be overwritten by environment variable "ENVDIR".
60
61 --log-file=file
62 --log-file="| cmd args..."
63 if set, redirects STDOUT and STDERR to given file or command
64
65 --daemonize
66 deamonizes the server (by doing fork,setsid,fork). Must be used
67 together with "--log-file".
68
69 --enable-auto-restart
70 enables automatic restart by time. This can be overwritten by
71 environment variable "ENABLE_AUTO_RESTART".
72
73 --auto-restart-interval=seconds
74 automatic restart interval (default 360). It is used with
75 "--enable-auto-restart" option. This can be overwritten by environment
76 variable "AUTO_RESTART_INTERVAL".
77
78 --kill-old-delay=seconds
79 time to suspend to send a signal to the old worker. The default value
80 is 5 when "--enable-auto-restart" is set, 0 otherwise. This can be
81 overwritten by environment variable "KILL_OLD_DELAY".
82
83 --backlog=size
84 specifies a listen backlog parameter, whose default is SOMAXCONN
85 (usually 128 on Linux). While SOMAXCONN is enough for most loads, large
86 backlog is required for heavy loads.
87
88 --restart
89 this is a wrapper command that reads the pid of the start_server
90 process from --pid-file, sends SIGHUP to the process and waits until
91 the server(s) of the older generation(s) die by monitoring the contents
92 of the --status-file
93
94 --stop
95 this is a wrapper command that reads the pid of the start_server
96 process from --pid-file, sends SIGTERM to the process.
97
98 --help
99 prints this help
100
101 --version
102 prints the version number
103
105 Kazuho Oku
106
108 Server::Starter
109
111 This library is free software; you can redistribute it and/or modify it
112 under the same terms as Perl itself.
113
114
115
116perl v5.34.0 2022-01-21 START_SERVER(1)