Missing new /var subdirectories when adding an RPM to a custom image

I recently added the at package to my custom image via rpm-ostree at container build time. But when I updated my system to the new image and tried to use the at commandt, it complained about a missing directory in /var/spool. Checking the status of the atd service revealed similar complaints.

I checked the RPM with rpm -ql at and it was supposed to install those directories, yet they don’t exist on the system. I didn’t see any errors related to the at package in the build logs. It makes sense that the /var subdirectories wouldn’t be there, since I don’t think there’s a way for an image to mess with an already existing /var filesystem.

But I also have the various libvirt packages on my custom image (libvirt was the first package I added), and /var/libvirt and all its subdirectories are there, and I don’t recall needing to do anything special to make it work. Am I missing something really basic?

The rpm is likely missing an associated tmpfiles.d file to create necessary directories at boot for new services.

When installing an rpm with rpm-ostree, the contents of /var are effectively not available for the booted system so a booted system needs to know to create necessary files. tmpfiles.d is systemd’s solution for this.

You can manually add the directories and file an issue with packager that they need to include that configuration file.

1 Like