Package: policyrcd-script-zg2
Version: 0.1-3.1
Severity: wishlist
X-Debbugs-Cc: [email protected], [email protected]

zg-policy-rc.d currently has a fallback mechanism for finding the proper
policy-rc.d file:

* If `POLICYRCD` is already set, use the script the variable points to.
* Otherwise, source `/etc/zg-policy-rc.d.conf`, and if `POLICYRCD` is
  now set, use the script the variable points to.
* If `POLICYRCD` still isn't set, try to use
  `/usr/local/sbin/policy-rc.d`.
* And if that fails, then try to use `/etc/policy-rc.d`.

This is good, but it means for an application or package that needs to
introduce controls for service restarts for whatever reason, there's no
way for it to insert it's own `policy-rc.d` implementation that
`zg-policy-rc.d` will pick up, without having to override either
`/usr/local/sbin/policy-rc.d` or `/etc/zg-policy-rc.d.conf`, both of
which are non-ideal.

It would be useful if there was an additional step added after the
`/etc/zg-policy-rc.d.conf` sourcing step:

* Source all `.conf` files under `/usr/share/zg-policy-rc.d/conf.d/`,
  `/etc/zg-policy-rc.d/conf.d/`, and
  `/usr/local/etc/zg-policy-rc.d/conf.d`, in that order, using the
  `C` locale's sort order. If `POLICYRCD` is now set, use the script the
  variable points to.

(This is essentially the same as how most applications would parse
XDG_CONFIG_DIRS, but since XDG isn't very relevant here, it uses
hardcoded app config dirs instead.)

Would this be a feature that an interested user could contribute?
A Debian derivative I work with (Kicksecure) has a use case that would
benefit from this, and I can probably send a patch to implement it.

Attachment: pgpN5ExFSFJP_.pgp
Description: OpenPGP digital signature

Reply via email to