spawn-fcgi(1)
β¨ spawn-fcgi(1) β General Commands Manual β¨
ok so bestie, you found the spawn-fcgi page and honestly? iconic of you. it lives in the General Commands Manual section, and it's here to help you spawn FastCGI processes. let's get into it π
π NAME π
spawn-fcgi β spawns FastCGI processes. that's it, that's the whole vibe. β¨
π¦ SYNOPSIS π¦
spawn-fcgi [options] [ -- <fcgiapp> [fcgi app arguments]]
spawn-fcgi -v
spawn-fcgi -h
πΈ DESCRIPTION πΈ
spawn-fcgi is the little helper that goes and spawns your remote and local FastCGI processes. π«Ά
so like, yeah β you literally need it for remote FastCGI backends, because a web server can only spawn the local ones. but here's the tea: the manpage says it's recommended to spawn your local backends with spawn-fcgi too. not required, just, y'know, the move. π
Reasons why you might wanna use spawn-fcgi instead of something else, bestie:
- Privilege separation without needing a suid-binary or running a server as root. π
- You can restart your web server and the FastCGI applications without restarting the others. independent queen behavior.
- You can run them in different
chroot()s. - Running your FastCGI applications doesn't depend on the web server you're running, which allows for easier testing of other web servers. π§ͺ
π OPTIONS π
spawn-fcgi accepts the following options:
-f<path>β Filename of the FastCGI application to spawn. ok listen, this option is deprecated and it's recommend to always specify the application (absolute path) and its parameters after"--"; the fcgiapp parameter is directly used for theexec()call, while for starting the binary given with-f,/bin/shis needed (which may not be available in a chroot). β οΈ
This option is ignored if fcgiapp is given.
-d<path>β Change the current directory before spawning the application.-a<address>β IPv4/IPv6 address to bind to; only used if-pis given too. Defaults to"0.0.0.0"(IPv4).-p<port>β TCP port to bind to; you cannot combine this with the-soption.-s<path>β Path to the Unix domain socket to bind to; you cannot combine this with the-poption.-C<children>β (PHP only) Number of children to spawn by setting thePHP_FCGI_CHILDRENenvironment variable. Default is not to overwrite the environment variable; php will spawn no children if the variable is not set (same as setting it to0).-F<children>β Number of children to fork, defaults to1. This option doesn't work with-n, have a look atmultiwatch(1)if you want to supervise multiple forks on the same socket.-b<backlog>β backlog to allow on the socket (default1024). This is usually limited by the kernel too, checksysctl net.core.somaxconn(default128) for linux.
backlog is the queue of connections that the kernel accepts before the userspace application sees them. π¬
-P<path>β Name of the PID file for spawned processes (ignored in no-fork mode).-nβ No forking should take place (for daemontools).-M<mode>β Change file mode of the Unix domain socket (octal integer); only used if-sis given too. Defaults to read+write for user and group (0660) as far as the umask allows it.-?,-hβ General usage instructions. π«Ά-vβ Shows version information and exits.
The following options are only available if you invoke spawn-fcgi as root:
-c<directory>β Chroot to specified directory; the Unix domain socket is created inside the chroot unless-Sis given.-Sβ Create Unix domain socket beforechroot().-uβ User ID to change to.-gβ Group ID to change to. Defaults to primary group of the user given for-u.-Uβ Change user of the Unix domain socket, defaults to the value of-u. (only used if-sis given)-Gβ Change group of the Unix domain socket, defaults to the primary group of the user given for-U; if-Uwasn't given, defaults to the value of-g. (only used if-sis given)
π reminder bestie: the-c,-S,-u,-g,-Uand-Gcrew only show up when you're running as root. no root, no vibe check.
π SEE ALSO π
svc(8),supervise(8), seehttps://cr.yp.to/daemontools.htmlmultiwatch(1), seehttps://git.lighttpd.net/lighttpd/multiwatch
and that's the whole page, bestie!! π this lil beauty comes from the General Commands Manual fam and it's dated 21 November 2012. go spawn something cute, mwah πβ¨π¦
π¦ where this page comes from
- alpine 3.22: spawn-fcgi-doc 1.6.5-r4 Β· BSD-3-Clause
- alpine 3.23: spawn-fcgi-doc 1.6.6-r0 Β· BSD-3-Clause
- alpine 3.24: spawn-fcgi-doc 1.6.6-r0 Β· BSD-3-Clause
- arch rolling: spawn-fcgi 1.6.6-1 Β· BSD
- debian trixie: spawn-fcgi 1.6.6-1 Β· BSD-3-Clause
- nixos 26.05: spawn-fcgi 1.6.6
- nixpkgs unstable: spawn-fcgi 1.6.6
- ubuntu questing: spawn-fcgi 1.6.6-1
- ubuntu resolute: spawn-fcgi 1.6.6-1build1 Β· BSD-3-Clause
- ubuntu stonking: spawn-fcgi 1.6.6-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms