START_SERVER(1p)
π START_SERVER π
okay so this is a page from the User Contributed Perl Documentation set, and bestie, it's the manual for start_server(1p). buckle up π
β¨ NAME β¨
start_server β a superdaemon for hot-deploying server programs π
no fr, that's the whole vibe. it's a superdaemon. it hot-deploys your server programs. iconic.
π¦ SYNOPSIS π¦
start_server [options] -- server-prog server-arg1 server-arg2 ...
# start Plack using Starlet listening at TCP port 8000
start_server --port=8000 -- plackup -s Starlet --max-workers=100 index.psgi
like, you put your options, then --, then the program you wanna run and its args. that second one is a real live example of starting Plack with Starlet on TCP port 8000. slay π
πΈ DESCRIPTION πΈ
so this script? it's a frontend of Server::Starter. that's it, that's the description. if you want more info you gotta go read the docs for the module itself, bestie. this page is just the flyer, not the whole party π«Ά
π OPTIONS π
every single one, no skips, no cap.
π --port=(port|host:port|port=fd|host:port=fd)
the TCP port to listen to. and if you just... don't pass it? then it won't bind to any ports at all. living free, no ports, no problems β¨
if you don't give a host, the program binds to the default address of IPv4, which is "0.0.0.0". and if you wanna do IPv6 you have to wrap it in square brackets, like --port=[::1]:8080 β yes the brackets are mandatory, it's giving strict.
if an fd is specified, then start_server allocates the socket at that given number.
and here's the fun part: it binds to UDP ports if the port numbers are prefixed by "u", e.g. --port=u443 π₯
π --path=path
the path at where to listen using a unix socket (optional).
π§ --dir=path
working directory. start_server does a chdir to it before exec (optional).
β --interval=seconds
the minimum interval to respawn the server program (default: 1).
π
--signal-on-hup=SIGNAL
name of the signal that gets sent to the server process when start_server receives a SIGHUP (default: SIGTERM).
β οΈ heads up bestie: if you use this option, be sure to also use --signal-on-term below. like, for real, don't skip it.
π --signal-on-term=SIGNAL
name of the signal to be sent to the server process when start_server receives a SIGTERM (default: SIGTERM).
π --pid-file=filename
if set, writes the process id of the start_server process to the file.
π¦ --status-file=filename
if set, writes the status of the server process(es) to the file.
π --envdir=ENVDIR
a directory that contains environment variables for the server processes and the superdaemon. it's inspired by "envdir" in "daemontools". and plot twist: this can be overwritten by the environment variable "ENVDIR" π
β¨ --log-file=file
β¨ --log-file="| cmd args..."
if set, redirects STDOUT and STDERR to the given file or command. two forms, one bullet, one destiny.
π --daemonize
deamonizes the server (by doing fork, setsid, fork).
β οΈ must be used together with --log-file. not optional, not negotiable.
π₯ --enable-auto-restart
enables automatic restart by time. this can be overwritten by the environment variable "ENABLE_AUTO_RESTART".
πΈ --auto-restart-interval=seconds
automatic restart interval (default 360). it is used with the --enable-auto-restart option. this can be overwritten by the environment variable "AUTO_RESTART_INTERVAL".
π«Ά --kill-old-delay=seconds
time to suspend to send a signal to the old worker. the default value is 5 when --enable-auto-restart is set, and 0 otherwise. this can be overwritten by the environment variable "KILL_OLD_DELAY".
π --backlog=size
specifies a listen backlog parameter, whose default is SOMAXCONN (usually 128 on Linux). while SOMAXCONN is enough for most loads, a large backlog is required for heavy loads. so like, if you're popular, size up π
β --restart
this is a wrapper command that reads the pid of the start_server process from --pid-file, sends SIGHUP to the process, and waits until the server(s) of the older generation(s) die by monitoring the contents of the --status-file.
π --stop
this is a wrapper command that reads the pid of the start_server process from --pid-file and sends SIGTERM to the process.
π --help
prints this help.
π¦ --version
prints the version number.
π AUTHOR π
Kazuho Oku β the icon, the moment, the author π
π SEE ALSO π
Server::Starter
π LICENSE π
this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! this was documented by the lovely folks doing User Contributed Perl Documentation, for perl v5.36.0, dated 2022-12-12 β mwah, go hot-deploy something gorgeous πβ¨π
π¦ where this page comes from
- debian bookworm: libserver-starter-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libserver-starter-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libserver-starter-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libserver-starter-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libserver-starter-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms