[systemd-devel] Best practice for prepopulating the CacheDirectory of dynamic users

Antoine Pietri antoine.pietri1 at gmail.com
Wed Feb 28 16:33:36 UTC 2018


On Wed, Feb 28, 2018 at 5:13 PM, aleivag <aleivag at gmail.com> wrote:
> do everything in python and use `pystemd` (pip install pystemd, just have
> libsystemd installed and you should be fine)

This is not an option for me as one of our requirements is to have
everything packaged in the repos of Archlinux. But thanks for making
me aware of this library, and your advice also applies to shelling out
to systemd-run.

> and also ditch the
> cachedirectory in favor of PrivateTmp, that is always new when you start
> your unit, and always goes away with your unit.

I do need persistent data here to avoid recloning the repo at each
build, so it's not an option either. I'm not sure that changes
anything, though?

> so my recommendation, create a custom script with your build process and
> call it using pystemd.run.

This is kind of what we're doing right now with the same downsides,
but yeah that also works.

-- 
Antoine Pietri


More information about the systemd-devel mailing list