openrc support in init-system-helpers part 2

Matthias Geiger werdahias at riseup.net
Sat Aug 22 13:25:05 BST 2026


On Sat, 22 Aug 2026 14:23, Lorenzo <plorenzo at disroot.org> wrote:
>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
Right, that makes sense. Though rc-update does not support adding a 
service with defaults-disabled afaik.
>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.
My plan is to write a new helper, since the to-be-created package 
openrc-native can't and won't work with sysvinit (scripts), so I will 
try to totally decouple it. The current status of openrc + LSB scripts 
will not go away; but that is already covered by update-rc.d etc.
>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.
Yeah, that would be the plan.
>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.
>
Good point.


I pushed the init check; will try to work on it more during the upcoming 
days.


best,


-- 

Matthias Geiger <werdahias>

Debian Developer -- KiCad Contributor
GPG: ECBEDBB607B9B2BE



More information about the Debian-init-diversity mailing list