SERVICE-POLICY.D(5)
π 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:
- 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.
- the action(s) which
invoke-rc.dwants to take. want more info on the available actions? go read/usr/share/doc/init-system-helpers/README.policy-rc.d.gzπ - the policy to apply to this action. the available policies are:
allowβ allow the action thatinvoke-rc.dwants 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 thatinvoke-rc.dwants to perform by"restart stop". that is, try arestartaction first; if that fails for some reason, try astopaction.
β οΈ 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.gzpolicy-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
- ubuntu resolute: policy-rcd-declarative 0.6build1 Β· GPL-2.0-or-later
- ubuntu stonking: policy-rcd-declarative 0.6build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms