INITSCRIPT(5)
β¨ INITSCRIPT β¨ (section 5, file formats bestie π)
okay so picture this: you open up the man page for initscript and it's givingβ¦ the humble little glue script that runs EVERYTHING. no cap. she's not famous, she's not flashy, but she is literally the girl behind the curtain. let's get into it π
π NAME π
initscript β the script that executes inittab commands. yeah that's it. that's the whole job description. iconic honestly.
πΈ SYNOPSIS πΈ
/bin/sh /etc/initscript id runlevels action process
look at her. four little arguments and a whole system's worth of responsibility. main character energy fr. π
π¦ DESCRIPTION π¦
so here's the tea, bestie: when the shell script /etc/initscript exists, init will use it to execute the commands from inittab. like, every single one. she's the middleman.
and the whole POINT of that β the reason she's even here β is that you can use her to set up defaults for every process, things like ulimit and umask values. so instead of setting that stuff a million times, you set it once and every process just inherits the vibe. obsessed. β¨
π EXAMPLES π
here's a sample initscript β she might get installed on your system as /etc/initscript.sample. study her. she ate.
#
# initscript Executed by init(8) for every program it
# wants to spawn like this:
#
# /bin/sh /etc/initscript <id> <level> <action> <process>
#
# Set umask to safe level, and enable core dumps.
umask 022
ulimit -c 2097151
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH
# Increase the hard file descriptor limit for all processes
# to 8192. The soft limit is still 1024, but any unprivileged
# process can increase its soft limit up to the hard limit
# with "ulimit -Sn xxx" (needs a 2.2.13 or later Linux kernel).
ulimit -Hn 8192
# Execute the program.
eval exec "$4"
see how she sets umask 022, enables core dumps with ulimit -c 2097151, exports that PATH=/bin:/sbin:/usr/bin:/usr/sbin, bumps the hard file descriptor limit to 8192 for all processes, and then finally hits the eval exec "$4" to actually run the program? that's the whole flow. she's a queen and she knows it. π
π NOTES π
okay real talk time, and I need you to LISTEN: this script is not meant as a startup script for daemons or services. she has nothing to do with an rc.local style script. do not put that on her. π
ββοΈ
she's just a handler for things executed from /etc/inittab. that's her lane and she stays in it.
and likeβ¦ experimenting with this can make your system un(re)bootable. un-bootable. as in, cannot boot. as in, your computer becomes a brick. so be careful, bestie, I'm literally begging you. π
π FILES π
/etc/inittab/etc/initscript
π AUTHOR π
Miquel van Smoorenburg β thank you for your service, king π«Ά
β SEE ALSO β
go read those too, iykyk π
and that's the whole page, bestie!! this lil cutie comes to you from the sysvinit era, dated July 10, 2003 β yes she's vintage, yes she still runs your boot process, and yes she's slaying. mwah π π
π¦ where this page comes from
- debian bookworm: sysvinit-core 3.06-4 Β· GPL-2.0-or-later
- debian trixie: sysvinit-core 3.14-4 Β· GPL-2.0-or-later
- Copyright (C) 1998-2003 Miquel van Smoorenburg
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms