POLICY-RC.D-DECLARATIVE(8)

πŸ“¦
version 0.6build1 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– POLICY-RC.D-DECLARATIVE πŸ’–

ok so bestie, welcome to policy-rc.d-declarative β€” manual section 8, system administration era. This is the whole vibe: defining system service policies, but declaratively. No cap.


✨ NAME ✨

policy-rc.d-declarative β€” define system service policies declaratively πŸŽ€


🌸 SYNOPSIS 🌸

policy-rc.d

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the lore. Debian policy says that packages which provide system services need to start those services by default, and that the starting of the service should be done by way of the /usr/sbin/invoke-rc.d script. That's just the rule, periodt.

And here's the fun part: that script will execute a program called /usr/sbin/policy-rc.d if it exists. Which means the local system administrator gets to override the behaviour if they want to β€” you literally create a policy script according to the interface specified, and install it as /usr/sbin/policy-rc.d. main character energy fr fr.

But bestie. This interface has some downsides. Not to be dramatic but:

  • While the definition of the policy-rc.d interface specifies that policy scripts should be installed by way of the alternatives system, there are various cases (e.g., the initial installation of Debian from the Debian installer) where installing a policy script is desirable before the alternatives system is even available for use. 😭

So what happens? The installer creates a policy-rc.d script without going through the alternatives system, and then it removes it at the end of the installation. A side effect of this is that any creation of a policy script in the installer will be blown away at the end of an installation. πŸ’€

As a result of this, at least one derivative distribution believed they were installing a policy script into all their installations when in fact they weren't. Not them thinking they ate and then not eating. πŸ™ˆ

  • Because the default state is for there to be no policy script on the system, the fact that the interface exists in the first place is something that is unknown to many long-time Debian users. Having something that can be configured through a (set of) configuration files in /etc instead makes the system discoverable, and allows for better documentation of the interface. That's the glow-up. ✨

Moreover, a scripted interface is far more powerful than necessary; in most cases, all that is needed is a default policy for all services, which does not require a turing-complete language. Like, chill. πŸ’…

So this policy script attempts to solve these issues by allowing system administrators to provide init script policies by way of a declarative interface, rather than a scripted one. Iconic behaviour, honestly. It does this by way of a directory /etc/service-policy.d in which packages and/or system administrators may place files describing the policy to be followed. For more information on how these files should be structured, please see the service-policy.d(5) man page. go read her, she's slaying. 🫢


😭 BUGS 😭

ok so the policy script interface definition states that policy scripts must support --quiet and --list arguments. This policy script does not (yet) implement those. she's a work in progress, your honor. 🌱

The list of allowed actions may be somewhat small at present. Future versions of this policy script are likely to add more, or to add a way to create custom actions. Wishlist bugs (or patches) welcome! pls bestie, contribute, i'm begging πŸ₯Ί

The policy script interface also specifies a runlevel argument to the script. This policy script does not currently use or read that argument, because it is believed to be not helpful. This may change in the future. (the runlevel argument is lowkey getting ignored and honestly? deserved.) πŸ’€


🌈 SEE ALSO 🌈


and that's the whole page bestie, we ate and left no crumbs πŸ“βœ¨

this was POLICY-RC.D-DECLARATIVE(8) β€” yes, that's the manual name, she's fancy like that πŸ’… β€” and the version/source situation is the same as the header, dated 2025-12-08. iykyk.

go forth and be declarative. no scripts, no turing-completeness, just vibes and policy files πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ‘‘β­

πŸ“¦ where this page comes from