START_SERVER(1)
π START_SERVER(1) π
okay bestie, gather round, because this is START_SERVER(1) from the User Contributed Perl Documentation section and it is so much cooler than it sounds. it's a superdaemon for hot-deploying server programs and it's giving main character energy fr fr π¦
β¨ NAME β¨
start_server β a superdaemon for hot-deploying server programs π
πΈ 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, the -- is the vibe check divider between your flags and the server program's flags. everything after it belongs to the server program, no cap.
π DESCRIPTION π
so this script is literally a frontend of Server::Starter. that's it, that's the whole description. for more info you gotta go read the documentation of the module β this page is just the little door into the bigger house. iykyk π
π OPTIONS π
okay here's the menu, and no we are NOT skipping any of them:
--port=(port|host:port|port=fd|host:port=fd)β the TCP port to listen to. if you just... don't include it, it will not bind to any ports at all, and that's valid of you tbh.- if no
hostis specified, the program binds to the default address of IPv4, which is0.0.0.0π - for an IPv6 address you must use square brackets, like
--port=[::1]:8080β the brackets are the outfit, the address is the girlie π - if
fdis specified, thenstart_serverallocates the socket at the given number. - and get this β it binds to UDP ports when the port numbers are prefixed by
u, like--port=u443β¨ (theustands for "u thought it was TCP? wrong")
- if no
--path=pathβ the path where to listen using a unix socket. it's optional, but lowkey iconic.--dir=pathβ working directory.start_serverdoes achdirto it beforeexec. also optional.--interval=secondsβ the minimum interval to respawn the server program. default is1second β±οΈ--signal-on-hup=SIGNALβ the name of the signal sent to the server process whenstart_serverreceives aSIGHUP. default:SIGTERM. β οΈ and bestie, listen: if you use this option, be sure to also use--signal-on-termbelow. they're a package deal, don't split them up π--signal-on-term=SIGNALβ the name of the signal sent to the server process whenstart_serverreceives aSIGTERM. default:SIGTERM.--pid-file=filenameβ if set, it writes the process id of thestart_serverprocess into the file. cute lil receipt π§Ύ--status-file=filenameβ if set, it writes the status of the server process(es) into the file. another receipt, this one's about the workers π«Ά--envdir=ENVDIRβ a directory containing environment variables for the server processes and the superdaemon. it's inspired byenvdirindaemontoolsβ¨ and it can be overwritten by the environment variableENVDIR.--log-file=file/--log-file="| cmd args..."β if set, redirectsSTDOUTandSTDERRto the given file or command. yes, the pipe version pipes into a command, we love a multitasker π--daemonizeβ daemonizes the server, by doingfork,setsid,fork(the triple threat π). must be used together with--log-file. no log file, no daemon, periodt.--enable-auto-restartβ enables automatic restart by time. can be overwritten by the environment variableENABLE_AUTO_RESTART. β°--auto-restart-interval=secondsβ the automatic restart interval. default is360. it's used with the--enable-auto-restartoption. can be overwritten by the environment variableAUTO_RESTART_INTERVAL.--kill-old-delay=secondsβ the time to suspend before sending a signal to the old worker. the default value is5when--enable-auto-restartis set, and0otherwise. can be overwritten by the environment variableKILL_OLD_DELAY.--backlog=sizeβ specifies a listen backlog parameter, whose default isSOMAXCONN(usually128on Linux). whileSOMAXCONNis enough for most loads, a large backlog is required for heavy loads π₯ so if you're getting slammed, bump it.--restartβ a wrapper command that reads the pid of thestart_serverprocess from--pid-file, sendsSIGHUPto the process, and then waits until the server(s) of the older generation(s) die by monitoring the contents of the--status-file. it's the "out with the old, in with the new" button πΈ--stopβ a wrapper command that reads the pid of thestart_serverprocess from--pid-fileand sendsSIGTERMto the process. the peace-out button π--helpβ prints this help.--versionβ prints the version number.
π AUTHOR π
Kazuho Oku β the icon, the legend, the moment. we stan π«Ά
π SEE ALSO π
Server::Starterβ go read it, bestie, this page is literally just its frontend.
π LICENSE π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. (yes, that's the whole thing, and yes it's iconic π)
and that's the whole page, bestie!! π this was perl v5.42.0, dated 2025-07-25, and it's the START_SERVER(1) page from the User Contributed Perl Documentation. go hot-deploy something gorgeous β¨π¦
π¦ where this page comes from
- fedora 43: perl-Server-Starter-start_server 0.35-18.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms