#1051471 btrfsd: cron job for calling btrfsd

Package:
btrfsd
Source:
btrfsd
Description:
Tiny Btrfs maintenance daemon
Submitter:
Martin
Date:
2023-09-13 09:54:02 UTC
Severity:
normal
#1051471#5
Date:
2023-09-08 13:20:50 UTC
From:
To:
Dear Matthias,

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.

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.

If not, I would aim to work with Devuan project to create a forked version
of the package. Feel free to close the wish list report in that case.

I ask here, cause I do not like to invest time providing a merge request
on Salsa in case you are not interested to carry a cron job within the
Debian package.

Best,
Martin

#1051471#10
Date:
2023-09-09 22:15:07 UTC
From:
To:
Hi Martin!

Am Fr., 8. Sept. 2023 um 15:24 Uhr schrieb Martin <Martin@lichtvoll.de>:

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.

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).

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.

Cheers,
    Matthias

#1051471#15
Date:
2023-09-10 09:21:01 UTC
From:
To:
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:

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?

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.

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,

#1051471#20
Date:
2023-09-10 13:54:07 UTC
From:
To:
Hi,

Just a note on the libsystemd dependency.
dependency (which, as you say, util-linux has) isn't a problem.

Regards,

Matthew

#1051471#25
Date:
2023-09-13 09:51:56 UTC
From:
To:
Hi,

logrotate cronjob has the following test at the very begin of the script

the same test is used in debhelper snippets and it probably can be used
here if the package removes the dependency on systemd and ships both
the timer and the cronjob.

Best,
Lorenzo