Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

None of the action types described in tmpfiles.d(5) seems to allow for running a command as part of creating a temporary file. It is possible to write an argument to a file, for example with action 'w', but not run fortune > /etc/motd.

Since the recommended way to generate tmp files in Arch Linux is tmpfiles.d, I figure there's a way to do it without resorting to systemd/rc.local hacks.

share|improve this question
up vote 1 down vote accepted

Create a normal .service unit and make it run on boot.

ExecStart=/bin/sh -c "fortune > /etc/motd"

There is no special method for that; writing dynamic contents into a config file is out of scope for tmpfiles.d.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.