SERVICE-POLICY.D(5)

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

πŸ’– SERVICE-POLICY.D(5) πŸ’–

okay bestie, this is the manual page for service-policy.d β€” it lives in section 5 of the man pages and it's all about the config files for policy-rc.d-declarative. let's get into it 🫢


✨ NAME ✨

/etc/service-policy.d/*.pol β€” the configuration for policy-rc.d-declarative πŸ’…


🌸 SYNOPSIS 🌸

/etc/service-policy.d/*.pol

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: the files sitting in the directory /etc/service-policy.d get opened and parsed by the policy-rc.d-declarative script. simple as that ✨

each line should have exactly three fields of data, separated by whitespace. any trailing whitespace? ignored. not important, we don't care, it's fine πŸ’…

here's the order of operations, and this part matters:

  • all files are opened in order by file name
  • after that, all rules in a file are evaluated in order

the first rule that matches a given service with a given action gets applied. everything after that is ignored β€” we said what we said, the rest is not it πŸ™ˆ

and if no rule matches a given service with a given action? the default is to exit with exit state 100, which signals "unknown initscript id" to the calling update-rc.d program. periodt.


πŸŽ€ FIELDS πŸŽ€

the file contains these fields:

  1. the service(s) this should apply to. this should be a perl regular expression that matches the init scripts for which this policy should be used.
  2. the action(s) which invoke-rc.d wants to take. want more info on the available actions? go read /usr/share/doc/init-system-helpers/README.policy-rc.d.gz πŸ“–
  3. the policy to apply to this action. the available policies are:
    • allow β€” allow the action that invoke-rc.d wants to perform without modification. no notes, we're letting them cook πŸ”₯
    • deny β€” do not allow the action. nope. not happening. πŸ’€
    • restart-ignore β€” replace the action that invoke-rc.d wants to perform by "restart stop". that is, try a restart action first; if that fails for some reason, try a stop action.
⚠️ okay important caveat bestie: at the time of this writing, not all PID1 implementations support this. notably, the systemd version of invoke-rc.d does not support overriding actions. so like… don't count on it everywhere 😭

🌈 SEE ALSO 🌈

  • /usr/share/doc/init-system-helpers/README.policy-rc.d.gz
  • policy-rc.d-declarative(1)

and that's the whole page, no cap πŸ’– this one's from 2025-12-08, straight out of the SERVICE-POLICY.D(5) era β€” go forth and write your .pol files like the main character you are πŸ‘‘βœ¨

πŸ“¦ where this page comes from