openrc support in init-system-helpers part 2
Lorenzo
plorenzo at disroot.org
Sat Aug 22 13:23:19 BST 2026
Hi again,
> Am I correct in assuming that this is where I would abstract all
> checks, such as only starting a openrc service if we are truly
> running a openrc system?
>
> I think most functionality would be a thin wrapper over rc-service,
> so I do not see a huge benefit there, but apparently this has to be
> done this way?
> Second, which command line flags to implement etc.
You have to perform two distinct kinds of actions:
1) defaults-(enabled)| defaults-disabled | purge a service -> wrapper
on top of rc-update
2) start| restart| stop an (already enabled) service --> wrapper on
top of rc-service
2) should be a no-op when openrc is not init, 1) can run regardless of
the init system
another way to look at this is that there are commands reserved for the
user (rc-update, rc-service) and others (your wrappers) reserved for
maintainerscripts; user's commands overrides the others, so that, for
example, the user can decide to disable a service that comes as enabled
by default.
I checked now and find out that there are already openrc bits in
sysvinit's update-rc.d and invoke-rc.d so maybe 1) and 2) were already
done?
Worth checking: in that case, my advice to decouple from sysvinit is not
that good and is probably easier to merge openrc support into
dh_installinit.
Also policy-rc.d check is already done in invoke-rc.d and I guess
invoke-rc.d prefers the openrc a native script over the sysvinit one,
if both are available so you don't need a sysvinit override.
You may be fine with teaching dh_installinit to look for a
'servicename.openrc' file in debian/ folder and install it in the
appropriate path.
Of course you need to handle the case where there is an
debian/servicename.openrc but not a debian/servicename.init and make
sure that mainscripts snippets are still injected and that the absence
of an init script does not cause problems.
Best,
Lorenzo
>
> >
> > current status is at codeberg.org/werdahias/rc-helper (arguably not
> > much). I will add some more details soon.
> >
> > best,
> >
> >
>
>
More information about the Debian-init-diversity
mailing list