RC-LOCAL.SERVICE(8)

๐Ÿ’… SYSTEMD-RC-LOCAL-GENERATOR(8) โ€” okay bestie, section 8, let's GO

so this is a page from section 8 of the manual, and it's literally titled SYSTEMD-RC...-GENERATOR(8). yes the title is truncated, that's just how man pages do, don't worry about it ๐Ÿซถ


โœจ NAME โœจ

systemd-rc-local-generator, rc-local.service โ€” a compatibility generator and a service, and together they get /etc/rc.d/rc.local started during boot ๐ŸŒธ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

/usr/lib/systemd/system-generators/systemd-rc-local-generator

rc-local.service

like. that's it. that's the whole vibe. no args, no flags, she simply exists โœจ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so systemd-rc-local-generator is a generator โ€” and here's the tea ๐Ÿ“ โ€” what it does is check whether /etc/rc.d/rc.local exists and is executable. and if it is? it pulls the rc-local.service unit into the boot process. that's the whole job. no cap.

and then rc-local.service is the one that's actually responsible for running that script during late boot. the script gets run after network.target, but lowkey in parallel with most other regular system services. so don't go assuming it has the whole boot process to itself ๐Ÿ’€

not me about to warn you: rc-local.service runs with slightly different semantics than the original System V version. the System V one was executed "last" in the boot process โ€” and "last" is a concept that just does not translate to systemd. it's giving translation error, fr fr ๐Ÿ˜ญ

ALSO. another thing. rc-local.service is ordered after network.target โ€” and bestie, listen, that does not mean the network is functional, okay? see systemd.special(7) for the receipts. if your script needs an actually-configured network connection, you might wanna pull in and order it after network-online.target with a drop-in, like this:

# /etc/systemd/system/rc-local.service.d/network.conf
[Unit]
Wants=network-online.target
After=network-online.target

iconic. moving on โœจ

so the support for /etc/rc.d/rc.local is provided for compatibility with specific System V systems only. and here's the part where I have to be a real one with you: it is strongly recommended to avoid using this script today ๐Ÿ™ˆ instead, provide proper unit files with appropriate dependencies for any scripts you wanna run during the boot process. that's the glow-up. do that instead. ๐Ÿ’–

and heads up โ€” the path to the script is set at compile time and varies between distributions ๐Ÿ‘‘

lastly, systemd-rc-local-generator implements systemd.generator(7). periodt.


๐ŸŒˆ NOTES ๐ŸŒˆ

on systems with SELinux, when you're creating the file, make sure you set the appropriate context ๐ŸŽ€ e.g. with:

sudo restorecon -v /etc/rc.d/rc.local

do NOT skip this one, she will not forgive you ๐Ÿ’…


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


that's the whole page bestie, you ate it, go run your boot scripts responsibly ๐Ÿซถ

this has been systemd 259.10, filed under SYSTEMD-RC...-GENERATOR(8) โ€” and yes the date/version footer is exactly that, no more no less, so take it and slay ๐Ÿ’œโœจ

๐Ÿ“ฆ where this page comes from