Ansgar <ans...@43-1.org> writes:

> I would like to recommend packages to use tmpfiles.d(5) to manage
> creating directories in locations such as /var or /etc instead of
> maintainer scripts.

> It could also be used to create trivial files below /var that should be
> recreated if deleted by accident (such as atd's sequence number which is
> currently created by the maintainer script).

Hi all,

Here's where I think we currently are with this proposal:

* There should no longer be any blocker to adding a dependency on
  systemd-tmpfiles since systemd-standalone-tmpfiles exists.

* So far as I can tell, dh_installtmpfiles adds the correct stanza to the
  postinst script for a service to run systemd-tmpfiles after the package
  has installed its tmpfiles.d fragment.  I believe that addresses
  creating these files on installation on systems without any init system?
  (Obviously if tmpfs file systems are subsequently reset on such a
  system, there is nothing in place to recreate these tmp files, but I
  think that's expected and not something we can address?)

* Guillem plans to add support to dpkg to register these files properly as
  package-associated files and also handle creation of the files.  This is
  great, and I am 100% in favor of it.  I don't think that blocks this
  change; to the contrary, I think this change is a good incremental step
  towards that world, since it moves temporary file creation out of
  maintainer scripts into a declarative syntax.  dpkg can then either
  consume the same syntax or packages can later convert that syntax to
  whatever dpkg uses, depending on how the dpkg implementation works,
  which will be a simple and easy-to-detect migration that Lintian can
  diagnose.

Therefore, I don't see anything blocking adopting this as a policy now,
and it seems like an obviously good idea to me.

Am I missing something?  If not, I think the next step is for someone to
propose wording.

In order to handle installations that have no init system, I think we may
have to require that the dependency be listed as:

    systemd-standalone-tmpfiles | systemd-tmpfiles

to avoid trying to install systemd into an init-free chroot.  Maybe I have
that wrong?  Currently, dh_installtmpfiles doesn't add a dependency at
all, probably because it assumes that the package will use a fallback to
create the files in cases without an init system?  Either way, we should
address this in the Policy wording, and then encode that in
dh_installtmpfiles if needed.

-- 
Russ Allbery (r...@debian.org)              <https://www.eyrie.org/~eagle/>

Reply via email to