Skip to content

proper support for multiple init.d #823

@navi-desu

Description

@navi-desu

it'd make it easier to upstream services by having a script directory under /usr/libexec/rc to which packages could install to, as well as freeing /etc to be configuration only.

for that, we need to improve configuration loading and dependency resolution. to note that, those issues already affect current installs, as /usr/local/etc, and /usr/pkg/etc under netbsd, (and /usr/etc under linux apparently?) are looked up for services, but rarely things seem to use them.

configuration loading at the moment is based on the path to the init.d, so "${RC_SERVICE%/*}/../conf.d". instead, we should loop every possible script dir, and either load the first conf.d/$RC_SVCNAME we find, or all of them.

init.d logic already does that, loading the first init.d script found, but i argue that configs should overlay while init.d should overwrite

dependency resolution as is, is semi-broken when cross directory init.d are in use, due to the fact that we use shell expansion and thus can only chdir to one directory before matching after * or similar.

we could instead disable shell expansion in gendepends.sh, and instead do such resolution in c, for every script directory, chdir into it, then match wordexpr with WRDE_APPEND to build the actual list

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions