Bug#1051471: btrfsd: cron job for calling btrfsd

Martin Steigerwald martin at lichtvoll.de
Sun Sep 10 10:21:01 BST 2023


Hi Matthias.

Thanks for your kind and detailed feedback. As next releases are quite a 
bit away, there is no need to rush anything here. CC'ing the Debian init 
diversity mailing list as to gather additional feedback on whether my 
ideas about how to proceed make sense:

Matthias Klumpp - 10.09.23, 00:15:07 CEST:
> Am Fr., 8. Sept. 2023 um 15:24 Uhr schrieb Martin <Martin at lichtvoll.de>:
> > [...]
> > would you consider to include a cron job into the package in order to
> > make btrfsd installable on systems without Systemd? Of course a change
> > regarding package dedepencies would also be required.
> 
> Sure, that should actually be extremely low-maintenance, there isn't
> any hard dependency the daemon has on systemd - with one exception: It
> uses libsystemd to write to the journal if that's available, and I
> would like to keep that feature. It will however already fall back to
> syslog in case sd-journal isn't available, and libsystemd is inert on
> systems without systemd.

As far as I see on my Devuan system there is libelogin-compat which 
replaces and provides libsystemd0. So I think a dependency on libsystemd0 
would be resolved by having libelogin-compat installed.

However this one is not available on Debian. But while here on Devuan 
installing libsystemd0 directly would remove most of my Plasma desktop, I 
bet on Debian libsystemd0 can be installed without systemd package being 
installed as well. AFAIK util-linux on Debian depends on libsystemd0 for 
example while on Devuan it does not. Any feedback from people using other 
than Systemd init on Debian? Do you have libsystemd0 installed?

I am willing to test whether a btrfsd package with cron job and Systemd 
timer would be installable on Devuan, Debian with Systemd and Debian 
without Systemd. I can do so with my laptop and two VMs.

However for systems without Systemd I bet the hard dependency on "systemd" 
package itself would have to be replaced by something else. I wonder: Is a 
hard dependency on "systemd" package required in case the package also 
provides a cron job in addition to the Systemd timer?

> > I have seen btrfsd in mailing list "debian-devel-changes" but could
> > not find it on my Devuan system.
> > 
> > If yes, I would aim to provide a merge request.
> 
> This could go upstream, I think.
> I do not know if there is a no-overhead way to ship both the cron job
> and systemd timer in the same package with recompilation. But if
> that's not possible, I think at the very least we could provide a
> configuration option upstream to select one or the other, so
> derivatives that don't use systemd could switch to the cron version by
> simply recompiling the package (by checking dpkg vendor strings).

If for example depending on libsystemd0 would be a problem in Devuan it 
would still be preferable to have as much as possible in upstream package, 
so that the diff to be applied to make btrfsd package work on Devuan is as 
small as possible. Of course I'd aim to make btrfsd package usable on 
Debian without Systemd as well, so that there is a benefit for Debian users 
as well.

> What do you think? Unfortunately I know little how to make both
> systems interoperate and avoid having the timer and cron job calling
> the service, so patches would be very welcome.

I'd aim at providing a merge request proposal after gathering enough 
feedback on how to do it properly. I have seen cron jobs checking for 
presence of Systemd and only running in case Systemd is not installed, 
cause otherwise the Systemd timer would do the job. I don't know in which 
package, but I am confident I can find it again. AFAIR the check was pretty 
straight forward.

To people from debian-init-diversity mailing list: Do you have any 
examples of this working? If so, please kindly advice on where to find 
those. Would be nice to be able to at least partly copy an approach that 
has proven itself to work okay.

Best,
-- 
Martin





More information about the Debian-init-diversity mailing list